mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-12 22:29:35 +08:00
64 lines
1.4 KiB
Plaintext
64 lines
1.4 KiB
Plaintext
import { Layout, Playground, Attributes } from 'lib/components'
|
|
import { Keyboard } from 'components'
|
|
|
|
export const meta = {
|
|
title: 'keyboard',
|
|
description: 'tenotext',
|
|
}
|
|
|
|
## Keyboard
|
|
|
|
Display keyboard input that triggers an action.
|
|
|
|
<Playground
|
|
scope={{ Keyboard }}
|
|
code={`
|
|
<Keyboard>f</Keyboard>
|
|
`} />
|
|
|
|
<Playground
|
|
title="modifiers"
|
|
scope={{ Keyboard }}
|
|
code={`
|
|
<div>
|
|
<Keyboard command />
|
|
<Keyboard shift />
|
|
<Keyboard option />
|
|
<Keyboard ctrl />
|
|
</div>
|
|
`} />
|
|
|
|
<Playground
|
|
title="combination"
|
|
scope={{ Keyboard }}
|
|
code={`
|
|
<div>
|
|
<Keyboard command>f</Keyboard>
|
|
<Keyboard shift>e</Keyboard>
|
|
<Keyboard option ctrl>b</Keyboard>
|
|
</div>
|
|
`} />
|
|
|
|
<Playground
|
|
title="small"
|
|
scope={{ Keyboard }}
|
|
code={`
|
|
<Keyboard small>/</Keyboard>
|
|
`} />
|
|
|
|
<Attributes edit="/pages/docs/components/keyboard.mdx">
|
|
<Attributes.Title>Keyboard.Props</Attributes.Title>
|
|
|
|
| Attribute | Description | Type | Accepted values | Default
|
|
| ---------- | ---------- | ---- | -------------- | ------ |
|
|
| **command** | show command key | `boolean` | - | `false` |
|
|
| **shift** | show shift key | `boolean` | - | `false` |
|
|
| **option** | show option key | `boolean` | - | `false` |
|
|
| **ctrl** | show ctrl key | `boolean` | - | `false` |
|
|
| **small** | small keyboard size | `boolean` | - | `false` |
|
|
| ... | native props | `KeygenHTMLAttributes` | `'keyType', 'className', ...` | - |
|
|
|
|
</Attributes>
|
|
|
|
export default ({ children }) => <Layout meta={meta}>{children}</Layout>
|