Interface HeadlessSelectProps<T>

Props of the useSelect hook.

interface HeadlessSelectProps<T> {
    id?: string;
    isAutofocused?: boolean;
    isDisabled?: boolean;
    isInvalid?: boolean;
    onBlur?: (() => void);
    onChange: ((value: T) => void);
    onFocus?: (() => void);
    onFocusChange?: ((isFocused: boolean) => void);
    onFocusVisible?: (() => void);
    onHoverChange?: ((isHovered: boolean) => void);
    onHoverEnd?: (() => void);
    onHoverStart?: (() => void);
    onOpenChange?: ((isOpened: boolean) => void);
    onPress?: (() => void);
    onPressChange?: ((isPressed: boolean) => void);
    onPressEnd?: (() => void);
    onPressStart?: (() => void);
    value: undefined | T;
}

Type Parameters

  • T

    A selected value.

Hierarchy (view full)

Properties

id?: string

An ID that uniquely identifies a text input.

isAutofocused?: boolean

If true then element is auto-focusable inside a focus scope.

false
isDisabled?: boolean

If true then hover events are disabled.

false
isInvalid?: boolean

If true then a control is marked as invalid.

false
onBlur?: (() => void)

A handler that is called when the element loses focus.

onChange: ((value: T) => void)

A handled that is called when selected value is changed.

Type declaration

    • (value): void
    • Parameters

      • value: T

        A new selected value.

      Returns void

onFocus?: (() => void)

A handler that is called when the element receives focus.

onFocusChange?: ((isFocused: boolean) => void)

A handler that is called when the element's focus status changes.

Type declaration

    • (isFocused): void
    • Parameters

      • isFocused: boolean

        true if an element is focused.

      Returns void

onFocusVisible?: (() => void)

A handler that is called when the element receives focus that must be visible to a user.

onHoverChange?: ((isHovered: boolean) => void)

A handler that is called when the hover state changes.

Type declaration

    • (isHovered): void
    • Parameters

      • isHovered: boolean

        true if an element is hovered.

      Returns void

onHoverEnd?: (() => void)

A handler that is called when a hover interaction ends.

onHoverStart?: (() => void)

A handler that is called when a hover interaction starts.

onOpenChange?: ((isOpened: boolean) => void)

A handler that is called when a select popover opened state is changed.

Type declaration

    • (isOpened): void
    • Parameters

      • isOpened: boolean

        true if a select popover must be visible to a user.

      Returns void

onPress?: (() => void)

A handler that is called when the press is released over the target.

onPressChange?: ((isPressed: boolean) => void)

A handler that is called when the press state changes.

Type declaration

    • (isPressed): void
    • Parameters

      • isPressed: boolean

        true if an element is pressed.

      Returns void

onPressEnd?: (() => void)

A handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.

onPressStart?: (() => void)

A handler that is called when a press interaction starts.

value: undefined | T

A selected value.