As an open-source project, styled-components/css-to-react-native has picked up 1.2k stars on GitHub (TypeScript). Convert CSS text to a React Native stylesheet object
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Shorthands will only accept values that are supported in React Native, so background will only accept a colour, backgroundColor will not accept an image, and font will not accept font-variant values that React Native does not support.
React Native's box-shadow and filter properties are passed through as
boxShadow and filter, so support depends on your React Native version.
Shorthand Notes
border{Top,Right,Bottom,Left} shorthands are not supported, because borderStyle cannot be applied to individual border sides.
Supported Properties
Most React Native style properties work without a custom mapping table. Write the
React Native property name in kebab-case and this library will convert it back to
the camel-cased React Native key for you.
CSS input
React Native output
align-content
alignContent
background-color
backgroundColor
border-top-left-radius
borderTopLeftRadius
font-size
fontSize
justify-content
justifyContent
text-decoration-color
textDecorationColor
text-shadow-radius
textShadowRadius
That rule covers the standard one-to-one mappings. The library also supports the
following shorthand and special-case transforms:
If you are unsure whether a property is available in React Native itself, check
the React Native style docs and convert the property name to kebab-case when you
write it in CSS.
API
The API is mostly for implementors. However, the main API may be useful for non-implementors. The main API is an array of [property, value] tuples.
We don't provide a way to get these style tuples in this library, so you'll need to do that yourself. I expect most people will use postCSS or another CSS parser. You should try avoid getting these with string.split, as that has a lot of edge cases (colons and semi-colons appearing in comments etc.)
For implementors, there is also a few extra APIs available.
These are for specific use-cases, and most people should just be using the API above.
Should you wish to opt-out of transforming certain shorthands, an array of property names in camelCase can be passed as a second argument to transform.
transform([['border-radius', '50px']], ['borderRadius']);
// { borderRadius: 50 } rather than { borderTopLeft: ... }
This can also be done by passing a third argument, false to getStylesForProperty.
transformRawValue is a lower-level helper that parses a single raw value without applying shorthand expansion.
Does styled-components/css-to-react-native have a project website?
No homepage URL was recorded for styled-components/css-to-react-native in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How many stars does styled-components/css-to-react-native have?
styled-components/css-to-react-native has 1.2k GitHub stars — refresh the page for the live number, or check github.com/styled-components/css-to-react-native. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is styled-components/css-to-react-native open source?
Yes — styled-components/css-to-react-native ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/styled-components/css-to-react-native.
What is styled-components/css-to-react-native?
styled-components/css-to-react-native (styled-components/css-to-react-native) is a TypeScript project on GitHub. From the project's own README: Convert CSS text to a React Native stylesheet object
Where do I read more about styled-components/css-to-react-native?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/styled-components/css-to-react-native is the definitive source.
Read full README in the tab above.
Curious whether css-to-react-native is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about css-to-react-native.