mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-07 22:41:59 +08:00
docs(snippet): add docs for custom symbol and toast
This commit is contained in:
@@ -60,6 +60,20 @@ Display a snippet of copyable code for the command line.
|
||||
<Snippet copy="prevent" text="yarn add @zeit-ui/react" width="300px" />
|
||||
`} />
|
||||
|
||||
<Playground
|
||||
title="custom symbol"
|
||||
scope={{ Snippet }}
|
||||
code={`
|
||||
<Snippet symbol=">" text="yarn add @zeit-ui/react" width="300px" />
|
||||
`} />
|
||||
|
||||
<Playground
|
||||
title="custom toast"
|
||||
scope={{ Snippet }}
|
||||
code={`
|
||||
<Snippet toastText="Code copied!" toastType="secondary" text="yarn add @zeit-ui/react" width="300px" />
|
||||
`} />
|
||||
|
||||
<Playground
|
||||
title="filled"
|
||||
scope={{ Snippet, Spacer }}
|
||||
@@ -85,6 +99,9 @@ Display a snippet of copyable code for the command line.
|
||||
| **filled** | filled style | `boolean` | - | `false` |
|
||||
| **width** | set CSS string | `string` | - | `initial` |
|
||||
| **copy** | function of copy button | `CopyTypes` | `'default', 'slient', 'prevent'` | `default` |
|
||||
| **symbol** | symbol snippet | `string` | - | `$` |
|
||||
| **toastText** | toast text | `string` | - | `Copied to clipboard!` |
|
||||
| **toastType** | toast type | `NormalTypes` | `'default', 'secondary', 'success', 'warning', 'error'` | `success` |
|
||||
| ... | native props | `HTMLAttributes` | `'id', 'name', 'className', ...` | - |
|
||||
|
||||
<Attributes.Title>SnippetTypes</Attributes.Title>
|
||||
|
||||
Reference in New Issue
Block a user