Use textVariants inside custom component based on selected variant #259
Unanswered
TheoLAFARGE
asked this question in
Q&A
Replies: 1 comment
-
I haven't found any info about it, but I assume we can do something like this: const labelVariant = rest.variant === 'primary' ? 'header' : 'body';
// and then
<Text variant={labelVariant}>{label}</Text> Maybe this example PR will be useful |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys !
I'm new to this lib (and also typescript). I'm struggling to use a variant on a child element based on the variant passed to my component.
Here is my button :
and my theme :
In my Button component, I have a text with the variant body. But I don't want all my button to have this kind of text.
For my secondary button, i want a variant "header" for exemple. How can I do that ?
Is their a way from the theme to select the textVariants for a specific buttonVariants ?
For example :
Beta Was this translation helpful? Give feedback.
All reactions