Replies: 1 comment
-
In the preview, meta or story level you can set the parameters.docs.source.transform method where you have the code as string and the storycontext object. You can manipulate the string like (pseudo code) if context.argtypes contains columns ... replace (regex) columns = {your data} with {...} or even trim it. Then return the adjusted code string. When the defaults are not enough, set language to typescript and format to HTML or typescript and code to dynamic (you can play around). If you need an example just ask. |
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
-
Summary
I have a Datatable component documented in Storybook. I have multiple stories build around it's functionality, but in all stories' code examples we have duplicated the
columns
(column shape definition) anddata
properties. Those two props are super lengthy (as you can see in the screenshot) and not very useful to overall documentation as users already know that you just need those.Is there a way how to completely remove specific properties from code examples or replace those with ellipsis like
data={...}
?Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions