Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via pnpm

styled-components 6.1.8

CSS for the <Component> Age. Style components your way with speed, strong typing, and flexibility.
Package summary
Share
0
issues
4
licenses
18
MIT
2
ISC
1
BSD-3-Clause
1
0BSD
Package created
16 Aug 2016
Version published
8 Jan 2024
Maintainers
4
Total deps
22
Direct deps
11
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
18 Packages, Including:
@emotion/is-prop-valid@1.2.1
@emotion/memoize@0.8.1
@emotion/unitless@0.8.0
@types/stylis@4.2.0
camelize@1.0.1
css-to-react-native@3.2.0
csstype@3.1.2
js-tokens@4.0.0
loose-envify@1.4.0
nanoid@3.3.7
postcss-value-parser@4.2.0
postcss@8.4.31
react-dom@18.3.1
react@18.3.1
scheduler@0.23.2
shallowequal@1.1.0
styled-components@6.1.8
stylis@4.3.1

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
css-color-keywords@1.0.0
picocolors@1.0.1

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
source-map-js@1.2.0

BSD Zero Clause License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
include-copyright
include-license
include-original
Cannot
hold-liable
Must
1 Packages, Including:
tslib@2.5.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

11
All Dependencies CSV
β“˜ This is a list of styled-components 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@emotion/is-prop-valid1.2.17.49 kBMIT
prod
@emotion/unitless0.8.01.89 kBMIT
prod
@types/stylis4.2.02.56 kBMIT
prod
css-to-react-native3.2.018.86 kBMIT
prod
csstype3.1.2175.07 kBMIT
prod
postcss8.4.3144.81 kBMIT
prod
react-dom18.3.14.3 MBMIT
prod peer
react18.3.1310.65 kBMIT
prod peer
shallowequal1.1.02.99 kBMIT
prod
stylis4.3.139.23 kBMIT
prod
tslib2.5.012.36 kB0BSD
prod

Visualizations

Frequently Asked Questions

What does styled-components do?

Styled-components is a library for styling React applications. It combines the best of ES6 and CSS to create visual primitives that help developers structure their apps without stress. It utilizes tagged template literals (a recent addition to JavaScript) and the power of CSS, allowing the writing of actual CSS code to style your components. Styled-components removes the mapping between components and styles, promoting the use of components as a low-level styling construct. The library is compatible with both React (for the web) and React Native, making it a perfect choice for universal apps.

How do you use styled-components?

Using styled-components is straightforward. First, you need to install the package using npm: npm install styled-components@^5.0.0 react@^16.8 react-dom@^16.8 react-is@^16.8. Then, you can create styled components using tagged template literals or style objects. Here is a basic example using tagged template literals:

import styled from 'styled-components';

const Button = styled.button`
  color: grey;
`;

And here's how you would do it using style objects:

const Button = styled.button({
  color: 'grey',
});

In your React component, you can then use the newly styled Button like any other React component.

Where are the styled-components docs?

For comprehensive information on using styled-components, refer to the official documentation at styled-components.com/docs. Here you can find everything from getting started guides, API references, to more advanced topics like theming and server-side rendering. The documentation also includes an explanation of tagged template literals. For users wanting to upgrade from v4, instructions are provided in the documentation.