{% include "@bolt-components-button/button.twig" with {
text: "This is a button"
} only %}
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal-style attributes object with extra attributes to append to this component. |
object
| — |
|
text
*
|
Text inside the button. |
string
| — |
|
transform
|
Transforms the button text to various cases. |
string
|
none
|
|
type
|
Determines the button tag type for semantic buttons |
string
| — |
|
size
|
Size of the button. |
string
|
medium
|
|
style
|
Style of the button determined by information hierarchy. |
string
|
primary
|
|
width
|
Controls the width of the button. |
string
|
auto
|
|
border_radius
|
Rounds the corners of the button. |
string
|
regular
|
|
align
|
Horizontal alignment of items (text and icon) inside the button. Note: the values left and right are deprecated, use start and end instead. |
string
|
center
|
|
icon
|
Icon data as expected by the icon component. Accepts an additional position prop that determines placement within the link. |
object
| — |
|
iconOnly
|
Make the button to display only the icon and hide the text (which is still required). You are required to pass both text and icon data for this option to work. |
boolean
|
false
|
|
url
|
If present, users will be directed to this URL when clicking this element. |
string
| — |
|
target
|
A valid HTML target attribute to modify the behavior when clicking this element. Only valid when "url" is also present. |
string
|
_self
|
|
disabled
|
Whether the click action should be disabled for this element. |
boolean
|
false
|
|
onClick
|
When used with onClickTarget, an event to fire on the targeted elements when this element is clicked. When used without onClickTarget, arbitrary javascript to execute when this element is clicked. |
string
| — |
|
onClickTarget
|
Requires onClick. A CSS selector for elements that the onClick event will fire on when this element is clicked. |
string
| — |
|
itemAlignment
(deprecated) |
Use the align parameter instead. |
— | — |
|
rounded
(deprecated) |
Use the border_radius parameter instead. |
— | — |
|
tag
(deprecated) |
Switch to using the new type prop instead. |
string
|
button
|
|
npm install @bolt/components-button