Skip to main content
Neighborhood Design System v5.1.0

List

Ready

A simple list component.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdList } from '@fbin-web/neighborhood-core';
Usage
<nbhd-list>
  <nbhd-text
    variant="subtitle"
    tag="h4"
    slot="title">
    Category
  </nbhd-text>

  <nbhd-link
    class="list-item--link"
    slot="item"
    href="/link1">
    Link 1
  </nbhd-link>

  <nbhd-text
    class="list-item--text"
    tag="div"
    slot="item">
    Link 2
  </nbhd-text>

  <nbhd-link
    class="list-item--link"
    slot="item"
    href="/link3">
    Link 3
  </nbhd-link>
</nbhd-list>

Properties

PropertyAttributeTypeDefaultDescription
dividerdividerbooleanfalseAdds a divider border at the bottom of the list and reflects to attribute.

Slots

Available slots for customizing list content:

NameDescription
titleOptional title content rendered above the list items.
itemList items. Each slotted item gets role="listitem" unless it already has a role.

CSS Parts

CSS parts that can be styled using the ::part() selector:

NameDescription
baseThe outer container for the complete list structure.
titleThe rendered title slot element when a title is provided.
itemsThe wrapper around the list item slot content.
list-itemThe list item slot element for each item rendered in the list.
nbhd-list::part(base) {
  /* your styles */
}

CSS Properties

Set these on nbhd-list or an ancestor to override the defaults. Token is the design token a default comes from and Value is what it resolves to in core Neighborhood; brands may override them. Properties that adapt to surface follow the light or inverse surface they sit on until you set them.

PropertyTokenValue Copy
--nbhd-list-borderBottomColor--nbhd-context-color-interactive-defaultAdapts to surface
--nbhd-list-borderBottomStyle—solid
--nbhd-list-borderBottomWidth--nbhd-border-width-none0
--nbhd-list-display—block
--nbhd-list-divider--nbhd-border-width-subtle1px
--nbhd-list-host-display—block
--nbhd-list-item-display—block
--nbhd-list-item-marginBlock--nbhd-space-0 --nbhd-space-10px 4px
--nbhd-list-item-textAlign—start
--nbhd-list-items-marginBlock--nbhd-space-00px
--nbhd-list-items-paddingBlock--nbhd-space-0 --nbhd-space-20px 8px
--nbhd-list-marginBlock--nbhd-space-0 --nbhd-space-40px 16px
--nbhd-list-paddingBlock--nbhd-space-00px
--nbhd-list-paddingInline--nbhd-space-00px
--nbhd-list-title-marginBlock--nbhd-space-14px
--nbhd-list-title-textTransform—uppercase

Dependencies

Used by

Esc
↑ ↓ to move↵ to open