mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 13:31:19 +08:00
📝 Update Knobs addon documentation for Ember (#8977)
📝 Update Knobs addon documentation for Ember
This commit is contained in:
commit
9aa1358c9f
@ -128,7 +128,29 @@ stories.add('with a button', () => ({
|
||||
text: text('text', 'Hello Storybook'), // The first param of the knob function has to be exactly the same as the component input.
|
||||
},
|
||||
}));
|
||||
```
|
||||
|
||||
### With Ember
|
||||
```js
|
||||
import { withKnobs, text, boolean } from '@storybook/addon-knobs';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
|
||||
export default {
|
||||
title: 'StoryBook with Knobs',
|
||||
decorators: [withKnobs],
|
||||
};
|
||||
|
||||
export const button = () => {
|
||||
return {
|
||||
template: hbs`
|
||||
<button disabled={{disabled}}>{{label}}</button>
|
||||
`,
|
||||
context: {
|
||||
label: text('label', 'Hello Storybook'),
|
||||
disabled: boolean('disabled', false),
|
||||
},
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
Categorize your Knobs by assigning them a `groupId`. When a `groupId` exists, tabs will appear in the Knobs storybook panel to filter between the groups. Knobs without a `groupId` are automatically categorized into the `ALL` group.
|
||||
|
Loading…
x
Reference in New Issue
Block a user