-
Notifications
You must be signed in to change notification settings - Fork 93
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
Auto generate Controls from Typescript types #456
Comments
I did a little bit of discovery on the viability of this, and it looks like ❌ Does not generate type information const Card: Story<Props> = ({ label }) => <p>Label: {label}</p>; ✅ Generates type information const Card: Story<Props> = ({ label }: Props) => <p>Label: {label}</p>; Considerations
@tajo do you have any opinion on if this is something that you'd like implemented? If so, could you provide a bit of direction on how you'd like this structured? Any info would be appreciated if you are interested in this, and I'd be happy to take a stab at an implementation. |
It would nice to have this as an opt-in feature through Also, I assume, when enabled and args/argTypes are defined at the same time, args/argTypes should take the precedence. |
Found https://github.com/lukifer/ladlescoop enthusiast project for that:
|
Ladlescoop doesn't support generation controls from inherited props yet Please consider controls autogeneration feature as top 🔝 priority. ⚡ Instant startup time is cool but syncing ladle controls manually on each component change is a boring 🥵 tedious task which outweights ⚖️ all developer's time saved by ladle optimisations. It breaks single-source-of-truth principle. Because of this can't switch from Storybook to Ladle yet and can't advice switching to friends/colleagues 🤷♂️ |
Is your feature request related to a problem? Please describe.
When using Typescript and args/argTypes it is very repetitive to specify the props as a Typescript type and then repeat the same structure again in the story file as args and argTypes.
Describe the solution you'd like
The ability to auto generate Controls, ie:
Props are translated into a select/radio with the options
Describe alternatives you've considered
react-docgen
Additional context
N/A
The text was updated successfully, but these errors were encountered: