Replies: 1 comment 1 reply
-
I'm not 100% sure I understand the question, but typically you define a recipe and then export the types from that recipe. import { cva, type RecipeVariantProps } from styled-system/css'
const button = cva({
base: {
display: 'flex'
},
variants: {
visual: {
solid: { bg: 'red.200', color: 'white' },
outline: { borderWidth: '1px', borderColor: 'red.200' }
},
size: {
sm: { padding: '4', fontSize: '12px' },
lg: { padding: '8', fontSize: '24px' }
}
}
})
export ButtonRecipeVariantProps = RecipeVariantProps<typeof checkboxRecipe>; // Use this in your component |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using pandacss's recipe in a React environment to style components.
And I want to get the type of the recipe using RecipeVariant.
This is my recipe declaration file.
As you can see, the ComponentVariant type is not exported. I want to import that type into the component and use it, but is there a way to export it?
p.s. I don't want to use types wrapped in ConditionalValue.
Beta Was this translation helpful? Give feedback.
All reactions