Skip to content

Button

Use type, plain, round and circle to define button styles.

Button Type

Use the type attribute to define different button styles.

<script setup>
import Button from '@/components/Button/Button.vue'
</script>

<template>
  <div class="demo-button">
    <Button>Default</Button>
    <Button type="primary">Primary</Button>
    <Button type="success">Success</Button>
    <Button type="warning">Warning</Button>
    <Button type="danger">Danger</Button>
    <Button type="info">Info</Button>
  </div>
</template>

<style scoped>
.demo-button .es-button + .es-button {
  margin-left: 12px;
}
</style>

Button Size

Use the size attribute to define button size.

<script setup>
import Button from '@/components/Button/Button.vue'
</script>

<template>
  <div class="demo-button">
    <Button size="large">Large</Button>
    <Button>Default</Button>
    <Button size="small">Small</Button>
  </div>
</template>
<style scoped>
.demo-button .es-button + .es-button {
  margin-left: 12px;
}
</style>

Plain Button

Use the plain attribute to define a plain button.

<script setup>
import Button from '@/components/Button/Button.vue'
</script>

<template>
  <div class="demo-button">
    <Button plain>Plain</Button>
    <Button type="primary" plain>Primary</Button>
    <Button type="success" plain>Success</Button>
    <Button type="warning" plain>Warning</Button>
    <Button type="danger" plain>Danger</Button>
    <Button type="info" plain>Info</Button>
  </div>
</template>

<style scoped>
.demo-button .es-button + .es-button {
  margin-left: 12px;
}
</style>

Round Button

Use the round attribute to define a round button.

<script setup>
import Button from '@/components/Button/Button.vue'
</script>

<template>
  <div class="demo-button">
    <Button round>Round</Button>
    <Button type="primary" round>Primary</Button>
    <Button type="success" round>Success</Button>
    <Button type="warning" round>Warning</Button>
    <Button type="danger" round>Danger</Button>
    <Button type="info" round>Info</Button>
  </div>
</template>

<style scoped>
.demo-button .es-button + .es-button {
  margin-left: 12px;
}
</style>

Circle Button

Use the circle attribute to define a circle button.

<script setup>
import Button from '@/components/Button/Button.vue'
</script>

<template>
  <div class="demo-button">
    <Button circle>D</Button>
    <Button type="primary" circle>P</Button>
    <Button type="success" circle>S</Button>
    <Button type="warning" circle>W</Button>
    <Button type="danger" circle>D</Button>
    <Button type="info" circle>I</Button>
  </div>
</template>

<style scoped>
.demo-button .es-button + .es-button {
  margin-left: 12px;
}
</style>

Disabled

Use the disabled attribute to define whether a button is disabled.

<script setup>
import Button from '@/components/Button/Button.vue'
</script>

<template>
  <div class="demo-button">
    <Button disabled>Disabled</Button>
    <Button type="primary" disabled>Primary</Button>
    <Button type="success" disabled>Success</Button>
    <Button type="warning" disabled>Warning</Button>
    <Button type="danger" disabled>Danger</Button>
    <Button type="info" disabled>Info</Button>
  </div>
</template>

<style scoped>
.demo-button .es-button + .es-button {
  margin-left: 12px;
}
</style>

Button Attributes

NameDescriptionTypeDefault
sizebutton size'large' | 'small'
typebutton type'primary' | 'success' | 'warning' | 'danger' | 'info'
plaindetermine whether it's a plain buttonbooleanfalse
rounddetermine whether it's a round buttonbooleanfalse
circledetermine whether it's a circle buttonbooleanfalse
disableddisable the buttonbooleanfalse
autofocussame as native button's autofocusbooleanfalse
nativetypesame as native button's type'button' | 'submit' | 'reset'button