Skip to content

Commit 6324586

Browse files
committed
docs: updated documentation
1 parent 0c9af17 commit 6324586

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

README.md

+37-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
1111
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).
1212

13-
#### Available properties:
13+
## Features
1414

15-
- `base`: The base styles for the element.
16-
- `variants`: The different visual styles for the element.
17-
- `compoundVariants`: Styles that apply when multiple other variant conditions are met.
18-
- `defaultVariants`: Set a variant by default when no variant is provided.
15+
- 🎨 Token-based styling system
16+
- 🧩 Variant API for conditional styling
17+
- 🔄 Compound variants for complex style combinations
18+
- 🧠 Type-safe with full TypeScript support
19+
- 🏎️ Lightweight and performant
20+
- 🧪 Fully tested
1921

2022
#### Roadmap
2123

@@ -81,6 +83,13 @@ export const { sva, tokens } = defineTokens({
8183

8284
After the tokens are defined, you can use the design tokens in your components. You'll be importing the `sva` function from the `jacaranda.config.ts` file.
8385

86+
#### Available properties:
87+
88+
- `base`: The base styles for the element.
89+
- `variants`: The different visual styles for the element.
90+
- `compoundVariants`: Styles that apply when multiple other variant conditions are met.
91+
- `defaultVariants`: Set a variant by default when no variant is provided.
92+
8493
```tsx
8594
// Button.tsx
8695
import { TouchableOpacity } from 'react-native';
@@ -125,6 +134,29 @@ const buttonStyles = sva({
125134
});
126135
```
127136

137+
### Styled Components with Design Tokens
138+
139+
Jacaranda provides a `styled` function similar to `styled-components` that allows you to create styled React Native components with access to your design tokens.
140+
141+
#### Key features:
142+
143+
- Create reusable styled components from any React Native component
144+
- Access design tokens using the `$` prefix (e.g. `$colors.primary50`)
145+
- Supports all React Native style properties
146+
147+
```tsx
148+
import { View } from 'react-native';
149+
import { styled } from './jacaranda.config';
150+
151+
const StyledView = styled(View)({
152+
backgroundColor: '$colors.primary50',
153+
});
154+
155+
export const Screen = () => {
156+
return <StyledView></StyledView>;
157+
};
158+
```
159+
128160
### TypeScript
129161

130162
#### Extract variants from a component

0 commit comments

Comments
 (0)