Packages

styled-components

6.6.0 · 12 Oct 2026MIT14.8M / weekRepositoryHomepagenpmAtom feed

Your version

5.0.0

major13 Jan 2020Where it was published

5.3.11 is the newest release of 5.x.

In short

1 breaking3 new8 changed

  • Breaking

    Update css-to-react-native to v3.0.0 (#2811); the one breaking change noted is that unitless line height is no longer allowed when setting font properties

Release note

It's finally here!!! 🚀See the migrating to v5 FAQ page for easy upgrade instructions!

Read the v5 release announcement!

TL;DR

  • 19% smaller bundle size

  • 18% faster client-side mounting

  • 17% faster updating of dynamic styles

  • 45% faster server-side rendering

  • RTL support

...and much more all, with no breaking changes!

NOTE: At this time we recommend not using @import inside of createGlobalStyle. We're working on better behavior for this functionality but it just doesn't really work at the moment and it's better if you just embed these imports in your HTML index file, etc.

Changes

  • StyleSheetManager enhancements

    • you can now supply stylis plugins like stylis-plugin-rtl; <StyleSheetManager stylisPlugins={}>...</StyleSheetManager>

    • disableVendorPrefixes removes autoprefixing if you don't need legacy browser support; <StyleSheetManager disableVendorPrefixes>...</StyleSheetManager>

    • disableCSSOMInjection forces using the slower injection mode if other integrations in your runtime environment can't parse CSSOM-injected styles; <StyleSheetManager disableCSSOMInjection>...</StyleSheetManager>

  • Removed the "subfunction" attrs syntax that was deprecated in v4

    styled.div.attrs({ role: p => p.onClick ? 'button' : '' })`
      color: red;
    `

    becomes

    styled.div.attrs(p => ({ role: p.onClick ? 'button' : '' }))`
      color: red;
    `
  • Breaking

    Update css-to-react-native to v3.0.0 (#2811); the one breaking change noted is that unitless line height is no longer allowed when setting font properties

  • Disallow /ad/i in generated class names (#2837); this change primarily helps to avoid some overly aggressive ad blockers that will mangle generated classnames containing the substring "ad"

  • If you use styled-components from CDN, in v5 the "react-is" dependency was added (make sure you add this to your project)

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.