mithril-materialized
    Preparing search index...

    Interface LikertScaleAttrs<T>

    Likert scale component attributes

    interface LikertScaleAttrs<T extends number = number> {
        alignLabels?: boolean;
        "aria-label"?: string;
        "aria-labelledby"?: string;
        ariaLabel?: string;
        class?: string;
        className?: string;
        defaultValue?: T;
        density?: LikertScaleDensity;
        description?: string;
        disabled?: boolean;
        endLabel?: string;
        getLabelText?: (value: number, min: number, max: number) => string;
        id?: string;
        isMandatory?: boolean;
        key?: string | number;
        label?: string;
        layout?: LikertScaleLayout;
        max?: number;
        middleLabel?: string;
        min?: number;
        name?: string;
        onchange?: (value: T) => void;
        readonly?: boolean;
        showNumbers?: boolean;
        showTooltips?: boolean;
        size?: LikertScaleSize;
        startLabel?: string;
        step?: number;
        style?: any;
        tooltipLabels?: string[];
        value?: T;
        onbeforeremove?(this: any, vnode: VnodeDOM<any, any>): void | Promise<any>;
        onbeforeupdate?(
            this: any,
            vnode: Vnode<any, any>,
            old: VnodeDOM<any, any>,
        ): boolean | void;
        oncreate?(this: any, vnode: VnodeDOM<any, any>): any;
        oninit?(this: any, vnode: Vnode<any, any>): any;
        onremove?(this: any, vnode: VnodeDOM<any, any>): any;
        onupdate?(this: any, vnode: VnodeDOM<any, any>): any;
        [property: string]: any;
    }

    Type Parameters

    • T extends number = number

    Hierarchy

    • Attributes
      • LikertScaleAttrs

    Indexable

    • [property: string]: any

      Any other virtual element properties, including attributes and event handlers.

    Index

    Properties

    alignLabels?: boolean

    Use CSS grid for label/scale alignment in multi-question surveys (default: false)

    "aria-label"?: string

    ARIA label for the component

    "aria-labelledby"?: string

    ARIA labelledby reference

    ariaLabel?: string

    ARIA label for the component (camelCase alternative)

    class?: string

    The class name(s) for this virtual element, as a space-separated list.

    className?: string

    Class name for the container

    defaultValue?: T

    Initial value for uncontrolled mode

    Density variant (default: 'standard')

    description?: string

    Helper text description

    disabled?: boolean

    Whether the component is disabled

    endLabel?: string

    Anchor label for maximum value (e.g., "Very Happy")

    getLabelText?: (value: number, min: number, max: number) => string

    Function to get label text for accessibility

    id?: string

    HTML ID for the component

    isMandatory?: boolean

    If true, add a mandatory '*' after the label

    key?: string | number

    A key to optionally associate with this element.

    label?: string

    Question/prompt text

    Layout mode (default: 'responsive' = horizontal on desktop, vertical on mobile)

    max?: number

    Maximum scale value (default: 5)

    middleLabel?: string

    Anchor label for middle value (optional, e.g., "Neutral")

    min?: number

    Minimum scale value (default: 1)

    name?: string

    Name for form submission

    onchange?: (value: T) => void

    Callback when value changes

    readonly?: boolean

    Whether the component is read-only

    showNumbers?: boolean

    Whether to display numeric values (default: false)

    showTooltips?: boolean

    Whether to show tooltips on hover (default: false)

    Size variant (default: 'medium')

    startLabel?: string

    Anchor label for minimum value (e.g., "Very Unhappy")

    step?: number

    Step size for scale increments (default: 1)

    style?: any

    Additional CSS styles

    tooltipLabels?: string[]

    Custom tooltip labels for each value

    value?: T

    Current value for controlled mode

    Methods

    • The onbeforeremove hook is called before a DOM element is detached from the document. If a Promise is returned, Mithril only detaches the DOM element after the promise completes.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns void | Promise<any>

    • The onbeforeupdate hook is called before a vnode is diffed in a update.

      Parameters

      • this: any
      • vnode: Vnode<any, any>
      • old: VnodeDOM<any, any>

      Returns boolean | void

    • The oncreate hook is called after a DOM element is created and attached to the document.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns any

    • The oninit hook is called before a vnode is touched by the virtual DOM engine.

      Parameters

      • this: any
      • vnode: Vnode<any, any>

      Returns any

    • The onremove hook is called before a DOM element is removed from the document.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns any

    • The onupdate hook is called after a DOM element is updated, while attached to the document.

      Parameters

      • this: any
      • vnode: VnodeDOM<any, any>

      Returns any