le0pard / storybook-addon-root-attribute

Storybook addon, which provide ability to change html, body or some element attribute
https://storybook-addon-root-attribute.leopard.in.ua
MIT License
18 stars 6 forks source link

Can we set title to the Root Attribute tab in Storybook panel? #25

Open Amarnath510 opened 1 year ago

Amarnath510 commented 1 year ago

Thanks for creating this beautiful addon.

One use case, Root attribute tab gets added to the Storybook panel but there is no way I could set the title for it. As per the code in function.js the title seems to be hard coded.

Can we add functionality to pass title to rootAttribute param in addParameters api as below?

// config.js

addParameters({
  rootAttribute: {
    title: 'My Specific title', /* Like this */
    defaultState: {
      name: "Disabled",
      value: null
    },
    states: [
      {
        name: "Enabled",
        value: "custom-class"
      }
    ]
  }
});

Or is there any other way where I can set title to the tab in storybook?

Version I am using: "storybook-addon-root-attribute": "^1.0.2"

le0pard commented 1 year ago

@Amarnath510 yep, it is hard coded. You can create PR to allow to change this