---
title: "styled-components 6.6.0: release notes, upgrades and advisories"
description: "styled-components 6.6.0: release notes, breaking changes by major version and no known security advisory."
url: https://inlinr.com/packages/styled-components
lang: en
---

[Packages](https://inlinr.com/packages)

# styled-components

6.6.0 · 12 Oct 2026 MIT 14.8M / week [Repository](https://github.com/styled-components/styled-components) [Homepage](https://styled-components.com/) [npm](https://www.npmjs.com/package/styled-components) [Atom feed](https://inlinr.com/packages/feed/styled-components)

Your version 

## Where each line stands

[Plan an upgrade](https://inlinr.com/packages/styled-components/upgrade)

LineNewestSecurity

- 6.x 6.6.0 No known advisory Latest line
- 5.x 5.3.11 No known advisory [To 6.6.0](https://inlinr.com/packages/styled-components/upgrade/5.3.11-6.6.0)
- 4.x 4.4.1 No known advisory [To 6.6.0](https://inlinr.com/packages/styled-components/upgrade/4.4.1-6.6.0)
- 3.x 3.4.10 No known advisory [To 6.6.0](https://inlinr.com/packages/styled-components/upgrade/3.4.10-6.6.0)
- 2.x 2.4.1 No known advisory [To 6.6.0](https://inlinr.com/packages/styled-components/upgrade/2.4.1-6.6.0)
- 1.x 1.4.6 No known advisory [To 6.6.0](https://inlinr.com/packages/styled-components/upgrade/1.4.6-6.6.0)

## Latest releases

[All 194 releases](https://inlinr.com/packages/styled-components/releases)

1. ### [6.6.0](https://inlinr.com/packages/styled-components/releases/6.6.0 "Open this release") [](https://github.com/styled-components/styled-components/releases/tag/styled-components%406.6.0 "Read this release where it was published")  
12 Oct 2026

  - Added a `StyledComponent<Target, Props>` type for annotating explicitly-typed styled component exports.  
  Packages that emit their own declaration files, including any project using `isolatedDeclarations`, must annotate every exported styled component, and there was no public type for it: consumers reached into internal paths or hand-assembled one that dropped members like a wrapped component's hoisted statics.  
  `StyledComponent` is exported from the web and native entries. Name the target and props as you passed them to `styled`:  
  ```
  import styled, { type StyledComponent } from 'styled-components';
  export const Card: StyledComponent<'div', { $active?: boolean }> = styled.div<{
    $active?: boolean;
  }>`...`;
  export const CloseButton: StyledComponent<typeof IconButton> = styled(IconButton)`...`;
  ```
  It resolves to the exact type `styled(Target)<Props>` produces, so the annotation is not lossy.
  - Fixed `attrs` no longer applying its value when a prop was explicitly passed as `undefined` (the 6.3.12 to 6.5.x behavior). `styled.button.attrs(({ type = 'button', ...rest }) => ({ type, ...rest }))` rendered without `type="button"` when the caller passed `type={undefined}`, and an object-form default such as `.attrs({ type: 'button' })` was lost the same way, including through a wrapper component that spreads its own props over the styled component. `attrs` now always wins for the keys it returns, matching every other case where a prop is passed alongside `attrs`.  
  Also fixed: a prop passed explicitly as `undefined` (and not overridden by `attrs`) is now forwarded to a wrapped component so that component can fall back to its own default, the pattern MUI's `ButtonBase` relies on (for example `<Root role="button" {...props} />`). Wrapped components have dropped this prop entirely since v6.0, so a component that checks `'role' in props` or merges `{...defaults, ...props}` to detect an explicitly-passed prop may see and behave differently now that the key is present again. This only applies when wrapping another component; a DOM tag such as `styled.div` still drops the `undefined` prop entirely, since browsers have no notion of an "undefined" attribute.  
  If you were relying on an explicit `undefined` to clear an `attrs` default, use the function form and check for the prop's presence instead:  
  ```
  styled.a.attrs(props => ('rel' in props ? {} : { rel: 'noopener' }))``;
  ```
  Passing `rel={undefined}` now renders no `rel` attribute, and omitting the prop renders `rel="noopener"`.  
  React Native already forwarded an explicit `undefined` prop to a wrapped component; it now also matches web in never forwarding an `undefined` that `attrs` itself produced.
  - Rendering styled-components on the server with the edge runtime (for example `export const runtime = 'edge'` in a Next.js route) now fails with a clear message that names the fix: use the Node.js runtime for routes that render styled-components. Previously the same setup ended in an obscure crash, either at `next build` or on the first request.
2. ### [6.5.3](https://inlinr.com/packages/styled-components/releases/6.5.3 "Open this release") [](https://github.com/styled-components/styled-components/releases/tag/styled-components%406.5.3 "Read this release where it was published")  
15 Aug 2026

  - Fix TypeScript errors in projects that augment React HTML props with a `data-*` template-literal index signature.
3. ### [6.5.2](https://inlinr.com/packages/styled-components/releases/6.5.2 "Open this release") [](https://github.com/styled-components/styled-components/releases/tag/styled-components%406.5.2 "Read this release where it was published")  
11 Aug 2026

  - `.attrs()` is cheaper to type-check.  
  Two costs on the `.attrs` path are gone. Object-form `.attrs()` left the rendered target unchanged but still re-resolved that target's whole prop bag on every call, making `.attrs` on an HTML or SVG tag far costlier than on a wrapped component; it now reuses the props already resolved for the tag. Separately, making attrs-provided keys optional ran an avoidably expensive pass over the target's full prop set on every attrs component. Together these cut consumer type-check work measurably across every `.attrs` form, with no change to the resulting component's accepted props. Redirecting the target with `.attrs({ as })`, including the function form, is unaffected.
  - Explicitly annotated styled components type-check faster.  
  Assigning a styled component to an explicit type, as `isolatedDeclarations` and any package that emits `.d.ts` files must (``` const Button: IStyledComponentBase<'web', ...> = styled.button``), used to be several times more expensive to check than an inferred one, because the annotation's ```style`and the component's widened`style\` were two different csstype representations that the checker compared property by property.  
  The inline `style` widening now builds on React's own `CSSProperties`, the same type a hand-written annotation carries, so that comparison short-circuits. On a 40-component fixture this cut the types created for the annotated pattern by about 21%, with no change to what `style` accepts: CSS custom properties, a component's own narrow `style`, and `style={undefined}` all behave exactly as before.
  - `styled()` wrapping a generic polymorphic component keeps its declared props narrow.  
  Wrapping a component whose props are generic over an element type, such as the common `<C extends React.ElementType>(props: PolymorphicProps<C, OwnProps>)` pattern, used to let the styled result accept prop values the component itself rejects: `styled(Button)` would take `variant="anything"` even though `<Button variant="anything">` is a type error. The wrapper now narrows those props exactly as the direct component does, so a bad value is caught in both places. Valid props, children, and plain (non-generic) targets are unaffected.

Dependency tracking

## Know when your own dependencies move

styled-components published 24 releases in the last 12 months. inlinr folds the routine ones into a line and keeps the few that need you.

- Advisories reach you  
An email when a critical or high advisory affects a project, before the next install.
- Upgrades checked first  
Peer ranges, Node, ESM-only and types changes read before you bump.
- Only what matters  
Majors and breaking notes stay; patches and sibling bumps fold into one line.

[How dependency tracking works](https://inlinr.com/dependencies)

## Security

No known security advisory.

## Health

[Details](https://inlinr.com/packages/styled-components/security#signals)

- **Provenance**:
- **Publisher**:
- **Maintainers**:
- **Scorecard**:
- **Size**:

## Weekly downloads

## Works with

- [react](https://inlinr.com/packages/react)
- [react-dom optional](https://inlinr.com/packages/react-dom)
- [react-native optional](https://inlinr.com/packages/react-native)
- [css-to-react-native optional](https://inlinr.com/packages/css-to-react-native)

Reading releases, release notes and advisories…

Registry facts last checked 20 Nov 2026\. Releases and advisories last read 20 Nov 2026.

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
