-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
addon-controls - Disabling controls for a story does not hide them on argsTable #15780
Comments
I don't think that hiding the Controls column is supported; I know you can remove the rows from the table. There seems to be some mentions about hiding the column in #12345 and it might have some workarounds but that is the best Storybook can offer so far |
@7studio As a workaround you could wrap the In your stories.mdx file:
in a .storybook/storybook.css (override) file:
make sure to setup that storybook.css override in .storybook/preview.js:
|
Controls does not hidden on args table, for that exist another property. If you want to hidde some property on table, you have to use table.
|
That would disable the entire row for an arg, not a specific property of it. |
any news? its kind of weird that disabling table (which corresponds to doc page) deletes control, and i cant override it by directly writing "control", P.S. What is wrong with docs? Why do i get know about "disable" property from issues on github? |
@maeriens Exactly. Have you by any chance found a solution? |
Leaving the prop for documentation purposes only and disabling the ability to change the component can be done like so:
|
I have another problem. For good measure I write this in global export const argTypes = {
style: {
table: {
disable: true,
},
},
}; But if I do this, |
This is now mentioned here: https://storybook.js.org/docs/react/essentials/controls#disable-controls-for-specific-properties argTypes: {
// remove the prop documentation from the table
foo: {
table: {
disable: true,
},
},
}, argTypes: {
// render the prop documentation, but without a control
foo: {
control: false,
},
}, |
Can we disable controls for the whole story without going into the each and every prop? There are only 2️⃣ , but still...:) |
I have the same question as @manavm1990. I am usiong pandacss to style my components, and they can receive hundreds of styling properties, I want to hide them in storybook. And ain't no way Imma disable all of them manually. |
@manavm1990 @FilipePfluck you can overwrite
You can check how the default function is implemented here:
The function implementation is different between frameworks. The one above is for React. You can look for the others inside the repo. You can set this in |
@FilipePfluck and @manavm1990 Took me a while to figure this out, and it may not work for your needs, but I personally use the
Source(ish): https://storybook.js.org/docs/react/configure/typescript#extending-the-default-configuration |
# Pull Request ## 🤨 Rationale As part of #824 we want to improve the accuracy and comprehensiveness of our storybook API documentation. ## 👩💻 Implementation Apply the following patterns to the menu button docs: 1. create sections in the args table for attributes, slots, and events. (We'd also add methods for components that expose interesting ones) 2. Ensure the title and description are accurate for each member 3. link to shared docs about component APIs. Other minor bug fixes: 1. hide the "patterns" page from public storybook 2. hide text from ✅ icon mapping in component status table ### Possible follow up work 1. update doc templates and the docs for other existing components similarly 1. more detailed API overview docs - explanation of event patterns in web components and how they map to frameworks - using forms instead of change events 1. see if we can remove the type annotation from control descriptions 2. [wait for further feedback] more curated examples and highlight most important APIs for each component 1. [out of scope] I wish I could hide the Default column since we don't bother populating it but that doesn't seem to be possible storybookjs/storybook#15780 ## 🧪 Testing Manual storybook interaction ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
Describe the bug
When I set the
controls
parameter to{ disabled: true }
for a story, the "Control" column into<argsTable story="">
doesn't disappear, even if I overrideargTypes
on story withcontrol: { type: null }
.Case 1:
<Story parameters={{ controls: { disable: true } }}></Story>
argsTable
Control panel
Case 2:
<Story argTypes={{ title: { control: { type: null } } }}></Story>
argsTable
Control panel
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
When I disable controls for a story (or all controls are null), I expect the "Control" column and the reload button into
<argsTable>
component to disappear and the Control panel to be empty.System
The text was updated successfully, but these errors were encountered: