diff --git a/packages/devui-vue/docs/en-US/components/button/index.md b/packages/devui-vue/docs/en-US/components/button/index.md new file mode 100644 index 0000000000..18bab2e6d6 --- /dev/null +++ b/packages/devui-vue/docs/en-US/components/button/index.md @@ -0,0 +1,280 @@ +# Button + +Button is used to start an instant operation. + +#### When To Use + +It marks (or encapsulates a group of) operation commands, responds to user clicks, and triggers corresponding business logic. + +### Basic Usage + +:::demo Use `variant` to set button shape. Three types are supported: `solid`, `outline` and `text`, default `outline`. + +```vue + +``` + +::: + +### Theme Color + +:::demo Use `color` to set `Button` theme color. Three types of theme colors are supported: `primary`, `secondary`, and `danger`.
Note: If the `variant` is set to `solid`, the `primar` theme color will be used by default. + +```vue + +``` + +::: + +### Size + +:::demo Use `size` to set `Button` size. Three types of sizes are supported: `sm`, `md`, and `lg`, default `md`. + +```vue + +``` + +::: + +### Disabled + +:::demo Use the `disabled` parameter to set the status of the button to Disabled. + +```vue + +``` + +::: + +### Loading + +:::demo Use the `loading` parameter to set the status of the button to Loading. + +```vue + + +``` + +::: + +### Icon + +:::demo + +```vue + +``` + +::: + +### Button group + +Buttons can be grouped. The size of the button group can be set by `size` and mixed with the dropdown menu. +:::demo + +```vue + + +``` + +::: + +### Button Props + +| Parameter | Type | Default | Description | Jump to Demo | +| :------- | :-------------------------------- | :---------- | :------------------------ | :------------------------ | +| variant | [IButtonVariant](#ibuttonvariant) | 'outline' | Optional. Button style. | [Basic Usage](#basic-usage) | +| color | [IButtonColor](#ibuttoncolor) | 'secondary' | Optional. Button theme. | [theme color](#theme-color) | +| size | [IButtonSize](#ibuttonsize) | 'md' | Optional. Button size. | [size](#size) | +| icon | `string` | -- | Optional. Customize icons in buttons. | [icon](#icon) | +| shape | [IButtonShape](#ibuttonshape) | -- | Optional. Button shape(round/rounded). | [shape](#icon) | +| disabled | `boolean` | false | Optional. Disable button. | [disabled](#disabled) | +| loading | `boolean` | false | Optional. Set status in loading. | [loading](#loading) | + +### Button TypeDefine + +#### IButtonVariant + +```ts +type IButtonVariant = 'solid' | 'outline' | 'text'; +``` + +#### IButtonSize + +```ts +type IButtonSize = 'lg' | 'md' | 'sm'; +``` + +#### IButtonColor + +```ts +type IButtonColor = 'primary' | 'secondary' | 'danger'; +``` + +#### IButtonShape + +```ts +type IButtonShape = 'circle' | 'round'; +``` + +### ButtonGroup Props + +| Parameter | Type | Default | Description | Jump to Demo | +| :----- | :------------------------------- | :--- | :--------------- | :---------------- | +| size | [IButtonSize](#iButtonGroupSize) | 'md' | Optional. Button group size. | [button group](#button-group) | + +### ButtonGroup TypeDefine + +#### IButtonGroupSize + +```ts +type IButtonGroupSize = 'lg' | 'md' | 'sm'; +```