- Blade Components
- Docs
- Components
- Button
Button
Primary control for any action, supporting both anchors and buttons.
Usage
<x-btn>Button</x-btn>
Component API
Attribute | Default | Description |
---|---|---|
style |
primary |
string Possible values primary , secondary , ghost , info , warning or danger . |
size |
null |
string || null Possible values null , sm , lg or xl . |
href |
null |
string || null When set, renders an <a> element instead of a <button> element. |
alignment |
center |
string Controls text alignment on the button label. Possible values left , center or right . |
disabled |
false |
bool Whether the button is disabled. |
Style
Control the button style by supplying the style=""
attribute.
Size
Control the button size by supplying the size=""
attribute.
Link
Buttons can be used as an <a>
element by supplying the href=""
attribute.
Disabled State
Both linked buttons and traditional buttons can be set to a disabled state by supplying the disabled
boolean attribute.
Prefix and Suffix
Buttons can be prefixed or suffixed with simple text elements for additional clarity by utilizing the prefix
and suffix
component slots.