@antadesign/anta
    Preparing search index...

    Interface ASwitchAttributesUnreviewed

    Attributes for the <a-switch> custom element. It is a binary, form-associated immediate-setting control. Its visual checked state is stored in ElementInternals and styled through :state(checked). role="switch" and the accessible name remain the consumer's responsibility; the Switch wrapper supplies both.

    interface ASwitchAttributes {
        onClick?: (e: any) => void;
        onDoubleClick?: (e: any) => void;
        onAuxClick?: (e: any) => void;
        onContextMenu?: (e: any) => void;
        onMouseDown?: (e: any) => void;
        onMouseUp?: (e: any) => void;
        onMouseEnter?: (e: any) => void;
        onMouseLeave?: (e: any) => void;
        onMouseMove?: (e: any) => void;
        onMouseOver?: (e: any) => void;
        onMouseOut?: (e: any) => void;
        onPointerDown?: (e: any) => void;
        onPointerUp?: (e: any) => void;
        onPointerMove?: (e: any) => void;
        onPointerEnter?: (e: any) => void;
        onPointerLeave?: (e: any) => void;
        onPointerOver?: (e: any) => void;
        onPointerOut?: (e: any) => void;
        onPointerCancel?: (e: any) => void;
        onGotPointerCapture?: (e: any) => void;
        onLostPointerCapture?: (e: any) => void;
        onTouchStart?: (e: any) => void;
        onTouchEnd?: (e: any) => void;
        onTouchMove?: (e: any) => void;
        onTouchCancel?: (e: any) => void;
        onKeyDown?: (e: any) => void;
        onKeyUp?: (e: any) => void;
        onFocus?: (e: any) => void;
        onBlur?: (e: any) => void;
        onChange?: (e: any) => void;
        onInput?: (e: any) => void;
        onBeforeInput?: (e: any) => void;
        onInvalid?: (e: any) => void;
        onReset?: (e: any) => void;
        onSubmit?: (e: any) => void;
        onSelect?: (e: any) => void;
        onCopy?: (e: any) => void;
        onCut?: (e: any) => void;
        onPaste?: (e: any) => void;
        onCompositionStart?: (e: any) => void;
        onCompositionUpdate?: (e: any) => void;
        onCompositionEnd?: (e: any) => void;
        onDrag?: (e: any) => void;
        onDragStart?: (e: any) => void;
        onDragEnd?: (e: any) => void;
        onDragEnter?: (e: any) => void;
        onDragLeave?: (e: any) => void;
        onDragOver?: (e: any) => void;
        onDrop?: (e: any) => void;
        onScroll?: (e: any) => void;
        onWheel?: (e: any) => void;
        onAnimationStart?: (e: any) => void;
        onAnimationEnd?: (e: any) => void;
        onAnimationIteration?: (e: any) => void;
        onTransitionEnd?: (e: any) => void;
        onLoad?: (e: any) => void;
        onError?: (e: any) => void;
        onAbort?: (e: any) => void;
        onToggle?: (e: any) => void;
        onBeforeToggle?: (e: any) => void;
        onCanPlay?: (e: any) => void;
        onCanPlayThrough?: (e: any) => void;
        onDurationChange?: (e: any) => void;
        onEmptied?: (e: any) => void;
        onEnded?: (e: any) => void;
        onLoadedData?: (e: any) => void;
        onLoadedMetadata?: (e: any) => void;
        onLoadStart?: (e: any) => void;
        onPause?: (e: any) => void;
        onPlay?: (e: any) => void;
        onPlaying?: (e: any) => void;
        onProgress?: (e: any) => void;
        onRateChange?: (e: any) => void;
        onSeeked?: (e: any) => void;
        onSeeking?: (e: any) => void;
        onStalled?: (e: any) => void;
        onSuspend?: (e: any) => void;
        onTimeUpdate?: (e: any) => void;
        onVolumeChange?: (e: any) => void;
        onWaiting?: (e: any) => void;
        key?: string | number | null;
        id?: string;
        class?: string;
        className?: string;
        style?: CSSProperties;
        children?: ReactNode;
        slot?: string;
        tabIndex?: number;
        role?: string;
        tone?:
            | "brand"
            | "neutral"
            | "info"
            | "success"
            | "warning"
            | "critical"
            | string & {};
        "tone-scope"?: ToneScope;
        size?: "small"
        | "medium"
        | "large";
        round?: boolean | number | string;
        "label-position"?: "start" | "end";
        state?: "checked" | "unchecked";
        "default-state"?: "checked" | "unchecked";
        disabled?: boolean | "";
        name?: string;
        value?: string;
        onstatechange?: (
            e: CustomEvent<
                { next: "checked"
                | "unchecked"; prev: "checked" | "unchecked" },
            >,
        ) => void;
        onchange?: (e: Event) => void;
        "aria-checked"?: "true" | "false";
        "aria-disabled"?: "true" | "false";
        "aria-label"?: string;
    }

    Hierarchy (View Summary)

    Index
    onClick?: (e: any) => void
    onDoubleClick?: (e: any) => void
    onAuxClick?: (e: any) => void
    onContextMenu?: (e: any) => void
    onMouseDown?: (e: any) => void
    onMouseUp?: (e: any) => void
    onMouseEnter?: (e: any) => void
    onMouseLeave?: (e: any) => void
    onMouseMove?: (e: any) => void
    onMouseOver?: (e: any) => void
    onMouseOut?: (e: any) => void
    onPointerDown?: (e: any) => void
    onPointerUp?: (e: any) => void
    onPointerMove?: (e: any) => void
    onPointerEnter?: (e: any) => void
    onPointerLeave?: (e: any) => void
    onPointerOver?: (e: any) => void
    onPointerOut?: (e: any) => void
    onPointerCancel?: (e: any) => void
    onGotPointerCapture?: (e: any) => void
    onLostPointerCapture?: (e: any) => void
    onTouchStart?: (e: any) => void
    onTouchEnd?: (e: any) => void
    onTouchMove?: (e: any) => void
    onTouchCancel?: (e: any) => void
    onKeyDown?: (e: any) => void
    onKeyUp?: (e: any) => void
    onFocus?: (e: any) => void
    onBlur?: (e: any) => void
    onChange?: (e: any) => void
    onInput?: (e: any) => void
    onBeforeInput?: (e: any) => void
    onInvalid?: (e: any) => void
    onReset?: (e: any) => void
    onSubmit?: (e: any) => void
    onSelect?: (e: any) => void
    onCopy?: (e: any) => void
    onCut?: (e: any) => void
    onPaste?: (e: any) => void
    onCompositionStart?: (e: any) => void
    onCompositionUpdate?: (e: any) => void
    onCompositionEnd?: (e: any) => void
    onDrag?: (e: any) => void
    onDragStart?: (e: any) => void
    onDragEnd?: (e: any) => void
    onDragEnter?: (e: any) => void
    onDragLeave?: (e: any) => void
    onDragOver?: (e: any) => void
    onDrop?: (e: any) => void
    onScroll?: (e: any) => void
    onWheel?: (e: any) => void
    onAnimationStart?: (e: any) => void
    onAnimationEnd?: (e: any) => void
    onAnimationIteration?: (e: any) => void
    onTransitionEnd?: (e: any) => void
    onLoad?: (e: any) => void
    onError?: (e: any) => void
    onAbort?: (e: any) => void
    onToggle?: (e: any) => void
    onBeforeToggle?: (e: any) => void
    onCanPlay?: (e: any) => void
    onCanPlayThrough?: (e: any) => void
    onDurationChange?: (e: any) => void
    onEmptied?: (e: any) => void
    onEnded?: (e: any) => void
    onLoadedData?: (e: any) => void
    onLoadedMetadata?: (e: any) => void
    onLoadStart?: (e: any) => void
    onPause?: (e: any) => void
    onPlay?: (e: any) => void
    onPlaying?: (e: any) => void
    onProgress?: (e: any) => void
    onRateChange?: (e: any) => void
    onSeeked?: (e: any) => void
    onSeeking?: (e: any) => void
    onStalled?: (e: any) => void
    onSuspend?: (e: any) => void
    onTimeUpdate?: (e: any) => void
    onVolumeChange?: (e: any) => void
    onWaiting?: (e: any) => void
    key?: string | number | null

    React/Preact reconciliation key when rendered inside a list.

    id?: string

    HTML id attribute.

    class?: string

    HTML class attribute (standard DOM).

    className?: string

    React/Preact-style class name. Alias for class.

    style?: CSSProperties

    Inline styles applied to the element.

    children?: ReactNode
    slot?: string

    Assigns the element to a named <slot> (e.g. slot="title").

    tabIndex?: number

    Tab order. Set to 0 to make the element keyboard-focusable.

    role?: string

    ARIA role override.

    tone?:
        | "brand"
        | "neutral"
        | "info"
        | "success"
        | "warning"
        | "critical"
        | string & {}

    Track and thumb color. Its scope is controlled by tone-scope.

    "tone-scope"?: ToneScope

    Apply tone to every state (all, the default) or only while checked.

    size?: "small" | "medium" | "large"

    Size variant. small = 26×16px, medium (default) = 30×18px, large = 34×20px.

    round?: boolean | number | string

    Fully round the thumb and track, or pass a custom track radius via a length value (round="6px"). The thumb radius is 3px smaller. Presence-based for the boolean form.

    "label-position"?: "start" | "end"

    Visual placement of the label. The source / accessibility order stays stable.

    state?: "checked" | "unchecked"

    Controlled checked state. Use default-state for an uncontrolled switch.

    "default-state"?: "checked" | "unchecked"

    Uncontrolled initial checked state, read once at connect / form reset.

    disabled?: boolean | ""

    Disables interaction. Presence-based ('' on, omit off).

    name?: string

    Form field name.

    value?: string

    Value submitted when the switch is checked. Defaults to "on".

    onstatechange?: (
        e: CustomEvent<
            { next: "checked"
            | "unchecked"; prev: "checked" | "unchecked" },
        >,
    ) => void

    Cancelable pre-change request. detail contains { next, prev }.

    onchange?: (e: Event) => void

    Native post-change event.

    "aria-checked"?: "true" | "false"
    "aria-disabled"?: "true" | "false"
    "aria-label"?: string