-
Notifications
You must be signed in to change notification settings - Fork 32
docs: add deep controls add on #3178
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
base: main
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit 5e59224
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
is
really
nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! 🔥🔥
I saw some things that could use some touch-ups, so left some thoughts/Qs.
packages/styleguide/src/lib/Atoms/Buttons/CTAButton/CTAButton.stories.tsx
Outdated
Show resolved
Hide resolved
packages/styleguide/src/lib/Atoms/FormElements/FormGroup/FormGroup.stories.tsx
Show resolved
Hide resolved
...styleguide/src/lib/Organisms/ConnectedForm/ConnectedFormGroup/ConnectedFormGroup.stories.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great to me - only nits are maybe some DRYing up can happen with infotip since its nested in a few places 🔥
packages/styleguide/src/lib/Atoms/FormElements/FormGroupLabel/FormGroupLabel.stories.tsx
Show resolved
Hide resolved
📬Published Alpha Packages:@codecademy/[email protected] |
🚀 Styleguide deploy preview ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the new docs!
Added some editorial stuff for consideration 🙏
📬 Published Alpha Packages:
|
🚀 Styleguide deploy preview ready! Preview URL: https://68f2a5c031cd396f8b21deb0--gamut-preview.netlify.app |
Overview
We've integrated the storybook-addon-deep-controls package into our Storybook setup to enhance the developer experience when working with complex, nested object props in our component stories. This addon transforms the way we interact with deeply nested properties by breaking them down into individual, user-friendly controls instead of requiring manual JSON editing.
How It Works
The addon automatically detects nested object properties in component args and creates individual controls for each primitive property within the nested structure. Instead of seeing a single JSON editor for complex objects, developers now see separate, typed controls for each nested property.
Key Technical Implementation:
Automatic Generation: The addon automatically splits any defined object args into multiple primitive controls for each deep primitive property passed into
args
. See Alert as an example.Dot Notation: If you need/want to customize the
argType
beyond what is inferred automatically, you can access the nested properties using dot notation inargTypes
, such as:'tipProps.placement'
for tooltip placement options'infotip.emphasis'
for infotip emphasis levels'popoverProps.beak'
for popover beak positioningTypeWithDeepControls<Meta<typeof Component>>
instead of the standardMeta<typeof Component>
to enable proper TypeScript support for deep controls.PR Checklist
Testing Instructions
PR Links and Envs