2.5.2

List

List Component in Bolt

Published

History
View changes
Install
yarn add @bolt/components-list
Source code
View on Github
Dependencies

Minimal list component for laying out a group of items. Part of the Bolt “Components” CSS framework that powers the Bolt Design System.

Install via NPM
npm install @bolt/components-list
  {% include "@bolt-components-list/list.twig" with {
  display: "inline",
  spacing: "xsmall",
  align: "start",
  valign: "center",
  items: [
    "Item 1",
    include("@bolt-components-link/link.twig", {
      text: "Item 2",
      url: "#!",
    }),
    include("@bolt-components-chip/chip.twig", {
      text: "Item 3",
      url: "#!",
    }),
    include("@bolt-components-button/button.twig", {
      text: "Item 4",
      url: "#!",
      size: "small",
    }),
    "Item 5",
  ]
} only %}

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)
attributes

A Drupal-style attributes object with extra attributes to append to this component.

object
items *

All items can be simple text or items.

array
tag

Apply the semantic tag for the list.

string ul
  • ul, ol, div, span
display

Display either an inline list of items or a block (stacked) list of items. Responsive options are also available for transforming from block to inline at specific breakpoints.

string block
  • block, flex, inline, inline@xxsmall, inline@xsmall, inline@small, inline@medium
spacing

Control the spacing in between items.

string xsmall
  • none, xxsmall, xsmall, small, medium, large, xlarge
separator

Display a separator in between items.

string none
  • none, solid, dashed
inset

Turn spacing to the inside of each item.

boolean false
  • true or false
align

Control the horizontal alignment of items.

string start
  • start, center, end
valign

Control the vertical alignment of items.

string center
  • start, center, end