-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5152a18
commit 74faadd
Showing
2 changed files
with
64 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Meta} from '@component-controls/storybook'; | ||
import { PropsTable, Playground, Story, ComponentSource, StorySource } from '@component-controls/blocks'; | ||
import { Button } from '../../../stories/src/components/Button'; | ||
|
||
<Meta title="Introduction/MDX Smart" parameters={{component: Button}} /> | ||
|
||
|
||
# Smart controls | ||
<ComponentSource of={Button} title='Component source' /> | ||
|
||
<Story id="." /> | ||
|
||
<StorySource id="." /> | ||
|
||
<PropsTable of={Button} /> | ||
|
||
|
||
<Playground> | ||
<Story name="smart story"> | ||
{(props) => ( | ||
<Button label="default" {...props}/> | ||
)} | ||
</Story> | ||
</Playground> | ||
|
||
|
||
# Small story with custom controls | ||
|
||
<Playground> | ||
<Story name="small story" | ||
controls={{ | ||
text: {type: 'text', value: 'Hello'}, | ||
}} | ||
> | ||
{({ text }) => ( | ||
<Button label={text}/> | ||
)} | ||
</Story> | ||
</Playground> | ||
|
||
# Story with no parameters == no smart controls | ||
|
||
<Playground> | ||
<Story name="no controls"> | ||
<Button label="Hello"/> | ||
<Button label="Second button"/> | ||
</Story> | ||
</Playground> |