diff --git a/pages/en-us/components/button.mdx b/pages/en-us/components/button.mdx index 84eb06d..5c4c110 100644 --- a/pages/en-us/components/button.mdx +++ b/pages/en-us/components/button.mdx @@ -1,6 +1,10 @@ import { Layout, Playground, Attributes } from 'lib/components' import { Button, Spacer } from 'components' import Router from 'next/router' +import Settings from '@zeit-ui/react-icons/settings' +import UserX from '@zeit-ui/react-icons/userX' +import Power from '@zeit-ui/react-icons/power' + export const meta = { title: 'button', @@ -11,7 +15,6 @@ export const meta = { Used to trigger an operation. - `} /> + + + + + + + + + + + + + +`} /> + Button.Props | Attribute | Description | Type | Accepted values | Default | ---------- | ---------- | ---- | -------------- | ------ | -| **type** | button type | `ButtonTypes` | `'default', 'secondary', 'success', 'warning', 'error', 'abort'` | `default` | -| **size** | button size | `NormalSizes` | `'mini', 'small', 'medium', 'large'` | `medium` | +| **type** | button type | `ButtonTypes` | [ButtonTypes](#buttontypes) | `default` | +| **size** | button size | `NormalSizes` | [NormalSizes](#normalsizes) | `medium` | | **ghost** | the opposite color | `boolean` | - | `false` | | **loading** | display loading indicator | `boolean` | - | `false` | | **shadow** | display shadow | `boolean` | - | `false` | | **auto** | autoscale width | `boolean` | - | `false` | | **effect** | display animation | `boolean` | - | `true` | | **disabled** | disable button | `boolean` | - | `false` | +| **icon** | show icon in button | `ReactNode` | - | - | +| **iconRight** | show icon on the other side of the button | `ReactNode` | - | - | | **onClick** | click handler | `MouseEventHandler` | - | - | -| ... | native props | `ButtonHTMLAttributes` | `'autoFocus', 'name', 'className', ...` | - | +| ... | native props | `ButtonHTMLAttributes` | `'id', 'className', ...` | - | + +ButtonTypes + +```ts +type ButtonTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error' | 'abort' +``` + +NormalSizes + +```ts +type NormalSizes = 'mini' | 'small' | 'medium' | 'large' +``` diff --git a/pages/zh-cn/components/button.mdx b/pages/zh-cn/components/button.mdx index 8fa6934..9c1ce7f 100644 --- a/pages/zh-cn/components/button.mdx +++ b/pages/zh-cn/components/button.mdx @@ -1,6 +1,9 @@ import { Layout, Playground, Attributes } from 'lib/components' import { Button, Spacer } from 'components' import Router from 'next/router' +import Settings from '@zeit-ui/react-icons/settings' +import UserX from '@zeit-ui/react-icons/userX' +import Power from '@zeit-ui/react-icons/power' export const meta = { title: '按钮 Button', @@ -85,13 +88,33 @@ export const meta = { `} /> + + + + + + + + + + + + + +`} /> + Button.Props | 属性 | 描述 | 类型 | 推荐值 | 默认 | ---------- | ---------- | ---- | -------------- | ------ | -| **type** | 按钮的类型 | `ButtonTypes` | `'default', 'secondary', 'success', 'warning', 'error', 'abort'` | `default` | -| **size** | 按钮的大小 | `NormalSizes` | `'mini', 'small', 'medium', 'large'` | `medium` | +| **type** | 按钮的类型 | `ButtonTypes` | [ButtonTypes](#buttontypes) | `default` | +| **size** | 按钮的大小 | `NormalSizes` | [NormalSizes](#normalsizes) | `medium` | | **ghost** | 是否为反色按钮 | `boolean` | - | `false` | | **loading** | 是否显示加载中的指示器 | `boolean` | - | `false` | | **shadow** | 是否显示阴影 | `boolean` | - | `false` | @@ -99,7 +122,21 @@ export const meta = { | **effect** | 是否显示动画效果 | `boolean` | - | `true` | | **disabled** | 是否禁用按钮 | `boolean` | - | `false` | | **onClick** | 点击事件 | `MouseEventHandler` | - | - | -| ... | 原生属性 | `ButtonHTMLAttributes` | `'autoFocus', 'name', 'className', ...` | - | +| **icon** | 在按钮内显示图标 | `ReactNode` | - | - | +| **iconRight** | 在按钮的另一侧显示图标 | `ReactNode` | - | - | +| ... | 原生属性 | `ButtonHTMLAttributes` | `'id', 'className', ...` | - | + +ButtonTypes + +```ts +type ButtonTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error' | 'abort' +``` + +NormalSizes + +```ts +type NormalSizes = 'mini' | 'small' | 'medium' | 'large' +```