Skip to content

How to create Variants in Version 3 and ensure type safety #9453

Closed Answered by segunadebayo
SalzstangeSalamiBrief asked this question in Q&A
Discussion options

You must be logged in to vote

Here's the migration for the recipe.

const buttonRecipe = defineRecipe({
  variants: {
    variant: {
      myCustomButtonVariant: {
        fontSize: "lg",
        px: 6,
        py: 3,
      },
    },
  },
})

Notice the use of variants.variant to define the custom variant

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
3 replies
@GradyTruitt
Comment options

@GradyTruitt
Comment options

@ericafwalsh
Comment options

Answer selected by SalzstangeSalamiBrief
Comment options

You must be logged in to vote
4 replies
@GradyTruitt
Comment options

@SalzstangeSalamiBrief
Comment options

@veloware
Comment options

@aaroneaton
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@stilldesign
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants