Skip to content

Make theme values passed to css and sx properties typesafe  #2006

@ammar88

Description

@ammar88

Is your feature request related to a problem? Please describe.
I'd like to find a way to make the value I pass to variant (and other theme aware properties) type safe and have it provide autocompleted values from my theme. Currently I can pass any string to variant and it will fail silently since variant accepts any string.

<SomeComponent sx={{ variant: 'accepts any string and produces no error' }} />

Describe the solution you'd like
I'd like to able to pass a string that corresponds to what exists in my theme file and have errors produced if I pass a string that doesn't.

Additional Context
Would this solve my issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions