Changing default values of component props #1171
Unanswered
yorickvandervis
asked this question in
Help
Replies: 1 comment
-
Hello, yorickvandervis. you must edit the default shadcn added component. Add these lines to it and then export it.
For example the total component would be something like this:
Another approach is to set it to the provider like this:
and it will apply to all the tooltips wrapped by the provider. Another case is to apply to each ToolTip like this:
So you can have Tooltips with different delay durations. But be careful, combining these approaches together can get a little tricky. Despite all these approaches you can simply write this line, but it is deprecated:
I hope you got your answer. |
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
-
Hey,
Wondering if there was another way of easily changing default values for ALL components of a specific type, in this case ToolTip. I wanted to change the default value of the ToolTip - openDelay from 700 (default) to 400 but couldn't figure out where to easily change this.
Right now I've created a custom component and forwarded the props:
And then exported the ToolTip component like this:
But there's probably a better way, hence the question.. :-).
Beta Was this translation helpful? Give feedback.
All reactions