Taos API Reference
    Preparing search index...

    Interface ButtonSpec

    interface ButtonSpec {
        id: string;
        left?: string;
        right?: string;
        top?: string;
        bottom?: string;
        size?: number;
        label: string;
        mode?: ButtonMode;
        className?: string;
        style?: ButtonStyle;
        onStyle?: ButtonStyle;
        initialOn?: boolean;
        onDown?: () => void;
        onUp?: () => void;
        onToggle?: (on: boolean) => void;
    }
    Index

    Properties

    id: string
    left?: string
    right?: string
    top?: string
    bottom?: string
    size?: number

    Diameter in pixels. Default 64.

    label: string
    mode?: ButtonMode

    Behavior: tap (default), hold, toggle, multi-hold.

    className?: string

    Extra CSS class for custom styling rules.

    style?: ButtonStyle

    Override of the default visual style.

    onStyle?: ButtonStyle

    For toggle: visual override when the button is "on".

    initialOn?: boolean

    For toggle: initial on/off. Default false.

    onDown?: () => void

    Fires on press (tap fires on release, others on first touchstart).

    onUp?: () => void

    Fires on release (hold / multi-hold).

    onToggle?: (on: boolean) => void

    Toggle change callback; receives the new state.