# Styled Components — CSS-in-JS for React and React Native > A CSS-in-JS library that lets you write actual CSS inside your JavaScript components using tagged template literals, producing scoped styles with zero class-name collisions. ## Install Save as a script file and run: # Styled Components — CSS-in-JS for React and React Native ## Quick Use ```bash npm install styled-components # In your React component: # import styled from 'styled-components'; # const Button = styled.button` # background: palevioletred; # color: white; # padding: 0.5em 1em; # `; ``` ## Introduction Styled Components lets you attach CSS directly to React components using tagged template literals. Each component gets unique, auto-generated class names, eliminating style collisions and making it easy to co-locate styles with logic. It supports server-side rendering, theming, and React Native out of the box. ## What Styled Components Does - Creates React components with scoped CSS via tagged template literals - Generates unique class names at runtime to prevent style collisions - Supports dynamic styling through props interpolation inside template strings - Provides a `ThemeProvider` for consistent design tokens across an app - Handles vendor prefixing and server-side rendering automatically ## Architecture Overview Styled Components uses a tagged template literal parser (stylis) to process CSS at runtime. When a styled component mounts, the library hashes the CSS, generates a unique class name, and injects a `