Skip to content

Contained List

Last updated 25 Nov 2026

NbContainedList is a list for a small space: a panel, a tile, an aside, a disclosure. Each row is a key, a title, one line under it and something at the end. It is the row a product otherwise writes by hand, once per screen.

A list in a panel ​

The list takes the panel's title as its own, or the panel takes a title and the list goes without one. Do not give both: two titles for one list is the doubled heading the hierarchy rules are there to stop.

vue
<NbPanel>
  <NbContainedList title="Due this week">
    <template #actions>
      <NbButton size="sm" variant="ghost" icon="plus" aria-label="Add" />
    </template>
    <NbContainedListItem
      v-for="task in tasks"
      :key="task.id"
      :item-key="task.key"
      :title="task.title"
      :line="task.owner"
      :to="{ name: 'task', params: { id: task.id } }"
    >
      <template #trailing>{{ task.due }}</template>
    </NbContainedListItem>
  </NbContainedList>
</NbPanel>

Selecting in place ​

vue
<NbContainedList aria-label="Projects" size="sm">
  <NbContainedListItem
    v-for="project in projects"
    :key="project.id"
    :title="project.name"
    clickable
    :current="project.id === openId"
    @select="openId = project.id"
  />
</NbContainedList>

A line that wraps ​

line-clamp lets the line under the title wrap onto more lines before it ends in an ellipsis. Keep the default, one line, for a list people scan. Raise it for text people read, such as the matching passage of a search result, where one line cuts the match off. The #line slot keeps its inline markup, so a highlighted match stays highlighted, and the row keeps its padding and its whole-row target as it grows.

vue
<NbContainedListItem :title="hit.title" :href="hit.url" :line-clamp="3">
  <template #line>
    <span v-html="hit.highlightedExcerpt" />
  </template>
</NbContainedListItem>

Titles that wrap ​

wrap lets the title and the line under it take as many lines as they need, for names that lose their point when they are cut: a file path, a finding, a sentence. A long unbroken token, such as a path, breaks anywhere rather than pushing the row wider. Set it on the list for every row, or on one item. An item's own wrap wins over the list's, so :wrap="false" keeps one row to a line in a list that wraps. A line-clamp above 1 still caps the line. The default stays one line each, for a list people scan.

vue
<NbContainedList title="Changed files" wrap>
  <NbContainedListItem
    v-for="file in files"
    :key="file.path"
    :title="file.path"
    :line="file.summary"
  />
</NbContainedList>

NbContainedList props ​

PropTypeDefaultDescription
titlestringundefinedThe list's title. Renders the header, and names the list for a screen reader.
headingLevel'h1' to 'h6''h3'The element the title renders as.
size'sm' | 'md' | 'lg''md'Row height: 32, 40 or 48px.
maxHeightstringundefinedCap the height and scroll, with the header sticky above the rows.
ariaLabelstringundefinedThe list's accessible name when it has no title.
wrapbooleanfalseEvery row's title and line wrap instead of ending in an ellipsis.

NbContainedList slots ​

SlotDescription
defaultNbContainedListItems.
metaBeside the title: a count, an NbInfoHint. Renders the header.
actionsAt the end of the header: ghost icon buttons. Renders the header.

NbContainedListItem props ​

PropTypeDefaultDescription
titlestringundefinedThe row's name. The default slot replaces it.
itemKeystringundefinedA short identifier before the title, mono and subtle. Not key: Vue reserves it.
linestringundefinedOne line of context under the title.
lineClampnumber1How many lines line may wrap onto before it ends in an ellipsis.
wrapbooleanthe list'sThe title and the line wrap in full. Unset, the row follows the list's wrap.
tostring | objectundefinedTarget route. A <RouterLink> with vue-router, a plain link for a string without it.
hrefstringundefinedRenders the row as a link.
targetstringundefinedLink target. _blank also sets rel="noopener".
clickablebooleanfalseThe row is a button and emits select. Ignored with to or href.
currentbooleanfalseThe current row. Sets aria-current.
disabledbooleanfalseInert and muted.

NbContainedListItem events ​

EventPayloadDescription
selectMouseEvent | KeyboardEventThe row was activated by a click, Enter or Space. clickable only.

NbContainedListItem slots ​

SlotDescription
defaultReplaces title.
lineReplaces line.
leadingBefore everything: an avatar, an icon, a dot.
trailingAt the end: one badge or a count.