CLI
Add CraftReactNative components to your project with the command-line interface.
Pre-requisite
You must run these commands from the root of your React Native project.
The CLI will copy the component files directly into your project, allowing you to customize them as needed.
Available commands
Command | Description |
---|---|
init | Initialize project with themes and dependencies |
add [components...] | Add one or more components to your project |
list | Show all available components |
init
Initialize your project with the required setup for CraftReactNative UI:
This will:
- Install necessary dependencies (
react-native-reanimated
,react-native-gesture-handler
,react-native-svg
,react-native-unistyles
) - Create a
craftrn-ui
folder at your project root with Unistyles and theme configuration - Update your main project file to import the configuration
Options:
--skip-deps
- Skip dependency installation
add
Add components to your project
This will:
- Copy component files to
craftrn-ui/components
so you can import and customize them
list
Show all available components: