Button
Displays a button or a component that looks like a button.
Component Features
- 🎨 8 Visual Variants: Supports
solid,outline,ghost,soft,link,subtle,dashed,default. - 🌈 Multiple Colors: Supports
default,primary,secondary,success,warning,danger,info,carbon. - 📏 Multiple Sizes: Supports
xs,sm,md,lg,xl,2xl,defaultsize specs. - 🖼️ Icon Support:
prefixandsuffixslots for icons,leftandrighticon positions. - ⏳ Loading State: Supports
loadingprop to display loading animation. - ❌ Disabled State: Supports
disabledprop. - 🔄 Rounded Styles: Supports
rounded,rounded-sm,rounded-md,rounded-lg,rounded-xl,rounded-full. - 🎨 Theme Customization: Based on
BrConfigProviderfor global theming and TailwindCSS local overrides.
Basic Usage
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
Colors
Use the color prop to control the color theme of the button.
Sizes
Use the size prop to control the size of the button.
With Icons
You can add icons using the prefix or suffix slots, or by combining them in the default slot.
Loading State
Set the loading prop to true to show a loading state.
Disabled State
Set the disabled prop to disable the button.
Rounded
Set the rounded prop to true for a fully rounded (pill) style.
Theming
Global Customization (BrConfigProvider)
You can override default CSS variables via the theme prop of BrConfigProvider.
Local Customization (TailwindCSS)
You can directly override styles using TailwindCSS utility classes.