LogoCraftReactNative
Components

Button

A button component that supports different sizes and variants. It can be used for primary actions, secondary actions, or negative/destructive actions.

Installation

npx @craftreactnative/ui add Button

Usage

Screen.tsx
import { Button } from '@/craftrn-ui/components/Button';
 
export const Screen = () => (
  <Button onPress={() => {}} size="small" variant="secondary">
    Press me
  </Button>
);

Props

PropTypeDefault
children
string | string[]
-
onPress
() => void
-
disabled?
boolean
false
size?
Size
'regular'
variant?
Variant
'primary'
animationConfig?
AnimationConfig
-

Dependencies

2 packages
react-native-reanimated
react-native-unistyles
Required imports
craftrn-ui/components/PressableScale
craftrn-ui/components/Text

On this page