{% set _content %}
{% include '@bolt-components-floating-action-buttons/floating-action-buttons-item.twig' with {
content: _fabItem,
} only %}
{% endset %}
{% include '@bolt-components-floating-action-buttons/floating-action-buttons.twig' with {
content: _content,
} only %}
kebab-case
.
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal attributes object. Applies extra HTML attributes to the <bolt-floating-action-buttons> tag. |
object
| — |
|
content
|
The main content. Typically, this will be a number of icon-only buttons. |
any
| — |
|
position
|
The desired location of the floating element. |
string
|
bottom-right
|
|
visible_items
|
The number of items visisble when a "more" button is needed. It can be set to 0 to turn off the button. |
number
|
2
|
|
show_on_load
|
Please leave this set to true unless you plan on adding javascript to show the element yourself. |
boolean
|
true
|
|
show_on_scroll
|
This will leave the element hidden until the page is scrolled to a certain position. A percentage or px value must be passed here as a string. ie. "200px" or "20%". |
string
| — |
|
npm install @bolt/components-floating-action-buttons
bottom-right
.visible_items
value of 2
.{% set _item_visible %}
{% include '@bolt-elements-button/button.twig' with {
content: 'This is a button',
} only %}
{% endset %}
{% set _item_hidden %}
{% include '@bolt-elements-button/button.twig' with {
content: 'This is a button',
hierarchy: 'secondary'
} only %}
{% endset %}
{% set _content %}
{% include '@bolt-components-floating-action-buttons/floating-action-buttons-item.twig' with {
content: _item_visible,
} only %}
{% include '@bolt-components-floating-action-buttons/floating-action-buttons-item.twig' with {
content: _item_hidden,
} only %}
{% endset %}
{% include '@bolt-components-floating-action-buttons/floating-action-buttons.twig' with {
content: _content,
} only %}
visible_items
property can be used to hide an overflow of elements passed into content
.
visible_items
is 2
visible_items
to 0
to allow all elements to be shown.{% include '@bolt-components-floating-action-buttons/floating-action-buttons.twig' with {
content: _content,
visible_items: 0,
} only %}
bottom-right
, middle-right
, or top-right
.
{% include '@bolt-components-floating-action-buttons/floating-action-buttons.twig' with {
content: _content,
position: 'top-right',
} only %}
position
is set to top-right
, the Floating Action Buttons will move down.position
is set to bottom-right
, the Floating Action Buttons will move up.{% include '@bolt-components-floating-action-buttons/floating-action-buttons.twig' with {
content: _content,
attributes: {
style: '--c-bolt-floating-action-buttons-offset-x: 100px;'
}
} only %}