You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a recent project, I needed to add a new behavior to the button component, which is quite simple to do using ShadCN. Later, when I started another project, I felt the need for the same feature again and thought it might be useful if this behavior was part of the default ShadCN package.
The change I made to my button component was straightforward; I added a new behavior attribute. Here's how it turned out:
I added the property to the arguments like this: ({ className, variant, size, behavior, asChild = false, ...props }, ref)
And the corresponding component setup: className={cn(buttonVariants({ variant, size, behavior, className }))}
I’d like to know your thoughts on whether this is a change worth implementing. I didn’t create a PR because I’m not entirely sure where exactly to do this in the ShadCN codebase, so I thought it’d be better to ask for your opinion first.
Affected component/components
Button
Additional Context
It's very helpfull
Before submitting
I've made research efforts and searched the documentation
I've searched for existing issues and PRs
The text was updated successfully, but these errors were encountered:
Feature description
In a recent project, I needed to add a new behavior to the button component, which is quite simple to do using ShadCN. Later, when I started another project, I felt the need for the same feature again and thought it might be useful if this behavior was part of the default ShadCN package.
The change I made to my button component was straightforward; I added a new behavior attribute. Here's how it turned out:
I added the property to the arguments like this:
({ className, variant, size, behavior, asChild = false, ...props }, ref)
And the corresponding component setup:
className={cn(buttonVariants({ variant, size, behavior, className }))}
To render a button it's like that:
I’d like to know your thoughts on whether this is a change worth implementing. I didn’t create a PR because I’m not entirely sure where exactly to do this in the ShadCN codebase, so I thought it’d be better to ask for your opinion first.
Affected component/components
Button
Additional Context
It's very helpfull
Before submitting
The text was updated successfully, but these errors were encountered: