You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ⚠️ **BETA SOFTWARE**: This library is in active development and not yet recommended for production use. APIs may change without notice. Feel free to try it out and provide feedback!
11
10
12
11
Provides a way to styling components in React Native with better experience and composability. The key feature is the ability to create multi-variants styles with a type-safe definition inspired by [Stitches](https://stitches.dev/docs/variants) and [CVA](https://cva.style/docs/getting-started/variants) (for React apps).
@@ -26,6 +25,7 @@ Provides a way to styling components in React Native with better experience and
26
25
-[ ] Default design tokens.
27
26
28
27
### Create your config file
28
+
29
29
To configure `Jacaranda`, create a `jacaranda.config.ts` file (`.js` works too) to define your reusable design tokens and import the `defineTokens` function.
30
30
31
31
```tsx
@@ -34,6 +34,7 @@ import { defineTokens } from 'jacaranda';
34
34
```
35
35
36
36
This function receives an object with the design tokens.
37
+
37
38
-`colors`: Define your colors design tokens.
38
39
-`space`: Define your spacing.
39
40
-`fonts`: Define your fonts.
@@ -42,7 +43,7 @@ This function receives an object with the design tokens.
42
43
43
44
And returns a `styles` function that you can use to style your components.
After the tokens are defined, you can use the design tokens in your components. You'll be importing the `styles` function from the `jacaranda.config.ts` file.
@@ -124,6 +126,7 @@ const buttonStyles = styles({
124
126
```
125
127
126
128
### TypeScript
129
+
127
130
#### Extract variants from a component
128
131
129
132
You can use the `VariantProps` type to extract the variants from a component.
0 commit comments