Describe the bug
It's either not possible or not documented as to how we can display controls in addon-docs's <Props/> block if using a custom docs.page parameter.
To Reproduce
Steps to reproduce the behavior:
preivew.js e.g.:javascript
addParameters({
docs: {
source: {
type: "code",
} ,
page: () => {
return (
<>
<Title />
<Subtitle />
<Primary />
<Description />
<Props />
<Stories includePrimary />
</>
);
},
},
});
canvas viewdocs page -> No prop types.Expected behavior
The docs for addon-docs suggest that if using a CSF, props table automatically shows controls if they are there, so I'd expect that to happen.
If this is not possible, it should probably be indicated here and here
To set controls for the primary story:
<Props story="^" />
Perfect, that's the one. I've also found this in the source so for anyone else who finds this in future you can also pass . to use the selected story (select via the sidebar).
@shilman thanks again for helping me out - really enjoying SB6.
FYI, we're renaming the blocks and making ^ the default in ArgsTable. You can still opt in to the old behavior with of='.'. See https://github.com/storybookjs/storybook/pull/11744
Most helpful comment
FYI, we're renaming the blocks and making
^the default inArgsTable. You can still opt in to the old behavior withof='.'. See https://github.com/storybookjs/storybook/pull/11744