Gathering detailed insights and metrics for styled-components
Gathering detailed insights and metrics for styled-components
Gathering detailed insights and metrics for styled-components
Gathering detailed insights and metrics for styled-components
babel-plugin-styled-components
Improve the debugging experience and add server-side rendering support to styled-components
@types/styled-components
TypeScript definitions for styled-components
@xstyled/styled-components
A utility-first CSS-in-JS framework built for React (styled-components bindings).
stylelint-config-styled-components
A shareable stylelint config for stylelint-processor-styled-components
Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
npm install styled-components
Typescript
Module System
Min. Node Version
Node Version
NPM Version
86.3
Supply Chain
92.5
Quality
90.6
Maintenance
100
Vulnerability
100
License
styled-components@6.1.19
Updated on Jun 12, 2025
styled-components@6.1.18
Updated on May 08, 2025
styled-components@6.1.17
Updated on Apr 02, 2025
styled-components@6.1.16
Updated on Mar 17, 2025
styled-components@6.1.15
Updated on Feb 05, 2025
styled-components@6.1.14
Updated on Jan 04, 2025
TypeScript (85.73%)
JavaScript (14.03%)
CSS (0.15%)
HTML (0.09%)
Total Downloads
1,244,771,945
Last Day
269,570
Last Week
6,452,624
Last Month
28,003,573
Last Year
292,108,916
MIT License
40,842 Stars
3,654 Commits
2,508 Forks
345 Watchers
20 Branches
375 Contributors
Updated on Jul 05, 2025
Minified
Minified + Gzipped
Latest Version
6.1.19
Package Id
styled-components@6.1.19
Unpacked Size
1.69 MB
Size
437.07 kB
File Count
211
NPM Version
10.8.2
Node Version
20.19.2
Published on
Jun 12, 2025
Cumulative downloads
Total Downloads
Last Day
-7.3%
269,570
Compared to previous day
Last Week
-9.7%
6,452,624
Compared to previous week
Last Month
3.9%
28,003,573
Compared to previous month
Last Year
-3.5%
292,108,916
Compared to previous year
9
47
Upgrading from v5? See the migration guide.
Utilizing tagged template literals (a recent addition to JavaScript) and the power of CSS, styled-components
allow you to write actual CSS code to style your components. It also removes the mapping between components and styles – using components as a low-level styling construct could not be easier!
1const Button = styled.button` 2 color: grey; 3`;
Alternatively, you may use style objects. This allows for easy porting of CSS from inline styles, while still supporting the more advanced styled-components capabilities like component selectors and media queries.
1const Button = styled.button({ 2 color: 'grey', 3});
Equivalent to:
1const Button = styled.button` 2 color: grey; 3`;
styled-components
is compatible with both React (for web) and React Native – meaning it's the perfect choice even for truly universal apps! See the documentation about React Native for more information.
Supported by Front End Center. Thank you for making this possible!
See the documentation at styled-components.com/docs for more information about using styled-components
!
Quicklinks to some of the most-visited pages:
1import React from 'react'; 2 3import styled from 'styled-components'; 4 5// Create a <Title> react component that renders an <h1> which is 6// centered, palevioletred and sized at 1.5em 7const Title = styled.h1` 8 font-size: 1.5em; 9 text-align: center; 10 color: palevioletred; 11`; 12 13// Create a <Wrapper> react component that renders a <section> with 14// some padding and a papayawhip background 15const Wrapper = styled.section` 16 padding: 4em; 17 background: papayawhip; 18`; 19 20function MyUI() { 21 return ( 22 // Use them like any other React component – except they're styled! 23 <Wrapper> 24 <Title>Hello World, this is my first styled component!</Title> 25 </Wrapper> 26 ); 27}
This is what you'll see in your browser:
The main
branch is for the most-current version of styled-components, currently v6. For changes targeting v5, please point your PRs at the legacy-v5
branch.
styled-components
A lot of hard work goes into community libraries, projects, and guides. A lot of them make it easier to get started or help you with your next project! There are also a whole lot of interesting apps and sites that people have built using styled-components.
Make sure to head over to awesome-styled-components to see them all! And please contribute and add your own work to the list so others can find it.
If you want to contribute to styled-components
please see our contributing and community guidelines, they'll help you get set up locally and explain the whole process.
Please also note that all repositories under the styled-components
organization follow our Code of Conduct, make sure to review and follow it.
Let everyone know you're using styled-components →
1[](https://github.com/styled-components/styled-components)
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
Licensed under the MIT License, Copyright © 2016-present Glen Maddern and Maximilian Stoiber.
See LICENSE for more information.
This project builds on a long line of earlier work by clever folks all around the world. We'd like to thank Charlie Somerville, Nik Graf, Sunil Pai, Michael Chan, Andrey Popp, Jed Watson & Andrey Sitnik who contributed ideas, code or inspiration.
Special thanks to @okonet for the fantastic logo.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8
Reason
Found 12/29 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
28 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More