sections/api/primary/styled.mdx
import Code from 'components/Code' import Table, { Row, Column } from 'components/Table'
styledThis is the default export.
This is a low-level factory we use to create the styled.tagname helper methods.
Returns a function that accepts a tagged template literal and turns it into a StyledComponent.
// import styled from 'styled-components'
const Button = styled.button`
background: #BF4F74;
border-radius: 3px;
border: none;
color: white;
`
const TomatoButton = styled(Button)`
background: tomato;
`
render(
<>
<Button>I'm purple.</Button>
<TomatoButton>I'm red.</TomatoButton>
</>
)
You can see this method being introduced in the Getting started section.