Skip to content

StyledComponentsOptions

This content is not available in your language yet.

Defined in: core/index.ts:752

styled-components transform options (babel-plugin-styled-components-compatible).

optional cssProp?: boolean

Defined in: core/index.ts:787

Extract the <div css={...}> JSX prop into a module-level styled component (default: false). Opt-in, unlike babel-plugin-styled-components which defaults to true. Supports intrinsic / custom (including jsx_member_expression) / css\`template / object form /${expr}dynamic prop forwarding. On auto-inject, astyledbinding collision is automatically mangled to_styled/_styled2`.


optional displayName?: boolean

Defined in: core/index.ts:754

Auto-assign a displayName for devtools display (default: NODE_ENV !== “production”).


optional fileName?: boolean

Defined in: core/index.ts:758

Include the file name in componentId (default: true).


optional meaninglessFileNames?: string[]

Defined in: core/index.ts:772

List that makes the displayName prefix fall back to the parent dir when the basename is meaningless (default: ["index"]). Equivalent to the option of the same name in babel-plugin-styled-components.


optional meta?: boolean

Defined in: core/index.ts:789

Emit the [meta] marker (default: false).


optional minify?: boolean

Defined in: core/index.ts:760

Minify CSS whitespace (default: true).


optional namespace?: string

Defined in: core/index.ts:766

Namespace prefix for displayName / componentId — isolates multiple styled instances.


optional pure?: boolean

Defined in: core/index.ts:764

Tell the minifier that styled.X is side-effect-free (default: false).


optional ssr?: boolean

Defined in: core/index.ts:756

Deterministic componentId hash for stable SSR hydration (default: true).


optional topLevelImportPaths?: string[]

Defined in: core/index.ts:778

List of import sources to recognize as vendored forks (e.g. @my-org/styled, @my-org/*, @{my-org,co}/*). picomatch-compatible glob — *, ?, [abc]/[a-z]/[!abc], {a,b} (nesting allowed).


optional transpileTemplateLiterals?: boolean

Defined in: core/index.ts:762

Recognize template literals downleveled to modern JS (default: true).