Button
Displays a button or a component that looks like a button.
Installation
Terminal
Usage
Importing
Using
Examples
Default
Secondary
Destructive
Outline
Ghost
Icon
Icon Only
API
Button
The Button component allows you to create interactive, styled buttons with various variants and sizes.
Variants
Sizes
Accessibility
Ensure that your buttons are accessible by providing proper labels, roles, and other attributes.
Best Practices for Accessibility
- Provide meaningful labels: Always use
accessibilityLabel
to describe what the button does, especially for buttons with only icons. - Consistent roles: The
accessibilityRole
is automatically set to'button'
but can be overridden if needed. - Handle disabled states: Ensure that disabled buttons are visually distinct and announce their state via assistive technologies.
Example
Example