styled-components

  • Version 6.1.8
  • Published
  • 1.75 MB
  • 9 dependencies
  • MIT license

Install

npm i styled-components
yarn add styled-components
pnpm add styled-components

Overview

CSS for the <Component> Age. Style components your way with speed, strong typing, and flexibility.

Index

Variables

variable styled

const styled: (<Target extends unknown>(
tag: Target
) => Styled<'web', Target, Target extends any ? any : BaseObject, BaseObject>) & {
object: Styled<
'web',
'object',
import('react').DetailedHTMLProps<
import('react').ObjectHTMLAttributes<HTMLObjectElement>,
HTMLObjectElement
>,
import('../types').BaseObject
>;
g: Styled<
'web',
'g',
import('react').SVGProps<SVGGElement>,
import('../types').BaseObject
>;
big: Styled<
'web',
'big',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
link: Styled<
'web',
'link',
import('react').DetailedHTMLProps<
import('react').LinkHTMLAttributes<HTMLLinkElement>,
HTMLLinkElement
>,
import('../types').BaseObject
>;
small: Styled<
'web',
'small',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
sub: Styled<
'web',
'sub',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
sup: Styled<
'web',
'sup',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
a: Styled<
'web',
'a',
import('react').DetailedHTMLProps<
import('react').AnchorHTMLAttributes<HTMLAnchorElement>,
HTMLAnchorElement
>,
import('../types').BaseObject
>;
abbr: Styled<
'web',
'abbr',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
address: Styled<
'web',
'address',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
area: Styled<
'web',
'area',
import('react').DetailedHTMLProps<
import('react').AreaHTMLAttributes<HTMLAreaElement>,
HTMLAreaElement
>,
import('../types').BaseObject
>;
article: Styled<
'web',
'article',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
aside: Styled<
'web',
'aside',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
audio: Styled<
'web',
'audio',
import('react').DetailedHTMLProps<
import('react').AudioHTMLAttributes<HTMLAudioElement>,
HTMLAudioElement
>,
import('../types').BaseObject
>;
b: Styled<
'web',
'b',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
base: Styled<
'web',
'base',
import('react').DetailedHTMLProps<
import('react').BaseHTMLAttributes<HTMLBaseElement>,
HTMLBaseElement
>,
import('../types').BaseObject
>;
bdi: Styled<
'web',
'bdi',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
bdo: Styled<
'web',
'bdo',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
blockquote: Styled<
'web',
'blockquote',
import('react').DetailedHTMLProps<
import('react').BlockquoteHTMLAttributes<HTMLQuoteElement>,
HTMLQuoteElement
>,
import('../types').BaseObject
>;
body: Styled<
'web',
'body',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLBodyElement>,
HTMLBodyElement
>,
import('../types').BaseObject
>;
br: Styled<
'web',
'br',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLBRElement>,
HTMLBRElement
>,
import('../types').BaseObject
>;
button: Styled<
'web',
'button',
import('react').DetailedHTMLProps<
import('react').ButtonHTMLAttributes<HTMLButtonElement>,
HTMLButtonElement
>,
import('../types').BaseObject
>;
canvas: Styled<
'web',
'canvas',
import('react').DetailedHTMLProps<
import('react').CanvasHTMLAttributes<HTMLCanvasElement>,
HTMLCanvasElement
>,
import('../types').BaseObject
>;
caption: Styled<
'web',
'caption',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
cite: Styled<
'web',
'cite',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
code: Styled<
'web',
'code',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
col: Styled<
'web',
'col',
import('react').DetailedHTMLProps<
import('react').ColHTMLAttributes<HTMLTableColElement>,
HTMLTableColElement
>,
import('../types').BaseObject
>;
colgroup: Styled<
'web',
'colgroup',
import('react').DetailedHTMLProps<
import('react').ColgroupHTMLAttributes<HTMLTableColElement>,
HTMLTableColElement
>,
import('../types').BaseObject
>;
data: Styled<
'web',
'data',
import('react').DetailedHTMLProps<
import('react').DataHTMLAttributes<HTMLDataElement>,
HTMLDataElement
>,
import('../types').BaseObject
>;
datalist: Styled<
'web',
'datalist',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLDataListElement>,
HTMLDataListElement
>,
import('../types').BaseObject
>;
dd: Styled<
'web',
'dd',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
del: Styled<
'web',
'del',
import('react').DetailedHTMLProps<
import('react').DelHTMLAttributes<HTMLModElement>,
HTMLModElement
>,
import('../types').BaseObject
>;
details: Styled<
'web',
'details',
import('react').DetailedHTMLProps<
import('react').DetailsHTMLAttributes<HTMLDetailsElement>,
HTMLDetailsElement
>,
import('../types').BaseObject
>;
dfn: Styled<
'web',
'dfn',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
dialog: Styled<
'web',
'dialog',
import('react').DetailedHTMLProps<
import('react').DialogHTMLAttributes<HTMLDialogElement>,
HTMLDialogElement
>,
import('../types').BaseObject
>;
div: Styled<
'web',
'div',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>,
import('../types').BaseObject
>;
dl: Styled<
'web',
'dl',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLDListElement>,
HTMLDListElement
>,
import('../types').BaseObject
>;
dt: Styled<
'web',
'dt',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
em: Styled<
'web',
'em',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
embed: Styled<
'web',
'embed',
import('react').DetailedHTMLProps<
import('react').EmbedHTMLAttributes<HTMLEmbedElement>,
HTMLEmbedElement
>,
import('../types').BaseObject
>;
fieldset: Styled<
'web',
'fieldset',
import('react').DetailedHTMLProps<
import('react').FieldsetHTMLAttributes<HTMLFieldSetElement>,
HTMLFieldSetElement
>,
import('../types').BaseObject
>;
figcaption: Styled<
'web',
'figcaption',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
figure: Styled<
'web',
'figure',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
footer: Styled<
'web',
'footer',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
form: Styled<
'web',
'form',
import('react').DetailedHTMLProps<
import('react').FormHTMLAttributes<HTMLFormElement>,
HTMLFormElement
>,
import('../types').BaseObject
>;
h1: Styled<
'web',
'h1',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
import('../types').BaseObject
>;
h2: Styled<
'web',
'h2',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
import('../types').BaseObject
>;
h3: Styled<
'web',
'h3',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
import('../types').BaseObject
>;
h4: Styled<
'web',
'h4',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
import('../types').BaseObject
>;
h5: Styled<
'web',
'h5',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
import('../types').BaseObject
>;
h6: Styled<
'web',
'h6',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
import('../types').BaseObject
>;
header: Styled<
'web',
'header',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
hgroup: Styled<
'web',
'hgroup',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
hr: Styled<
'web',
'hr',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLHRElement>,
HTMLHRElement
>,
import('../types').BaseObject
>;
html: Styled<
'web',
'html',
import('react').DetailedHTMLProps<
import('react').HtmlHTMLAttributes<HTMLHtmlElement>,
HTMLHtmlElement
>,
import('../types').BaseObject
>;
i: Styled<
'web',
'i',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
iframe: Styled<
'web',
'iframe',
import('react').DetailedHTMLProps<
import('react').IframeHTMLAttributes<HTMLIFrameElement>,
HTMLIFrameElement
>,
import('../types').BaseObject
>;
img: Styled<
'web',
'img',
import('react').DetailedHTMLProps<
import('react').ImgHTMLAttributes<HTMLImageElement>,
HTMLImageElement
>,
import('../types').BaseObject
>;
input: Styled<
'web',
'input',
import('react').DetailedHTMLProps<
import('react').InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>,
import('../types').BaseObject
>;
ins: Styled<
'web',
'ins',
import('react').DetailedHTMLProps<
import('react').InsHTMLAttributes<HTMLModElement>,
HTMLModElement
>,
import('../types').BaseObject
>;
kbd: Styled<
'web',
'kbd',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
keygen: Styled<
'web',
'keygen',
import('react').DetailedHTMLProps<
import('react').KeygenHTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
label: Styled<
'web',
'label',
import('react').DetailedHTMLProps<
import('react').LabelHTMLAttributes<HTMLLabelElement>,
HTMLLabelElement
>,
import('../types').BaseObject
>;
legend: Styled<
'web',
'legend',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLLegendElement>,
HTMLLegendElement
>,
import('../types').BaseObject
>;
li: Styled<
'web',
'li',
import('react').DetailedHTMLProps<
import('react').LiHTMLAttributes<HTMLLIElement>,
HTMLLIElement
>,
import('../types').BaseObject
>;
main: Styled<
'web',
'main',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
map: Styled<
'web',
'map',
import('react').DetailedHTMLProps<
import('react').MapHTMLAttributes<HTMLMapElement>,
HTMLMapElement
>,
import('../types').BaseObject
>;
mark: Styled<
'web',
'mark',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
menu: Styled<
'web',
'menu',
import('react').DetailedHTMLProps<
import('react').MenuHTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
menuitem: Styled<
'web',
'menuitem',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
meta: Styled<
'web',
'meta',
import('react').DetailedHTMLProps<
import('react').MetaHTMLAttributes<HTMLMetaElement>,
HTMLMetaElement
>,
import('../types').BaseObject
>;
meter: Styled<
'web',
'meter',
import('react').DetailedHTMLProps<
import('react').MeterHTMLAttributes<HTMLMeterElement>,
HTMLMeterElement
>,
import('../types').BaseObject
>;
nav: Styled<
'web',
'nav',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
noscript: Styled<
'web',
'noscript',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
ol: Styled<
'web',
'ol',
import('react').DetailedHTMLProps<
import('react').OlHTMLAttributes<HTMLOListElement>,
HTMLOListElement
>,
import('../types').BaseObject
>;
optgroup: Styled<
'web',
'optgroup',
import('react').DetailedHTMLProps<
import('react').OptgroupHTMLAttributes<HTMLOptGroupElement>,
HTMLOptGroupElement
>,
import('../types').BaseObject
>;
option: Styled<
'web',
'option',
import('react').DetailedHTMLProps<
import('react').OptionHTMLAttributes<HTMLOptionElement>,
HTMLOptionElement
>,
import('../types').BaseObject
>;
output: Styled<
'web',
'output',
import('react').DetailedHTMLProps<
import('react').OutputHTMLAttributes<HTMLOutputElement>,
HTMLOutputElement
>,
import('../types').BaseObject
>;
p: Styled<
'web',
'p',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLParagraphElement>,
HTMLParagraphElement
>,
import('../types').BaseObject
>;
param: Styled<
'web',
'param',
import('react').DetailedHTMLProps<
import('react').ParamHTMLAttributes<HTMLParamElement>,
HTMLParamElement
>,
import('../types').BaseObject
>;
picture: Styled<
'web',
'picture',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
pre: Styled<
'web',
'pre',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLPreElement>,
HTMLPreElement
>,
import('../types').BaseObject
>;
progress: Styled<
'web',
'progress',
import('react').DetailedHTMLProps<
import('react').ProgressHTMLAttributes<HTMLProgressElement>,
HTMLProgressElement
>,
import('../types').BaseObject
>;
q: Styled<
'web',
'q',
import('react').DetailedHTMLProps<
import('react').QuoteHTMLAttributes<HTMLQuoteElement>,
HTMLQuoteElement
>,
import('../types').BaseObject
>;
rp: Styled<
'web',
'rp',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
rt: Styled<
'web',
'rt',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
ruby: Styled<
'web',
'ruby',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
s: Styled<
'web',
's',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
samp: Styled<
'web',
'samp',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
script: Styled<
'web',
'script',
import('react').DetailedHTMLProps<
import('react').ScriptHTMLAttributes<HTMLScriptElement>,
HTMLScriptElement
>,
import('../types').BaseObject
>;
section: Styled<
'web',
'section',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
select: Styled<
'web',
'select',
import('react').DetailedHTMLProps<
import('react').SelectHTMLAttributes<HTMLSelectElement>,
HTMLSelectElement
>,
import('../types').BaseObject
>;
source: Styled<
'web',
'source',
import('react').DetailedHTMLProps<
import('react').SourceHTMLAttributes<HTMLSourceElement>,
HTMLSourceElement
>,
import('../types').BaseObject
>;
span: Styled<
'web',
'span',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLSpanElement>,
HTMLSpanElement
>,
import('../types').BaseObject
>;
strong: Styled<
'web',
'strong',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
style: Styled<
'web',
'style',
import('react').DetailedHTMLProps<
import('react').StyleHTMLAttributes<HTMLStyleElement>,
HTMLStyleElement
>,
import('../types').BaseObject
>;
summary: Styled<
'web',
'summary',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
table: Styled<
'web',
'table',
import('react').DetailedHTMLProps<
import('react').TableHTMLAttributes<HTMLTableElement>,
HTMLTableElement
>,
import('../types').BaseObject
>;
tbody: Styled<
'web',
'tbody',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLTableSectionElement>,
HTMLTableSectionElement
>,
import('../types').BaseObject
>;
td: Styled<
'web',
'td',
import('react').DetailedHTMLProps<
import('react').TdHTMLAttributes<HTMLTableDataCellElement>,
HTMLTableDataCellElement
>,
import('../types').BaseObject
>;
textarea: Styled<
'web',
'textarea',
import('react').DetailedHTMLProps<
import('react').TextareaHTMLAttributes<HTMLTextAreaElement>,
HTMLTextAreaElement
>,
import('../types').BaseObject
>;
tfoot: Styled<
'web',
'tfoot',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLTableSectionElement>,
HTMLTableSectionElement
>,
import('../types').BaseObject
>;
th: Styled<
'web',
'th',
import('react').DetailedHTMLProps<
import('react').ThHTMLAttributes<HTMLTableHeaderCellElement>,
HTMLTableHeaderCellElement
>,
import('../types').BaseObject
>;
thead: Styled<
'web',
'thead',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLTableSectionElement>,
HTMLTableSectionElement
>,
import('../types').BaseObject
>;
time: Styled<
'web',
'time',
import('react').DetailedHTMLProps<
import('react').TimeHTMLAttributes<HTMLTimeElement>,
HTMLTimeElement
>,
import('../types').BaseObject
>;
tr: Styled<
'web',
'tr',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLTableRowElement>,
HTMLTableRowElement
>,
import('../types').BaseObject
>;
track: Styled<
'web',
'track',
import('react').DetailedHTMLProps<
import('react').TrackHTMLAttributes<HTMLTrackElement>,
HTMLTrackElement
>,
import('../types').BaseObject
>;
u: Styled<
'web',
'u',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
ul: Styled<
'web',
'ul',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLUListElement>,
HTMLUListElement
>,
import('../types').BaseObject
>;
var: Styled<
'web',
'var',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
video: Styled<
'web',
'video',
import('react').DetailedHTMLProps<
import('react').VideoHTMLAttributes<HTMLVideoElement>,
HTMLVideoElement
>,
import('../types').BaseObject
>;
wbr: Styled<
'web',
'wbr',
import('react').DetailedHTMLProps<
import('react').HTMLAttributes<HTMLElement>,
HTMLElement
>,
import('../types').BaseObject
>;
svg: Styled<
'web',
'svg',
import('react').SVGProps<SVGSVGElement>,
import('../types').BaseObject
>;
circle: Styled<
'web',
'circle',
import('react').SVGProps<SVGCircleElement>,
import('../types').BaseObject
>;
clipPath: Styled<
'web',
'clipPath',
import('react').SVGProps<SVGClipPathElement>,
import('../types').BaseObject
>;
defs: Styled<
'web',
'defs',
import('react').SVGProps<SVGDefsElement>,
import('../types').BaseObject
>;
ellipse: Styled<
'web',
'ellipse',
import('react').SVGProps<SVGEllipseElement>,
import('../types').BaseObject
>;
foreignObject: Styled<
'web',
'foreignObject',
import('react').SVGProps<SVGForeignObjectElement>,
import('../types').BaseObject
>;
image: Styled<
'web',
'image',
import('react').SVGProps<SVGImageElement>,
import('../types').BaseObject
>;
line: Styled<
'web',
'line',
import('react').SVGLineElementAttributes<SVGLineElement>,
import('../types').BaseObject
>;
linearGradient: Styled<
'web',
'linearGradient',
import('react').SVGProps<SVGLinearGradientElement>,
import('../types').BaseObject
>;
marker: Styled<
'web',
'marker',
import('react').SVGProps<SVGMarkerElement>,
import('../types').BaseObject
>;
mask: Styled<
'web',
'mask',
import('react').SVGProps<SVGMaskElement>,
import('../types').BaseObject
>;
path: Styled<
'web',
'path',
import('react').SVGProps<SVGPathElement>,
import('../types').BaseObject
>;
pattern: Styled<
'web',
'pattern',
import('react').SVGProps<SVGPatternElement>,
import('../types').BaseObject
>;
polygon: Styled<
'web',
'polygon',
import('react').SVGProps<SVGPolygonElement>,
import('../types').BaseObject
>;
polyline: Styled<
'web',
'polyline',
import('react').SVGProps<SVGPolylineElement>,
import('../types').BaseObject
>;
radialGradient: Styled<
'web',
'radialGradient',
import('react').SVGProps<SVGRadialGradientElement>,
import('../types').BaseObject
>;
rect: Styled<
'web',
'rect',
import('react').SVGProps<SVGRectElement>,
import('../types').BaseObject
>;
stop: Styled<
'web',
'stop',
import('react').SVGProps<SVGStopElement>,
import('../types').BaseObject
>;
text: Styled<
'web',
'text',
import('react').SVGTextElementAttributes<SVGTextElement>,
import('../types').BaseObject
>;
tspan: Styled<
'web',
'tspan',
import('react').SVGProps<SVGTSpanElement>,
import('../types').BaseObject
>;
use: Styled<
'web',
'use',
import('react').SVGProps<SVGUseElement>,
import('../types').BaseObject
>;
};

    variable StyleSheetConsumer

    const StyleSheetConsumer: React.Consumer<IStyleSheetContext>;

      variable StyleSheetContext

      const StyleSheetContext: React.Context<IStyleSheetContext>;

        variable ThemeConsumer

        const ThemeConsumer: React.Consumer<DefaultTheme>;

          variable ThemeContext

          const ThemeContext: React.Context<DefaultTheme>;

            variable version

            const version: string;

              Functions

              function createGlobalStyle

              createGlobalStyle: <Props extends object>(
              strings: Styles<Props>,
              ...interpolations: Array<Interpolation<Props>>
              ) => React.NamedExoticComponent<ExecutionProps & Props>;

                function css

                css: {
                (
                styles: Styles<object>,
                ...interpolations: Interpolation<object>[]
                ): RuleSet<object>;
                <Props extends object>(
                styles: Styles<NoInfer<Props>>,
                ...interpolations: Interpolation<NoInfer<Props>>[]
                ): RuleSet<NoInfer<Props>>;
                };

                  function isStyledComponent

                  isStyledComponent: (target: any) => target is StyledComponentBrand;

                    function keyframes

                    keyframes: <Props extends object = {}>(
                    strings: Styles<Props>,
                    ...interpolations: Array<Interpolation<Props>>
                    ) => Keyframes;

                      function StyleSheetManager

                      StyleSheetManager: (
                      props: React.PropsWithChildren<{
                      disableCSSOMInjection?: boolean;
                      enableVendorPrefixes?: boolean;
                      namespace?: string;
                      sheet?: StyleSheet;
                      shouldForwardProp?: ShouldForwardProp<'web'>;
                      stylisPlugins?: stylis.Middleware[];
                      target?: HTMLElement;
                      }>
                      ) => JSX.Element;

                        function ThemeProvider

                        ThemeProvider: (props: Props) => JSX.Element | null;
                        • Provide a theme to an entire react component tree via context

                        function useTheme

                        useTheme: () => DefaultTheme;
                        • Returns the current theme (as provided by the closest ancestor ThemeProvider.)

                          If no ThemeProvider is found, the function will error. If you need access to the theme in an uncertain composition scenario, React.useContext(ThemeContext) will not emit an error if there is no ThemeProvider ancestor.

                        function withTheme

                        withTheme: <T extends unknown>(Component: T) => any;

                          Classes

                          class ServerStyleSheet

                          class ServerStyleSheet {}

                            constructor

                            constructor();

                              property getStyleElement

                              getStyleElement: () => React.JSX.Element[];

                                property getStyleTags

                                getStyleTags: () => string;

                                  property instance

                                  instance: StyleSheet;

                                    property seal

                                    seal: () => void;

                                      property sealed

                                      sealed: boolean;

                                        method collectStyles

                                        collectStyles: (children: any) => JSX.Element;

                                          method interleaveWithNodeStream

                                          interleaveWithNodeStream: (input: Readable) => streamInternal.Transform;

                                            Interfaces

                                            interface DefaultTheme

                                            interface DefaultTheme {}
                                            • Override DefaultTheme to get accurate typings for your project.

                                              // create styled-components.d.ts in your project source
                                              // if it isn't being picked up, check tsconfig compilerOptions.types
                                              import type { CSSProp } from "styled-components";
                                              import Theme from './theme';
                                              type ThemeType = typeof Theme;
                                              declare module "styled-components" {
                                              export interface DefaultTheme extends ThemeType {}
                                              }
                                              declare module "react" {
                                              interface DOMAttributes<T> {
                                              css?: CSSProp;
                                              }
                                              }

                                            index signature

                                            [key: string]: any;

                                              interface ExecutionContext

                                              interface ExecutionContext extends ExecutionProps {}
                                              • ExecutionProps but with theme required.

                                              property theme

                                              theme: DefaultTheme;

                                                interface IStyledComponent

                                                interface IStyledComponent<R extends Runtime, Props extends object = BaseObject>
                                                extends PolymorphicComponent<R, Props>,
                                                IStyledStatics<R, Props>,
                                                StyledComponentBrand {}

                                                  property defaultProps

                                                  defaultProps?: (ExecutionProps & Partial<Props>) | undefined;

                                                    property toString

                                                    toString: () => string;

                                                      interface IStyledComponentFactory

                                                      interface IStyledComponentFactory<
                                                      R extends Runtime,
                                                      Target extends StyledTarget<R>,
                                                      OuterProps extends object,
                                                      OuterStatics extends object = BaseObject
                                                      > {}

                                                        call signature

                                                        <Props extends object = BaseObject, Statics extends object = BaseObject>(
                                                        target: Target,
                                                        options: StyledOptions<R, OuterProps & Props>,
                                                        rules: RuleSet<OuterProps & Props>
                                                        ): IStyledComponent<R, Substitute<OuterProps, Props>> & OuterStatics & Statics;

                                                          interface IStyledStatics

                                                          interface IStyledStatics<R extends Runtime, OuterProps extends object>
                                                          extends CommonStatics<R, OuterProps> {}

                                                            property componentStyle

                                                            componentStyle: R extends 'web' ? ComponentStyle : never;

                                                              property foldedComponentIds

                                                              foldedComponentIds: R extends 'web' ? string : never;

                                                                property inlineStyle

                                                                inlineStyle: R extends 'native'
                                                                ? InstanceType<IInlineStyleConstructor<OuterProps>>
                                                                : never;

                                                                  property styledComponentId

                                                                  styledComponentId: R extends 'web' ? string : never;

                                                                    property target

                                                                    target: StyledTarget<R>;

                                                                      property warnTooManyClasses

                                                                      warnTooManyClasses?:
                                                                      | (R extends 'web' ? ReturnType<typeof createWarnTooManyClasses> : never)
                                                                      | undefined;

                                                                        interface PolymorphicComponent

                                                                        interface PolymorphicComponent<R extends Runtime, BaseProps extends object>
                                                                        extends React.ForwardRefExoticComponent<BaseProps> {}
                                                                        • This type forms the signature for a forwardRef-enabled component that accepts the "as" prop to dynamically change the underlying rendered JSX. The interface will automatically attempt to extract props from the given rendering target to get proper typing for any specialized props in the target component.

                                                                        call signature

                                                                        <
                                                                        AsTarget extends StyledTarget<R> | void = void,
                                                                        ForwardedAsTarget extends StyledTarget<R> | void = void
                                                                        >(
                                                                        props: PolymorphicComponentProps<R, BaseProps, AsTarget, ForwardedAsTarget>
                                                                        ): JSX.Element;

                                                                          interface ShouldForwardProp

                                                                          interface ShouldForwardProp<R extends Runtime> {}

                                                                            call signature

                                                                            (prop: string, elementToBeCreated: StyledTarget<R>): boolean;

                                                                              interface StyledObject

                                                                              interface StyledObject<Props extends object = BaseObject>
                                                                              extends CSSProperties,
                                                                              CSSPseudos {}

                                                                                index signature

                                                                                [key: string]:
                                                                                | StyledObject<Props>
                                                                                | string
                                                                                | number
                                                                                | StyleFunction<Props>
                                                                                | RuleSet<any>
                                                                                | undefined;

                                                                                  interface StyledOptions

                                                                                  interface StyledOptions<R extends Runtime, Props extends object> {}

                                                                                    property attrs

                                                                                    attrs?: Attrs<Props>[] | undefined;

                                                                                      property componentId

                                                                                      componentId?: (R extends 'web' ? string : never) | undefined;

                                                                                        property displayName

                                                                                        displayName?: string | undefined;

                                                                                          property parentComponentId

                                                                                          parentComponentId?: (R extends 'web' ? string : never) | undefined;

                                                                                            property shouldForwardProp

                                                                                            shouldForwardProp?: ShouldForwardProp<R> | undefined;

                                                                                              interface StyleFunction

                                                                                              interface StyleFunction<Props extends object> {}

                                                                                                call signature

                                                                                                (executionContext: ExecutionContext & Props): Interpolation<Props>;

                                                                                                  Type Aliases

                                                                                                  type Attrs

                                                                                                  type Attrs<Props extends object = BaseObject> =
                                                                                                  | (ExecutionProps & Partial<Props>)
                                                                                                  | ((props: ExecutionContext & Props) => ExecutionProps & Partial<Props>);

                                                                                                    type CSSKeyframes

                                                                                                    type CSSKeyframes = object & {
                                                                                                    [key: string]: CSSObject;
                                                                                                    };

                                                                                                      type CSSObject

                                                                                                      type CSSObject<Props extends object = BaseObject> = StyledObject<Props>;

                                                                                                        type CSSProp

                                                                                                        type CSSProp = Interpolation<any>;
                                                                                                        • The css prop is not declared by default in the types as it would cause css to be present on the types of anything that uses styled-components indirectly, even if they do not use the babel plugin.

                                                                                                          To enable support for the css prop in TypeScript, create a styled-components.d.ts file in your project source with the following contents:

                                                                                                          import type { CSSProp } from "styled-components";
                                                                                                          declare module "react" {
                                                                                                          interface Attributes {
                                                                                                          css?: CSSProp;
                                                                                                          }
                                                                                                          }

                                                                                                          In order to get accurate typings for props.theme in css interpolations, see DefaultTheme.

                                                                                                        type CSSProperties

                                                                                                        type CSSProperties = CSS.Properties<number | (string & {})>;

                                                                                                          type CSSPseudos

                                                                                                          type CSSPseudos = {
                                                                                                          [K in CSS.Pseudos]?: CSSObject;
                                                                                                          };

                                                                                                            type DataAttributes

                                                                                                            type DataAttributes = {
                                                                                                            [key: `data-${string}`]: any;
                                                                                                            };
                                                                                                            • This type is intended for when data attributes are composed via the .attrs API:

                                                                                                              styled.div.attrs<DataAttributes>({ 'data-testid': 'foo' })``

                                                                                                              Would love to figure out how to support this natively without having to manually compose the type, but haven't figured out a way to do so yet that doesn't cause specificity loss (see test/types.tsx if you attempt to embed DataAttributes directly in the Attrs<> type.)

                                                                                                            type ExecutionProps

                                                                                                            type ExecutionProps = {
                                                                                                            /**
                                                                                                            * Dynamically adjust the rendered component or HTML tag, e.g.
                                                                                                            * ```
                                                                                                            * const StyledButton = styled.button``
                                                                                                            *
                                                                                                            * <StyledButton as="a" href="/foo">
                                                                                                            * I'm an anchor now
                                                                                                            * </StyledButton>
                                                                                                            * ```
                                                                                                            */
                                                                                                            as?: KnownTarget | undefined;
                                                                                                            forwardedAs?: KnownTarget | undefined;
                                                                                                            theme?: DefaultTheme | undefined;
                                                                                                            };

                                                                                                              type Interpolation

                                                                                                              type Interpolation<Props extends object> =
                                                                                                              | StyleFunction<Props>
                                                                                                              | StyledObject<Props>
                                                                                                              | TemplateStringsArray
                                                                                                              | string
                                                                                                              | number
                                                                                                              | false
                                                                                                              | undefined
                                                                                                              | null
                                                                                                              | Keyframes
                                                                                                              | StyledComponentBrand
                                                                                                              | RuleSet<Props>
                                                                                                              | Interpolation<Props>[];

                                                                                                                type IStyleSheetContext

                                                                                                                type IStyleSheetContext = {
                                                                                                                shouldForwardProp?: ShouldForwardProp<'web'> | undefined;
                                                                                                                styleSheet: StyleSheet;
                                                                                                                stylis: Stringifier;
                                                                                                                };

                                                                                                                  type IStyleSheetManager

                                                                                                                  type IStyleSheetManager = React.PropsWithChildren<{
                                                                                                                  /**
                                                                                                                  * If desired, you can pass this prop to disable "speedy" insertion mode, which
                                                                                                                  * uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).
                                                                                                                  * When disabled, rules are inserted as simple text into style blocks.
                                                                                                                  */
                                                                                                                  disableCSSOMInjection?: undefined | boolean;
                                                                                                                  /**
                                                                                                                  * If you are working exclusively with modern browsers, vendor prefixes can often be omitted
                                                                                                                  * to reduce the weight of CSS on the page.
                                                                                                                  */
                                                                                                                  enableVendorPrefixes?: undefined | boolean;
                                                                                                                  /**
                                                                                                                  * Provide an optional selector to be prepended to all generated style rules.
                                                                                                                  */
                                                                                                                  namespace?: undefined | string;
                                                                                                                  /**
                                                                                                                  * Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.
                                                                                                                  */
                                                                                                                  sheet?: undefined | StyleSheet;
                                                                                                                  /**
                                                                                                                  * Starting in v6, styled-components no longer does its own prop validation
                                                                                                                  * and recommends use of transient props "$prop" to pass style-only props to
                                                                                                                  * components. If for some reason you are not able to use transient props, a
                                                                                                                  * prop validation function can be provided via `StyleSheetManager`, such as
                                                                                                                  * `@emotion/is-prop-valid`.
                                                                                                                  *
                                                                                                                  * When the return value is `true`, props will be forwarded to the DOM/underlying
                                                                                                                  * component. If return value is `false`, the prop will be discarded after styles
                                                                                                                  * are calculated.
                                                                                                                  *
                                                                                                                  * Manually composing `styled.{element}.withConfig({shouldForwardProp})` will
                                                                                                                  * override this default.
                                                                                                                  */
                                                                                                                  shouldForwardProp?: undefined | IStyleSheetContext['shouldForwardProp'];
                                                                                                                  /**
                                                                                                                  * An array of plugins to be run by stylis (style processor) during compilation.
                                                                                                                  * Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).
                                                                                                                  *
                                                                                                                  * \* The plugin(s) must be compatible with stylis v4 or above.
                                                                                                                  */
                                                                                                                  stylisPlugins?: undefined | stylis.Middleware[];
                                                                                                                  /**
                                                                                                                  * Provide an alternate DOM node to host generated styles; useful for iframes.
                                                                                                                  */
                                                                                                                  target?: undefined | HTMLElement;
                                                                                                                  }>;

                                                                                                                    type IStylisContext

                                                                                                                    type IStylisContext = Stringifier | void;

                                                                                                                      type PolymorphicComponentProps

                                                                                                                      type PolymorphicComponentProps<
                                                                                                                      R extends Runtime,
                                                                                                                      BaseProps extends object,
                                                                                                                      AsTarget extends StyledTarget<R> | void,
                                                                                                                      ForwardedAsTarget extends StyledTarget<R> | void,
                                                                                                                      AsTargetProps extends object = AsTarget extends KnownTarget
                                                                                                                      ? React.ComponentPropsWithRef<AsTarget>
                                                                                                                      : {},
                                                                                                                      ForwardedAsTargetProps extends object = ForwardedAsTarget extends KnownTarget
                                                                                                                      ? React.ComponentPropsWithRef<ForwardedAsTarget>
                                                                                                                      : {}
                                                                                                                      > = NoInfer<
                                                                                                                      FastOmit<
                                                                                                                      Substitute<BaseProps, Substitute<ForwardedAsTargetProps, AsTargetProps>>,
                                                                                                                      keyof ExecutionProps
                                                                                                                      >
                                                                                                                      > &
                                                                                                                      FastOmit<ExecutionProps, 'as' | 'forwardedAs'> & {
                                                                                                                      as?: AsTarget;
                                                                                                                      forwardedAs?: ForwardedAsTarget;
                                                                                                                      };
                                                                                                                      • Used by PolymorphicComponent to define prop override cascading order.

                                                                                                                      type RuleSet

                                                                                                                      type RuleSet<Props extends object = BaseObject> = Interpolation<Props>[];

                                                                                                                        type Runtime

                                                                                                                        type Runtime = 'web' | 'native';

                                                                                                                          type SupportedHTMLElements

                                                                                                                          type SupportedHTMLElements = (typeof elements)[number];

                                                                                                                            type WebTarget

                                                                                                                            type WebTarget = string | KnownTarget;

                                                                                                                              Package Files (13)

                                                                                                                              Dependencies (9)

                                                                                                                              Dev Dependencies (47)

                                                                                                                              Peer Dependencies (2)

                                                                                                                              Badge

                                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/styled-components.

                                                                                                                              • Markdown
                                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/styled-components)
                                                                                                                              • HTML
                                                                                                                                <a href="https://www.jsdocs.io/package/styled-components"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>