Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
Change Storybook Control label to a different name

I have a custom button component and some basic controls for the following prop; button kind, size, and children (button text).

The controls are working as intended. However, I like to change the control naming from "children" to "label".

How would I go about accomplishing this?

Thanks!

enter image description here

export default {
  title: 'Components/Button',
  component: Button,
  argTypes: {
     kind: {
      options: ['primary', 'secondary', 'tertiary', 'danger', 'ghost'],
      control: { type: 'select' }
    },
    size: {
      options: ['default', 'sm', 'md', 'lg'],
      control: { type: 'select'},
    },
    },
};

const Template = (args) => <Button {...args} />;

export const Buttons = Template.bind({});
Buttons.args = {
  kind: 'primary',
  children: 'Button',

};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Almost there, within argTypes you need to enter the interested field, children, and set the custom name to be displayed on your story's control panel

export default {
  title: 'Components/Button',
  component: Button,
  argTypes: {
    // ...your previous code
    children: {
      name: "Label", // <---------
    },
  },
};

// ...your previous code

Buttons.args = {
  children: 'Button',
};

Result in one of my projects

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!