NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #2881 most downloaded on npm
Fast, expressive styling for React.
Latest stable
6.6.0
Last release 12 days ago
10 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
483 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Apply a workaround to re-enable "speedy" mode for IE/Edge (see #1468)
A quick bugfix release:
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Hotfix: disable speedy mode for microsoft browsers to mitigate an issue with our usage of the insertRule() API. We are investigating to get it enabled
Hotfix: disable speedy mode for microsoft browsers to mitigate an issue with our usage of the insertRule() API. We are investigating to get it enabled again in the near future.
Nothing published for this version
Nothing published for this version
Hotfix ReactNative support, which was broken in v3.1.0.
Hotfix ReactNative support, which was broken in v3.1.0.
React 16 introduced ReactDOMServer.renderToNodeStream, thanks to @probablyup styled-components now has full streaming server-side rendering support so
React 16 introduced ReactDOMServer.renderToNodeStream, thanks to @probablyup styled-components now has full streaming server-side rendering support so you can take advantage of the faster Time-To-First-Byte! :tada:
See the documentation on the website for more information.
Thanks to @schwers we now use insertRule in production, which makes for much faster CSS injection. In benchmarks this change makes styled-components mount ~10x faster and re-render ~20x faster! :tada:
Note: Your app will probably not mount 10x faster, but we've seen Time-To-First-Interactive drop by a couple hundred milliseconds in production apps with this change!
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Finally! The typings for TypeScript have been updated as well to reflect this breaking change. (see #1339)
This major release prepares some great features that are yet to come, so be ready for some new and exciting features soon! But for now please read on for what’s in the current (majorly awesome) release. :fire:
Thanks to @Andarist we're now shipping flat bundles for each of our entries only. This means that the entire lib/ folder won’t be inside our npm package.
While this might break a couple of third party libraries, it stands to reason that our internals should not have been exposed in this way before.
This new way of bundling not only makes it easier for us to perform some refactors quite soon, it also makes it easier for us to optimise our releases even more. Please check your codebases and libraries for usages of our internals and make sure not to rely on them. Open an issue please if you need help to migrate to v3.
There are bundles for Web, React Native, and React Primitives. The former two come with both ES Modules and CommonJS bundles. The Web bundle also comes with a minified bundle. We’re also now shipping source maps for each of these bundles.
styled.SafeAreaView and removed styled.Navigator for React NativeWe’ve added the missing SafeAreaView shortcut to the native bundle, and removed the deprecated Navigator. Finally! The typings for TypeScript have been updated as well to reflect this breaking change. (see #1339)
isStyledComponent utilityBecause we’re now shipping flat bundles we also wanted to provide a frequently requested utility function that determines whether a given component is a StyledComponent. This utility returns a boolean telling you just that. (see #1418)
It should make it easier to determine whether to pass on innerRef or ref for instance in some cases, and should allow you to avoid accessing some of our internals or to check whether a component has styledComponentId set.
More information on this utility can be found on our website’s API reference section.
From time to time, it’s easy to forget to import styled-components/native instead on React Native. So now it’s possible to import just styled-components on React Native as well and Metro Bundler will automatically switch to the native bundle. This release also deprecates the old styled-components/native import, so make sure to migrate.
We also now log a warning when the web-version of styled-components is accidentally imported in React Native, so you can be sure that the right bundle is always being used. (see #1391 and #1394)
styled-components/native is deprecated. Please switch to just styled-components.innerRef could be undefined when using withTheme, which can lead to unexpected behaviour when spreading props or passing it on. (see #1414)Thanks to the numerous contributors and maintainers who have worked towards this release. We're sorry if some names are missing, so thanks additionally goes out to everyone who’s worked hard to get v3 out!
(In no particular order)
Nothing published for this version
db30d2c [v2] Make TypeScript definition compatible with TS 2.9.1 - ported from #1773
db30d2c [v2] Make TypeScript definition compatible with TS 2.9.1 - ported from #1773
babel-plugin-styled-components@1.4.0
babel-plugin-styled-components@1.4.0styled-components@2.4.0These tandem releases introduce a stabler algorithm for determining the unique hash of each component, which should lead to more consistent class names across environments. (both across dev/test/prod and across client/server when using SSR)
Big thanks to @probablyup, ref styled-components/styled-components#1381 and styled-components/babel-plugin-styled-components#112
Nothing published for this version
Fix the attr filtering optimization removed in v2.3.2 which leads to bundle size improvement, thanks to @probablyup (see #1377)
Nothing published for this version
Hotfix release, fixes an issue with v2.3.1 where attributes wouldn't be filtered correctly.
Hotfix release, fixes an issue with v2.3.1 where attributes wouldn't be filtered correctly.
There's now an official styled-components badge, thanks to @iRoachie (see #1363)! Throw that on all the projects you have that use styled-components:
There's now an official styled-components badge, thanks to @iRoachie (see #1363)! Throw that on all the projects you have that use styled-components:
[](https://github.com/styled-components/styled-components)
@probablyup spent some time removing our warning messages in production mode, reducing the library size by about half a kB min+gzip! (see #1365)
It turns out our unminified UMD build contained some process.env declarations, which broke when used via a <script> tag in your HTML. This is now fixed, thanks to @maciej-ka! (see #1355)
Our entire repo is now using Prettier, making it easy to stay consistent with our code style, thanks to @existentialism! (see #593)
We spent some time updating our contribution and community guidelines to encourage shallow contributions to ensure the longevity of this project and to remove the core team as bottlenecks from development. The TL;DR is this:
If your Pull Request is merged, regardless of content, you're eligible for push access to the organization on GitHub. This is checked for on pull request merges and an invite is sent automatically.
See our contributing.md for more information on Why and How we do this, and expect a blogpost about it in the near future too. Thanks to @orta, @alloy and @ashfurrow for encouraging and helping us to explore this way of managing open source.
Thanks to @gribnoysup we now have a sandbox for quickly testing changes in the library in a real app! (see #1257) To start contributing locally, run t
Thanks to @gribnoysup we now have a sandbox for quickly testing changes in the library in a real app! (see #1257) To start contributing locally, run these commands locally and you're all set up:
# Clone the repo locally
git clone git@github.com:styled-components/styled-components.git
# Install the dependencies in the root folder
yarn install # or npm install
# Build the library
yarn run build # or npm run build
# Install the Sandbox app dependencies
cd sandbox
yarn install # or npm install
# Start the sandbox app!
yarn run start # or npm run start
innerRef when wrapping function componentsFunction components cannot have refs so our innerRef prop would break when used with withTheme:
Thanks to @MatthieuLemoine, rather than attaching a ref to stateless function components (which results in a warning) we now pass the innerRef prop to it directly for it to handle. (see #1205)
componentId, thanks to @evan-scott-zocdoc (see #1313)In this release we're fixing a little problem that'd occur when using styled-components using static styling in development together with react-hot-lo
In this release we're fixing a little problem that'd occur when using styled-components using static styling in development together with react-hot-loader.
As hot loading updates the styles, the styled components wouldn't update as they initially judged their styles as being static. This behaviour is now being disabled in development.
We found a significant bug in styled-components for React Native, where components wouldn't update their styles even if they are being passed new prop
We found a significant bug in styled-components for React Native, where components wouldn't update their styles even if they are being passed new props. 😿
If you're using React Native with styled-components v2.2.2, you probably already noticed this bug. Please update to v2.2.3.
Another quick release with lots of bug fixes! :tada:
Another quick release with lots of bug fixes! :tada:
withTheme HOC from breaking when passing a theme from defaultProps, thanks to @kutyel (see #1130)attrs are dynamic, thanks to @schwers (see #1219)A new day, a new release. Some more performance improvements for browser-usage, some bug fixes and an all-new `awesome-styled-components` repo with al
A new day, a new release. Some more performance improvements for browser-usage, some bug fixes and an all-new awesome-styled-components repo with all of the ecosystem goodness!
awesome-styled-components, thanks to @romellogoodAnother awesome release, mainly some performance improvements! :tada:
Another awesome release, mainly some performance improvements! :tada:
styled.marquee, thanks to @reznordNothing published for this version
This is a big patch release with a bunch of fixes! We're preparing for some big performance improvements in our next minor release, and are working to
This is a big patch release with a bunch of fixes! We're preparing for some big performance improvements in our next minor release, and are working towards stabilising more code to be able to refactor it for v3!
All our documentation is available on our website, as always: https://www.styled-components.com
Albeit not the final work on this, we added some initial support webpack nonces. https://github.com/styled-components/styled-components/pull/1022
We added the missing alias for the new ImageBackground component in React Native. Go try it out! https://github.com/styled-components/styled-components/pull/1028
We switched more of our tests over to snapshot testing! We hope that this will greatly improve our development speed when implementing new features that only slightly affect our CSS fixtures in our tests.
Be tuned for more!
We previously had no plans for fixing the deterministic ID generation for our new v2 APIs until the new v3 code changes. But since the babel-plugin and SSR have become more important for a huge amount of our users, we now have a fix ready that should support these two methods.
.extend and .withComponent now create new component IDs during the runtime, which are still deterministic. While they're not created during compile time, this is a step towards our good SSR support, which is very important to us.
.extend not working after chaining it repeatedly (3 or more inheritances)Thanks to the numerous contributors and maintainers who have contributed to this release.
(In no particular order)
The deterministic ID change is arguably the biggest reason for this patch, and the issue behind it was specifically created as a "Good first task" for contributors with either or both little experience in OSS development, or the styled-components project. Watch out for this tag in the future, if you'd like to contribute to styled-components and make a difference! :tada:
This contains an important patch that restores compatibility with styled-jsx and thus next.js.
This contains an important patch that restores compatibility with styled-jsx and thus next.js.
Before stylis would share middleware and options for everyone who's using it. In v3.2 it was fixed so that an instance of stylis can be created that is isolated from the global singleton and other instances. This previously wasn't possible and broke compatbility with styled-jsx, since it's also using stylis.
Thanks to the numerous contributors and maintainers who have contributed to this release, including:
Nothing published for this version
Nothing published for this version
A patch-sized release with a minor version bump because of adding the new (experimental) styled-components/primitives entry point.
A patch-sized release with a minor version bump because of adding the new (experimental) styled-components/primitives entry point.
As presented in this excellent talk from React Europe react-primitives is a project that attempts to generalise the React Native API to be platform-agnostic. Adding a styled-components/primitives entry point allows us to start experimenting with what styled-components can add in that equation, in particular, react-sketchapp.
Thanks to the numerous contributors and maintainers who have contributed to this release, including:
(In no particular order)
This is the first patch release after v2 and shouldn't hold any surprises. But it does fix and improve some rough edges...
This is the first patch release after v2 and shouldn't hold any surprises. But it does fix and improve some rough edges...
Don't forget! All our documentation is now hosted on a nice website: https://www.styled-components.com
It's not secret that v2 was released without updated typings, so we're sure that unfortunately some of you had to wait a little longer.
This release updates the typings with all new APIs and features:
We hope that everything is now working as expected with TypeScript.
Apart from fixing a couple of missing prefixes here and there, Stylis now tries to add missing semicolons. We've gotten some reports and issues in the past of some components breaking an app, when a semicolon was missing, so this should be a nice addition!
The CSS output should also be slightly more minified.
.extend not working after chaining it repeatedly (3 or more inheritances)Thanks to the numerous contributors and maintainers who have contributed to this release.
(In no particular order)
A smaller, faster drop-in upgrade with even more features
A smaller, faster drop-in upgrade with even more features
Read the full changelog in prose over here on Medium: https://medium.com/styled-components/announcing-v2-f01ef3766ac2
It's been a long time (ehem, forever) that we've written release notes, so let's start with a detailed one for v2.
All our documentation is now hosted on a nice website, so if you're having trouble with v2, or learning styled-components in general, check our website: https://www.styled-components.com
Instead of PostCSS we're now using Stylis for our CSS processing needs. By doing so we managed to cut our bundle size (min+gzip) from ~24kB down to ~12kB, meaning you’ll now ship a lot less code to your users!
We added an API for concurrent server side rendering including rehydration on the client. The API is lean and simple:
import { renderToString } from 'react-dom/server'
import { ServerStyleSheet } from 'styled-components'
const sheet = new ServerStyleSheet()
const html = renderToString(sheet.collectStyles(<YourApp />))
const css = sheet.getStyleTags()
Learn more in our docs: https://www.styled-components.com/docs/advanced#server-side-rendering
css-to-react-native (React Native)You'll now need to add units to your React Native shorthand styles, but on the up-side: We now support percentage-units!
A codemod is available: https://github.com/styled-components/styled-components-native-code-mod
.attrsYou can now attach some props directly to a Styled Component. When you use functions as attributes, we'll pass in the component's props, so you can write some more complex logic, without resorting to wrapping an entire component.
const ExternalLink = styled.a.attrs({
target: '_blank',
rel: 'nofollow',
style: props => ({
background: `${props.hue},
${50 + props.luminosity / 2},
${props.luminosity}`
})
}) // ...
.extend and .withComponent helpersThe .extend method allows you to create a new Styled Component based on another one, combining the rules into a single new class.
const Heading = styled.h1`
font-size: 2.5rem;
font-weight: bold;
margin: 2rem;
text-align: center;
`
const MarketingHeading = Heading.extend`
background: midnightblue;
color: white;
&:hover { text-shadow: 0 0 4px white; }
`
The .withComponent method can be used to create a new Styled Component based on another one, but with a different tag or wrapped component.
Chain both methods for unlimited POWER!...
You can now use Styled Components as interpolations and we'll swap them out for their classnames:
const Link = styled.a`
color: inherit;
text-decoration: none;
&:hover, &:active {
text-decoration: underline;
}
`
const P = styled.p`
${ Link } {
text-decoration: underline;
}
`
innerRef prop to wrapped child; under the hood it is converted into a normal React refinnerRef support to withTheme HOCsetNativeProps in StyledNativeComponentref being passed to Stateless Functional Components in StyledNativeComponentThanks to the numerous contributors and maintainers who have worked towards this release. This list comes from the changelog, and we're sorry if some names are missing, but we had a lot more people involved whose names weren't recorded. 😢
(In no particular order)
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.