Replies: 2 comments 5 replies
-
You'll want to read the styled component guide but here's a simple solution: import tw, { styled } from 'twin.macro'
const Button = styled.button(({ variant }) => [
tw`text-center px-10 py-2 rounded-main bg-primary text-white shadow`,
variant && tw`bg-black`, // Add variant styles
]) |
Beta Was this translation helpful? Give feedback.
2 replies
-
From the latest version of twin.macro styled is not importing how can I fix that issue |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on my project and I want to use the variant property for buttons like this one and I am using version "^3.0.1",
<Button variant="primary">Submit</Button>
I try to find everywhere and didn't find any right solution. I know I can create a component with props and pass children but I want to know if I can do this with version 3.0.1
Beta Was this translation helpful? Give feedback.
All reactions