react-native-unistyles isn’t a UI/component library, so you’re in charge of designing variants. With no restrictions and using your creativity, you can easily create variants for your components.
Let’s examine variants for the Text component. Imagine you want to create several variants for your Typography components:
Heading
Regular
Thin
To achieve this, add variants to your theme:
Next, create a base component:
Remember, that if you want to spread styles like so you need to export your theme “as const” for TypeScript.
This is how React Native types works, and you can see the same behavior with StyleSheet.create.