React Native
This template helps you generate your design tokens as a React Native theme and icons as JSX components
This example uses the following parsers:
to-react-native to generate your design tokens as a React Native theme
convert-dimension to convert dimensions token from px to unitless values
svg-to-jsx to generate icons as JSX components
If you use the CLI, you need to fill three properties:
repositoryis@organization/repositorypersonalAccessTokenwhich you can generate in your account settingsrulesare where you provide parsers and compatible options
{
"version": "2",
"repository": "@organization/repository",
// Only use the personalAccessToken when working with the CLI
"personalAccessToken": "<your-personal-access-token>",
"rules": [
{
"name": "Generate tokens as a React Native theme",
"parsers": [
{
"name": "convert-dimension",
"options": {
"toFormat": null
}
},
{
"name": "to-react-native",
"output": {
"type": "file",
"filePath": "theme.js"
}
}
]
},
{
"name": "Optimize and transform vectors with svgo + Generate JSX components",
"parsers": [
{
"name": "svgo",
"options": {
"svgo": {
"plugins": [
{
"name": "removeDimensions"
},
{
"name": "convertColors",
"params": {
"currentColor": true
}
}
]
}
}
},
{
"name": "svg-to-jsx",
"output": {
"type": "directory",
"directoryPath": "output/assets"
}
}
]
}
]
}If you use the GitHub, you need to fill 4 properties:
repositoryis@organization/repositoryheadlets you set the branch your PR will be created onbaselets you set the branch your PR will be merged onruleslets you transform tokens by chaining parsers
Last updated
Was this helpful?