Skip to content
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

children in the args object? #12570

Closed
stubar opened this issue Sep 24, 2020 · 3 comments
Closed

children in the args object? #12570

stubar opened this issue Sep 24, 2020 · 3 comments

Comments

@stubar
Copy link

stubar commented Sep 24, 2020

support request summary

Is it advisable to use the children prop in the args object of the CSF format?
It's not mentioned anywhere in the docs or indeed anywhere on the web, I want to showcase how a component behaves with different children passed in. Just checking this is standard.

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/react 6.0.21

Screenshots / Screencast / Code Snippets (Optional)

export const Test = Template.bind({});
Test.args = {children:     <><Box>Test 1</Box></>}
@shilman
Copy link
Member

shilman commented Sep 25, 2020

It's an open issue here: #11429

@jonniebigodes
Copy link
Contributor

Closing this issue as mappings is now a feature that is available to Storybook users. If there's still an issue, please leave a comment in the issue mentioned above.

@good-idea
Copy link
Contributor

The docs for this are now here

// Replace your-renderer with the renderer you are using (e.g., react, vue3, angular, etc.)
import type { Meta } from '@storybook/your-renderer';

import { Example } from './Example';

const meta: Meta<typeof Example> = {
  component: Example,
  argTypes: {
    label: {
      options: ['Normal', 'Bold', 'Italic'],
      mapping: {
        Bold: <b>Bold</b>,
        Italic: <i>Italic</i>,
      },
    },
  },
};

export default meta;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants