Overview
Stylistic block layout for displaying actionable icon and text. Part of the Bolt “Components” CSS framework that powers the Bolt Design System.
Install via NPM
npm install @bolt/components-action-blocks
Description
Action blocks work as a group to provide the user an easy to browse list of options of relativeto take action to discover more information. They commonly exist as links to more detailed content.
Best Practices
- Can use xlight, light, dark, and xdark themes.
- Can have an image, icon, and/or text
- Should link to content
- Should be limited to 7 (soft limit) unless we're representing a large list of content that is meant to be scanned
- Can wrap to many rows
- Top aligned by default
- Can be vertically centered
- Are set with a border by default
- Can be borderless
Usage
{% include "@bolt-components-action-blocks/action-blocks.twig" with {
contentItems: [
{
text: "Item 1",
url: "#!",
icon: {
name: "icon-name",
size: "large",
background: "circle"
}
},
{
text: "Item 2",
url: "#!",
icon: {
name: "icon-name",
size: "large",
background: "circle"
}
},
{
text: "Item 3",
url: "#!",
icon: {
name: "icon-name",
size: "large",
background: "circle"
}
}
]
} only %}
Schema
Note: when assigning component props as HTML attributes on a web component, make sure to use kebab-case
.
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
|
A Drupal-style attributes object with extra attributes to append to this component. |
object
| — |
|
|
The max amount of items (action blocks) to be displayed in one row. |
number
|
6
|
|
|
Vertical alignment of the content inside each action block. |
string
|
start
|
|
|
Removes the border in between each action block. |
boolean
|
false
|
|
|
Content items to populate the action blocks. |
array
| — |
|
|
Use max_items_per_row prop instead. |
| — |
|
|
Use valign prop instead. |
| — |
|
|
Use borderless prop instead. |
| — |
|