-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type the size prop according to the available sizes #442
Comments
i'm willing to make a PR to set it for every component, but i don't know if the sizes are customizable |
The
However, you can override the Maybe it would work to type it with something like this? size: {
type: String as PropType<typeof appConfig.ui.button.size>,
default: () => appConfig.ui.button.default.size,
validator (value: string) {
return Object.keys(appConfig.ui.button.size).includes(value)
}
} |
i wanted to test it out locally so i forked and cloned it, but couldn't test it / run it because i need the Token 🤔 |
You can run the docs and the playground in dev mode, you just can't generate the docs. |
I think if size: {
type: String as PropType<keyof typeof appConfig.ui.button.size>,
default: () => appConfig.ui.button.default.size,
validator (value: string) {
return Object.keys(appConfig.ui.button.size).includes(value)
}
} |
Is your feature request related to a problem? Please describe.
It's not a problem per se but it would be nice to get autocomplete on the size prop.
Describe the solution you'd like
type all size props to the available sizes:
size: "3xs" | "xs" | "md" | "lg"
aaand so onDescribe alternatives you've considered
I don't know if the solution above works, because i don't know if you can set your own sizes (did not find anything in the docs).
In that case you'd probably have to read in the tailwind.config.ts 🤔
Additional context
The text was updated successfully, but these errors were encountered: