Creating Multiple Variants
See original GitHub issueI am looking for a way to create multiple variants for buttons. For example, let’s say I want to have the following three variants:
- Size (small, medium, large, etc).
- Look (primary, secondary, disabled, etc).
- Kind (default, outline, text, etc).
So that I could style a button like this:
<button
sx={{
size="buttons.size.large"
kind="buttons.kind.outline"
look="buttons.look.secondary"
}}
/>
This IS possible with style system – here is an example:
- https://mathanpec.github.io/component-library/?path=/story/button--size-variant
- https://github.com/mathanpec/component-library/blob/basic-setup/src/theme/buttonStyle.ts
But I can’t figure out how to do with with Theme-UI.
Is this possible with Theme-UI? If so, can how can I do it?
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:17 (7 by maintainers)
Top Results From Across the Web
Design Guidelines for Selling Products with Multiple Variants
Different products should have different listings; product variations should be displayed under a single listing.
Read more >Adding variants - Shopify Help Center
In the Variants section, click the name of the variant to duplicate, and then click Duplicate. Edit at least one option value to...
Read more >Create and use variants - Figma Help Center
Create new variants · Click from the toolbar, or · Right-click the main component > Main component > Add variant, or · Click...
Read more >How Do I Add Multiple Variants on Shopify? - website builder
There are two ways to add multiple variants on Shopify. The first way is to use the built-in Shopify Variant Creator.
Read more >How can I create Multiple Variants of product with 2 or more ...
I am trying to create 9 variants in a single CREATE API Call, set there stock etc. final product should have following variants....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ve discussed adding support for a
variants
key which would deep merge multiple variants, but haven’t introduced that yetHow about comma separated strings? @jxnblk
Merry Christmas to y’all 🎅 🎉