KC's Workspace
    Preparing search index...

    Configure how styled-components are transformed.

    interface StyledComponentsOptions {
        cssProp?: boolean;
        displayName?: boolean;
        fileName?: boolean;
        meaninglessFileNames?: string[];
        minify?: boolean;
        namespace?: string;
        pure?: boolean;
        ssr?: boolean;
        topLevelImportPaths?: string[];
        transpileTemplateLiterals?: boolean;
    }
    Index

    Properties

    cssProp?: boolean

    Enables transformation of JSX css prop when using styled-components.

    Note: This feature is not yet implemented in oxc.

    true
    
    displayName?: boolean

    Enhances the attached CSS class name on each component with richer output to help identify your components in the DOM without React DevTools.

    true
    
    fileName?: boolean

    Controls whether the displayName of a component will be prefixed with the filename to make the component name as unique as possible.

    true
    
    meaninglessFileNames?: string[]

    List of file names that are considered meaningless for component naming purposes.

    When the fileName option is enabled and a component is in a file with a name from this list, the directory name will be used instead of the file name for the component's display name.

    ["index"]

    minify?: boolean

    Minifies CSS content by removing all whitespace and comments from your CSS, keeping valuable bytes out of your bundles.

    true
    
    namespace?: string

    Adds a namespace prefix to component identifiers to ensure class names are unique.

    Example: With namespace: "my-app", generates componentId: "my-app__sc-3rfj0a-1"

    pure?: boolean

    Enables "pure annotation" to aid dead code elimination by bundlers.

    false
    
    ssr?: boolean

    Adds a unique identifier to every styled component to avoid checksum mismatches due to different class generation on the client and server during server-side rendering.

    true
    
    topLevelImportPaths?: string[]

    Import paths to be considered as styled-components imports at the top level.

    Note: This feature is not yet implemented in oxc.

    transpileTemplateLiterals?: boolean

    Transpiles styled-components tagged template literals to a smaller representation than what Babel normally creates, helping to reduce bundle size.

    true