IBM Carbon JS behaviour

Contained List

A list that is its own container — header, actions and sections inside one flat frame, row by row interactive; Carbon’s answer to grouped settings lists.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

A list that is its own container

Header, action and rows live inside one flat frame — nothing floats outside it. The search box in the header live-filters the members below.

Members

No member matches — the frame stays up, only the rows leave.

4 of 4 members

Sections, switches, one frame

The contained list is Carbon’s answer to grouped settings: section titles band across the frame and every row is a working control.

Security & notifications

The whole family

Default, inset and the two compact sizes — the frame never changes, only the rhythm does.

Reports
default
Reports
inset
Reports
sm
Reports
lg

Important props

Important props
Prop Type Default What it does
label string required The header sits inside the frame, not above it — exactly what makes it contained.
action slot null Room for one icon button in the header — search, add or filter.
isInset boolean false With inset, the row hover reaches the frame edge and paints the gutters too.

Snippet

<div class="cbcl">
<header class="cbcl-head">
<b>Team members</b>
<button aria-label="Add member">+</button>
</header>
<ul>
<li><button>Selin Aydin — Owner</button></li>
<li><button>Milan Weber — Developer</button></li>
</ul>
</div>

<style>
.cbcl { border: 1px solid #e0e0e0; background: #fff; font: 400 .875rem/1.4 'IBM Plex Sans'; }
.cbcl-head { display: flex; align-items: center; justify-content: space-between;
padding: .75rem 1rem; border-block-end: 1px solid #e0e0e0; }
.cbcl li + li { border-block-start: 1px solid #e0e0e0; }
.cbcl li button { inline-size: 100%; padding: .75rem 1rem; border: none;
background: transparent; text-align: start; cursor: pointer; }
.cbcl li button:hover { background: #e8e8e8; }
</style>
// app/Pages/Members.jsx — Inertia page; renders the React snippet
// below unchanged, with Inertia's Link wired into the provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import MembersList from '@/components/MembersList';

export default function Members() {
  return (
    <NabuXUIProvider locale="en" linkComponent={Link}>
      <main className="nx-page">
        <MembersList />
      </main>
    </NabuXUIProvider>
  );
}
// MembersList.jsx — Carbon contained list: header, action and rows in one frame
import { useState } from 'react';
import '@nabuxai/ui-core/css';

const MEMBERS = [
  { name: 'Lena Fischer', role: 'Owner', tone: 'green', state: 'Owner' },
  { name: 'Marco Ricci', role: 'Developer', tone: 'blue', state: 'Active' },
  { name: 'Aylin Demir', role: 'Support', tone: 'blue', state: 'Active' },
  { name: 'Jonas Weber', role: 'Billing', tone: 'gray', state: 'Invited' },
];

export default function MembersList() {
  const [q, setQ] = useState('');
  // The header search live-filters; the frame itself never moves.
  const filtered = MEMBERS.filter((m) =>
    `${m.name} ${m.role}`.toLowerCase().includes(q.trim().toLowerCase()));

  return (
    <>
      <style>{`
        .cbcl { max-inline-size: 24rem; border: 1px solid #e0e0e0; background: #f4f4f4;
                font: 400 .875rem/1.4 'IBM Plex Sans', sans-serif; }
        .cbcl-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
                     padding: .75rem 1rem; border-block-end: 1px solid #e0e0e0; }
        .cbcl-head b { font-weight: 600; }
        .cbcl-head input { block-size: 2rem; inline-size: 10rem; padding-inline: .625rem; border: none;
                           border-block-end: 1px solid #8d8d8d; background: transparent; font: inherit; }
        .cbcl-head input:focus-visible { outline: none; border-block-end: 2px solid #0f62fe; }
        .cbcl ul { margin: 0; padding: 0; list-style: none; }
        .cbcl li + li { border-block-start: 1px solid #e0e0e0; }
        .cbcl-row { inline-size: 100%; display: flex; align-items: center; gap: .75rem; padding: .6875rem 1rem;
                    border: none; border-block-end: 1px solid #e0e0e0; background: transparent; text-align: start;
                    cursor: pointer; font: inherit; }
        .cbcl-row:hover { background: #e8e8e8; }
        .cbcl-row small { font-size: .75rem; color: #525252; }
        .cbcl-tag { margin-inline-start: auto; padding: 0 .5rem; block-size: 1.5rem; display: inline-grid;
                    place-items: center; border: 1px solid; font-size: .75rem; }
        .cbcl-tag[data-tone='green'] { border-color: #24a148; color: #0e6027; }
        .cbcl-tag[data-tone='blue'] { border-color: #0f62fe; color: #0043ce; }
        .cbcl-tag[data-tone='gray'] { border-color: #8d8d8d; color: #525252; }
        .cbcl-foot { padding: .625rem 1rem; font-size: .75rem; color: #525252;
                     border-block-start: 2px solid #0f62fe; }
      `}</style>
      <div className="cbcl" role="group" aria-label="Workspace members">
        <header className="cbcl-head">
          <b>Members</b>
          <input type="search" value={q} onChange={(e) => setQ(e.target.value)}
            placeholder="Find a member" aria-label="Find a member" />
        </header>
        <ul>
          {filtered.map((m) => (
            <li key={m.name}>
              <button type="button" className="cbcl-row">
                <span>{m.name} <small>· {m.role}</small></span>
                <span className="cbcl-tag" data-tone={m.tone}>{m.state}</span>
              </button>
            </li>
          ))}
        </ul>
        {/* The frame stays up; only the rows leave. */}
        <div className="cbcl-foot" role="status">{filtered.length} of {MEMBERS.length} members</div>
      </div>
    </>
  );
}
<!-- MembersList.vue — Carbon contained list: header, action and rows in one frame -->
<script setup lang="ts">
import { computed, ref } from 'vue';
import '@nabuxai/ui-core/css';

const members = [
  { name: 'Lena Fischer', role: 'Owner', tone: 'green', state: 'Owner' },
  { name: 'Marco Ricci', role: 'Developer', tone: 'blue', state: 'Active' },
  { name: 'Aylin Demir', role: 'Support', tone: 'blue', state: 'Active' },
  { name: 'Jonas Weber', role: 'Billing', tone: 'gray', state: 'Invited' },
];
const q = ref('');
// The header search live-filters; the frame itself never moves.
const filtered = computed(() =>
  members.filter((m) => `${m.name} ${m.role}`.toLowerCase().includes(q.value.trim().toLowerCase())));
</script>

<template>
  <div class="cbcl" role="group" aria-label="Workspace members">
    <header class="cbcl-head">
      <b>Members</b>
      <input v-model="q" type="search" placeholder="Find a member" aria-label="Find a member" />
    </header>
    <ul>
      <li v-for="m in filtered" :key="m.name">
        <button type="button" class="cbcl-row">
          <span>{{ m.name }} <small>· {{ m.role }}</small></span>
          <span class="cbcl-tag" :data-tone="m.tone">{{ m.state }}</span>
        </button>
      </li>
    </ul>
    <!-- The frame stays up; only the rows leave. -->
    <div class="cbcl-foot" role="status">{{ filtered.length }} of {{ members.length }} members</div>
  </div>
</template>

<style scoped>
.cbcl { max-inline-size: 24rem; border: 1px solid #e0e0e0; background: #f4f4f4;
        font: 400 .875rem/1.4 'IBM Plex Sans', sans-serif; }
.cbcl-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
             padding: .75rem 1rem; border-block-end: 1px solid #e0e0e0; }
.cbcl-head b { font-weight: 600; }
.cbcl-head input { block-size: 2rem; inline-size: 10rem; padding-inline: .625rem; border: none;
                   border-block-end: 1px solid #8d8d8d; background: transparent; font: inherit; }
.cbcl-head input:focus-visible { outline: none; border-block-end: 2px solid #0f62fe; }
.cbcl ul { margin: 0; padding: 0; list-style: none; }
.cbcl li + li { border-block-start: 1px solid #e0e0e0; }
.cbcl-row { inline-size: 100%; display: flex; align-items: center; gap: .75rem; padding: .6875rem 1rem;
            border: none; border-block-end: 1px solid #e0e0e0; background: transparent; text-align: start;
            cursor: pointer; font: inherit; }
.cbcl-row:hover { background: #e8e8e8; }
.cbcl-row small { font-size: .75rem; color: #525252; }
.cbcl-tag { margin-inline-start: auto; padding: 0 .5rem; block-size: 1.5rem; display: inline-grid;
            place-items: center; border: 1px solid; font-size: .75rem; }
.cbcl-tag[data-tone='green'] { border-color: #24a148; color: #0e6027; }
.cbcl-tag[data-tone='blue'] { border-color: #0f62fe; color: #0043ce; }
.cbcl-tag[data-tone='gray'] { border-color: #8d8d8d; color: #525252; }
.cbcl-foot { padding: .625rem 1rem; font-size: .75rem; color: #525252;
             border-block-start: 2px solid #0f62fe; }
</style>
<!-- MembersList.svelte — Carbon contained list: header, action and rows in one frame -->
<script lang="ts">
  import '@nabuxai/ui-core/css';

  const members = [
    { name: 'Lena Fischer', role: 'Owner', tone: 'green', state: 'Owner' },
    { name: 'Marco Ricci', role: 'Developer', tone: 'blue', state: 'Active' },
    { name: 'Aylin Demir', role: 'Support', tone: 'blue', state: 'Active' },
    { name: 'Jonas Weber', role: 'Billing', tone: 'gray', state: 'Invited' },
  ];
  let q = $state('');
  // The header search live-filters; the frame itself never moves.
  const filtered = $derived(
    members.filter((m) => `${m.name} ${m.role}`.toLowerCase().includes(q.trim().toLowerCase())),
  );
</script>

<div class="cbcl" role="group" aria-label="Workspace members">
  <header class="cbcl-head">
    <b>Members</b>
    <input type="search" bind:value={q} placeholder="Find a member" aria-label="Find a member" />
  </header>
  <ul>
    {#each filtered as m (m.name)}
      <li>
        <button type="button" class="cbcl-row">
          <span>{m.name} <small>· {m.role}</small></span>
          <span class="cbcl-tag" data-tone={m.tone}>{m.state}</span>
        </button>
      </li>
    {/each}
  </ul>
  <!-- The frame stays up; only the rows leave. -->
  <div class="cbcl-foot" role="status">{filtered.length} of {members.length} members</div>
</div>

<style>
.cbcl { max-inline-size: 24rem; border: 1px solid #e0e0e0; background: #f4f4f4;
        font: 400 .875rem/1.4 'IBM Plex Sans', sans-serif; }
.cbcl-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
             padding: .75rem 1rem; border-block-end: 1px solid #e0e0e0; }
.cbcl-head b { font-weight: 600; }
.cbcl-head input { block-size: 2rem; inline-size: 10rem; padding-inline: .625rem; border: none;
                   border-block-end: 1px solid #8d8d8d; background: transparent; font: inherit; }
.cbcl-head input:focus-visible { outline: none; border-block-end: 2px solid #0f62fe; }
.cbcl ul { margin: 0; padding: 0; list-style: none; }
.cbcl li + li { border-block-start: 1px solid #e0e0e0; }
.cbcl-row { inline-size: 100%; display: flex; align-items: center; gap: .75rem; padding: .6875rem 1rem;
            border: none; border-block-end: 1px solid #e0e0e0; background: transparent; text-align: start;
            cursor: pointer; font: inherit; }
.cbcl-row:hover { background: #e8e8e8; }
.cbcl-row small { font-size: .75rem; color: #525252; }
.cbcl-tag { margin-inline-start: auto; padding: 0 .5rem; block-size: 1.5rem; display: inline-grid;
            place-items: center; border: 1px solid; font-size: .75rem; }
.cbcl-tag[data-tone='green'] { border-color: #24a148; color: #0e6027; }
.cbcl-tag[data-tone='blue'] { border-color: #0f62fe; color: #0043ce; }
.cbcl-tag[data-tone='gray'] { border-color: #8d8d8d; color: #525252; }
.cbcl-foot { padding: .625rem 1rem; font-size: .75rem; color: #525252;
             border-block-start: 2px solid #0f62fe; }
</style>