Pressable
Pressable handles press interactions across mouse, touch, keyboard, and screen readers.
Pressable handles press interactions across mouse, touch, keyboard, and screen readers.
API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.
boolean
Whether text selection should be enabled on the pressable element.
boolean
Whether press events should be canceled when the pointer leaves the target while pressed. By default, this is `false`, which means if the pointer returns back over the target while still pressed, onPressStart will be fired again. If set to `true`, the press is canceled when the pointer leaves the target and onPressStart will not be fired if the pointer returns.
'ltr' | 'rtl'
The document's text/writing direction.
boolean
Whether the element is disabled
() => ShadowRoot | Node | Document
A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
string
The unique identifier of the machine.
number
The amount of time (in milliseconds) to wait before firing the `onLongPress` event.
(event: PressEvent) => void
Handler that is called when the element has been pressed for 500 milliseconds
(event: PressEvent) => void
Handler that is called when the press is released over the target.
(event: PressEvent) => void
Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.
(event: PressEvent) => void
Handler that is called when a press interaction starts.
(event: PressEvent) => void
Handler that is called when a press is released over the target, regardless of whether it started on the target or not.
boolean
Whether the target should not receive focus on press.
boolean
Whether text selection should be enabled on the pressable element.
boolean
Whether press events should be canceled when the pointer leaves the target while pressed. By default, this is `false`, which means if the pointer returns back over the target while still pressed, onPressStart will be fired again. If set to `true`, the press is canceled when the pointer leaves the target and onPressStart will not be fired if the pointer returns.
'ltr' | 'rtl'
The document's text/writing direction.
boolean
Whether the element is disabled
() => ShadowRoot | Node | Document
A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
string
The unique identifier of the machine.
number
The amount of time (in milliseconds) to wait before firing the `onLongPress` event.
(event: PressEvent) => void
Handler that is called when the element has been pressed for 500 milliseconds
(event: PressEvent) => void
Handler that is called when the press is released over the target.
(event: PressEvent) => void
Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.
(event: PressEvent) => void
Handler that is called when a press interaction starts.
(event: PressEvent) => void
Handler that is called when a press is released over the target, regardless of whether it started on the target or not.
boolean
Whether the target should not receive focus on press.
boolean
Whether the element is pressed.
Dict<any>