Interface PressableProps

Props of the usePressable hook.

interface PressableProps {
    isDisabled?: boolean;
    onBlur?: (() => void);
    onFocus?: (() => void);
    onFocusChange?: ((isFocused: boolean) => void);
    onFocusVisible?: (() => void);
    onHoverChange?: ((isHovered: boolean) => void);
    onHoverEnd?: (() => void);
    onHoverStart?: (() => void);
    onPress?: (() => void);
    onPressChange?: ((isPressed: boolean) => void);
    onPressEnd?: (() => void);
    onPressStart?: (() => void);
}

Hierarchy (view full)

Properties

isDisabled?: boolean

If true then hover events are disabled.

false
onBlur?: (() => void)

A handler that is called when the element loses focus.

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.

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.