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
Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
npm install styled-components
83.6
Supply Chain
92.8
Quality
87.4
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
40,548 Stars
3,635 Commits
2,500 Forks
354 Watching
20 Branches
368 Contributors
Updated on 28 Nov 2024
Minified
Minified + Gzipped
TypeScript (85.71%)
JavaScript (14.06%)
CSS (0.15%)
HTML (0.09%)
Cumulative downloads
Total Downloads
Last day
-4.1%
1,110,069
Compared to previous day
Last week
1.6%
5,734,181
Compared to previous week
Last month
8.2%
24,423,790
Compared to previous month
Last year
-1.9%
288,596,364
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[![style: styled-components](https://img.shields.io/badge/style-%F0%9F%92%85%20styled--components-orange.svg?colorB=daa357&colorA=db748e)](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 is run on all commits
Details
Reason
11 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 9
Reason
Found 7/27 approved changesets -- score normalized to 2
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
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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