- Implementation
Common Examples
To use theButton, import it from @servicetitan/anvil2-rn and pass a required label. The kit forbids children; all content flows through typed props.Variants
Thevariant prop sets visual intent. Use "primary" for the main action, "secondary" for supporting actions, "ghost" for low-emphasis actions, and "danger" for destructive work.Sizes
Thesize prop sets the target size. "medium" is the default.Icons
Pass a bare icon element for an icon-only button. Pair{ icon, position } with the visible label to place an icon before or after the text. Import icons from @servicetitan/anvil2-icons/react-native.label as accessibilityLabel.Disabled
SetisDisabled to prevent press and apply the disabled treatment.Accessibility
- Every
Buttonrequires alabel, which is always the accessible name. - Icon-only buttons expose that name through
accessibilityLabel. - Disabled buttons set
accessibilityState.disabledand do not fireonPress. - The control uses
accessibilityRole="button".