JavaScript/TypeScript
The following React Native format is provided when compiling design
tokens to JavaScript using native-js
, or TypeScript using native-ts
. It utilizes exported
constant variables for reusability. This format is based on the web-js/ts format, with
the following differences:
- Unit based values are literal numbers instead of being suffixed with
px
(or another unit). This matches how React Native handles unit based props. For example:
- Since React Native supports both iOS and Android, we inject some platform conditionals within the generated system to support both platforms. For example:
Please refer to the web based format for more information on how to use this format.