Pressable
Pressable component is an new and improved version of Touchable
The Pressable is a wrapper component used to make other components responsive to the user's touch. Useful for creating custom buttons or custom touchable containers. You can use it to Trigger Actions.
Style Properties
Style properties allow you to customize the look and feel of the component. Combinations of styles applied to components can be saved as Stylesheets to easily reuse styles throughout your app. Styles can also be set dynamically using Variables. To learn more about all the different styling properties and how they work, take a look at Intro to Styling.
Component Specific Styles
Property | Description |
---|---|
Disabled Opacity | The opacity when the component is disabled. |
Borderless Ripple | Android only. Defines if ripple effect should not include border. |
Ripple Color | Android only. Defines the color of the ripple effect. |
Foreground Ripple | Android only. Set to true to add the ripple effect to the foreground of the view, instead of the background. This is useful if one of your child views has a background of its own, or you're e.g. displaying images, and you don't want the ripple to be covered by them. |
Ripple Radius | Android only. Defines the radius of the ripple effect. |
Configuration Properties
Property | Description |
---|---|
Component Name | To alter the name of the component. The name is reflected in the Components tree. Defaults to Pressable. |
Delay Long Press | Duration (in milliseconds) from onPressIng before onLongPress is called. |
Hit Slop | Sets additional distance outside of the element in which a press can be detected. |
Active Opacity | The opacity when the button is pressed. |
Disabled Opacity | The opacity when the button is disabled. |
Data Properties
Property | Description |
---|---|
Disabled | Disables the component when turned on |
Conditional Display
You can conditionally display a component based on a given condition. Learn more about conditionally displaying components in the Conditional Display doc.
Triggers
Trigger | Description |
---|---|
On Press | Starts the action when the element is pressed. |
On Long Press | Starts the action when the element is long pressed. |
Creating a Custom Button From using Pressable
Here you will find instructions to can create your own button using a Pressable component provided by Draftbit. A Touchable or Pressable component provides the same capability as a Button to capture tapping gestures. However, it does not provide any default styling.
Updated 2 months ago