Skip to content

Button

Displays a button or a component that looks like a button.

Basic Usage

Example

Variants

Use the variant prop to control the visual style of the button.

  • Solid: Default filled style.
  • Outline: Transparent border by default. Shows background on hover.
  • Plain: Bordered style with default text color. Changes to theme color on hover.
  • Pure: Completely unstyled (no padding, height, or border). Useful as a wrapper.
  • Dashed: Dashed border style.
  • Soft: Light background with theme text color.
  • Ghost: Transparent background that changes on hover.
  • Link: Text link style.

All Variants

Example

Colors

Use the color prop to control the color theme of the button.

Example

Sizes

Use the size prop to control the size of the button.

Example

With Icons

You can add icons using the prefix or suffix slots, or by combining them in the default slot.

Example

Loading State

Set the loading prop to true to show a loading state.

Example

Disabled State

Set the disabled prop to disable the button.

Example

Rounded

Set the rounded prop to true for a fully rounded (pill) style.

Example

Theming

Global Customization (BrConfigProvider)

You can override default CSS variables via the theme prop of BrConfigProvider.

Example

Local Customization (TailwindCSS)

You can directly override styles using TailwindCSS utility classes.

vue
<template>
  <BrButton class="bg-indigo-500 hover:bg-indigo-600">Custom Class</BrButton>
</template>

API

Props

NameTypeDefaultDescription
variantstring'solid'Visual style variants: solid, outline, dashed, soft, ghost, link, plain, pure
colorstring'default'Color theme variants: default, primary, secondary, success, warning, danger, info, carbon, accent
sizestring'default'Size variants: default, xs, sm, md, lg, xl, 2xl, icon
asstring'button'The HTML tag or component to render
disabledbooleanfalseWhether the button is disabled
loadingbooleanfalseWhether to show loading state
roundedbooleanfalseWhether to use full rounded style
typestring'button'Native type attribute

Slots

NameDescription
defaultButton content
prefixContent before the default content (e.g., icon)
suffixContent after the default content (e.g., icon)

Emits

NameDescriptionParameters
clickClick event(event: MouseEvent)