# Button ### Install ```js import Vue from 'vue'; import { Button } from 'vant'; Vue.use(Button); ``` ## Usage ### Type ```html Default Primary Info Danger Warning ``` ### Plain ```html Primary Danger ``` ### Hairline ```html Hairline Hairline ``` ### Disabled ```html Diabled Diabled ``` ### Loading ```html ``` ### Shape ```html Square Round ``` ### Icon ```html Button Button ``` ### Size ```html Large Normal Small Mini ``` ### Block Element ```html Block Element ``` ### Route ```html URL Vue Router ``` ### Custom Color ```html Pure Pure Gradient ``` ## API ### Props | Attribute | Description | Type | Default | | --- | --- | --- | --- | | type | Can be set to `primary` `info` `warning` `danger` | _string_ | `default` | | size | Can be set to `large` `small` `mini` | _string_ | `normal` | | text | Text | _string_ | - | | color `v2.1.8` | Color, support linear-gradient | _string_ | - | | icon | Left Icon | _string_ | - | | icon-prefix `v2.6.0` | Icon className prefix | _string_ | `van-icon` | | tag | HTML Tag | _string_ | `button` | | native-type | Native Type Attribute | _string_ | `''` | | plain | Whether to be plain button | _boolean_ | `false` | | block | Whether to set display block | _boolean_ | `false` | | round | Whether to be round button | _boolean_ | `false` | | square | Whether to be square button | _boolean_ | `false` | | disabled | Whether to disable button | _boolean_ | `false` | | loading | Whether show loading status | _boolean_ | `false` | | loading-text | Loading text | _string_ | - | | loading-type | Loading type, can be set to `spinner` | _string_ | `circular` | | loading-size | Loading icon size | _string_ | `20px` | | url | Link URL | _string_ | - | | to | Target route of the link, same as to of vue-router | _string \| object_ | - | | replace | If true, the navigation will not leave a history record | _boolean_ | `false` | ### Events | Event | Description | Arguments | | --- | --- | --- | | click | Triggered when click button and not disabled or loading | _event: Event_ | | touchstart | Triggered when touch start | _event: TouchEvent_ |