react-compinators
    Preparing search index...

    Type Alias VariantDefs<Names, Props>

    VariantDefs: Record<Names[number], Partial<Props>>

    A base type for type-level maps of variant name to variant definition.

    Type Parameters

    • Names extends readonly string[]

      Readonly array of variant names.

    • Props extends object

      Props type for base component.

    type MyVariantDefs =  VariantDefs<
    ['primary', 'secondary'],
    {color: string}
    >
    const myVariantDefs: MyVariantDefs = {
    primary: {color: 'red'},
    secondary: {color: 'blue'},
    }