# Team members

A responsive controlled team directory with search, status filters, native role selection, availability, and member actions.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs a responsive controlled team directory with search, status filters, native role selection, availability, and member actions.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than team members.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Team members

```sh
npx shadcn@latest add @tidal-pro/team-members
```

Stylesheets: `components/ui/tidal.css`, `components/ui/team-members.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/team-members.css";
import{TidalTeamMembers}from"./components/ui/team-members";
export default()=><div className="tidal-scope"><TidalTeamMembers members={[{id:"example",name:"Demo",accessibleName:"Demo",roleId:"example",status:{state:"available",label:"Demo"}}]} roles={[{id:"example",label:"Demo"}]} title={"Demo"}/></div>;
```

## Structured props

- `TidalTeamMembers.members: ReadonlyArray<TidalTeamMember>`: Required members value accepted by this exported component.
- `TidalTeamMembers.roles: ReadonlyArray<TidalTeamRole>`: Required roles value accepted by this exported component.
- `TidalTeamMembers.title: ReactNode`: Required title value accepted by this exported component.
- `TidalTeamMembers.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalTeamMembers.emptyMessage?: ReactNode` (default "No team members match this view."): Optional empty message value accepted by this exported component.
- `TidalTeamMembers.eyebrow?: ReactNode` (default "Team members"): Optional eyebrow value accepted by this exported component.
- `TidalTeamMembers.filter?: TidalTeamFilterControl | undefined`: Optional filter value accepted by this exported component.
- `TidalTeamMembers.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalTeamMembers.headingLevel?: TidalTeamHeadingLevel | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalTeamMembers.memberHeadingLevel?: TidalTeamMemberHeadingLevel | undefined`: Optional member heading level value accepted by this exported component.
- `TidalTeamMembers.onRemoveMember?: ((member: TidalTeamMember, event: ReactMouseEvent<HTMLButtonElement>) => void) | undefined`: Callback invoked when the remove member interaction is proposed.
- `TidalTeamMembers.onRoleChange?: ((member: TidalTeamMember, roleId: string, event: ReactChangeEvent<HTMLSelectElement>) => void) | undefined`: Callback invoked when the role change interaction is proposed.
- `TidalTeamMembers.removeLabel?: ((member: TidalTeamMember) => string) | undefined` (default (member) => `Remove ${member.accessibleName}`): Optional remove label value accepted by this exported component.
- `TidalTeamMembers.roleLabel?: ((member: TidalTeamMember) => string) | undefined` (default (member) => `Role for ${member.accessibleName}`): Optional role label value accepted by this exported component.
- `TidalTeamMembers.search?: TidalTeamSearchControl | undefined`: Optional search value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/team-members.tsx) | [Manifest](https://tidalui.com/examples/team-members.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useLayoutEffect, useMemo, useRef, useState } from "react";

import { Undo2 } from "lucide-react";

import { TidalTeamMembers, type TidalTeamMember, type TidalTeamMemberStatus, type TidalTeamRole } from "./components/ui/team-members";

import "./components/ui/team-members.css";

function tidalExampleAvatarDataUri(seed: unknown) {
  const text = String(seed).replace(/[^a-z0-9]/gi, "").slice(-2) || "UI";
  const palette = ["#333333", "#555555", "#777777", "#999999", "#bbbbbb"];
  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><rect width="96" height="96" rx="48" fill="${color}"/><circle cx="48" cy="38" r="17" fill="white" fill-opacity=".92"/><path d="M18 92c3-22 15-34 30-34s27 12 30 34" fill="white" fill-opacity=".92"/></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

function tidalExampleImageDataUri(label: string) {
  const safeLabel = label.replace(/[<>&]/g, "").slice(0, 28) || "Sample image";
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 675"><defs><linearGradient id="g" x1="0" x2="1" y1="0" y2="1"><stop stop-color="#171717"/><stop offset="1" stop-color="#555555"/></linearGradient></defs><rect width="1200" height="675" fill="url(#g)"/><circle cx="950" cy="100" r="260" fill="white" fill-opacity=".08"/><text x="80" y="570" fill="white" font-family="system-ui,sans-serif" font-size="64" font-weight="700">${safeLabel}</text></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

const tidalExampleStyles = ".tidal-scope .team-members-demo,\n.tidal-scope .team-members-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .team-members-demo {\n  width: 100%;\n  min-width: 0;\n  padding: clamp(11px, 3vw, 34px);\n  color: var(--t-ink);\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px),\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n    var(--t-subtle);\n  background-size: 25px 25px;\n  border-radius: 22px;\n  container: team-members-demo / inline-size;\n}\n\n.tidal-scope .team-members-demo-shell {\n  display: grid;\n  width: 100%;\n  max-width: 1180px;\n  min-width: 0;\n  gap: 12px;\n  margin: 0 auto;\n}\n\n.tidal-scope .team-members-demo-status-row {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  justify-content: space-between;\n  gap: 14px;\n  padding: 4px 6px 0;\n}\n\n.tidal-scope .team-members-demo-status-row p {\n  min-width: 0;\n  margin: 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .team-members-demo-status-row button {\n  display: inline-flex;\n  min-width: 44px;\n  min-height: 44px;\n  flex: none;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  padding: 8px 12px;\n  color: var(--t-surface);\n  background: var(--t-ink);\n  border: 1px solid var(--t-ink);\n  border-radius: var(--t-radius-control);\n  font: inherit;\n  font-size: 11px;\n  font-weight: 650;\n  cursor: pointer;\n  transition: transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .team-members-demo-status-row button:active {\n  transform: scale(0.98);\n}\n\n.tidal-scope .team-members-demo-status-row button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n@container team-members-demo (max-width: 480px) {\n  .tidal-scope .team-members-demo {\n    padding: 7px;\n    background-size: 18px 18px;\n    border-radius: 18px;\n  }\n\n  .tidal-scope .team-members-demo-status-row {\n    align-items: stretch;\n    flex-direction: column;\n  }\n\n  .tidal-scope .team-members-demo-status-row button {\n    width: 100%;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .team-members-demo-status-row button {\n    transition: none;\n    transform: none;\n  }\n}";

type StatusFilter = "all" | TidalTeamMemberStatus;

interface SampleMember {
  id: string;
  name: string;
  team: string;
  roleId: string;
  status: TidalTeamMemberStatus;
  portrait: number;
  detail: string;
}

const ROLES: readonly TidalTeamRole[] = [
  { id: "manager", label: "Manager" },
  { id: "editor", label: "Editor" },
  { id: "viewer", label: "Viewer" },
];

const INITIAL_MEMBERS: readonly SampleMember[] = [
  {
    id: "ava",
    name: "Ava Chen",
    team: "Product design",
    roleId: "manager",
    status: "available",
    portrait: 1,
    detail: "Design systems",
  },
  {
    id: "noah",
    name: "Noah Reed",
    team: "Engineering",
    roleId: "editor",
    status: "available",
    portrait: 2,
    detail: "Web platform",
  },
  {
    id: "mila",
    name: "Mila Stone",
    team: "Research",
    roleId: "viewer",
    status: "away",
    portrait: 3,
    detail: "Customer studies",
  },
  {
    id: "eli",
    name: "Eli Park",
    team: "Operations",
    roleId: "editor",
    status: "offline",
    portrait: 4,
    detail: "Release planning",
  },
  {
    id: "zoe",
    name: "Zoe Brooks",
    team: "Content",
    roleId: "editor",
    status: "available",
    portrait: 5,
    detail: "Product writing",
  },
  {
    id: "leo",
    name: "Leo Martin",
    team: "Engineering",
    roleId: "viewer",
    status: "away",
    portrait: 6,
    detail: "Quality review",
  },
  {
    id: "nora",
    name: "Nora Ellis",
    team: "Support",
    roleId: "manager",
    status: "available",
    portrait: 7,
    detail: "Team workflow",
  },
  {
    id: "finn",
    name: "Finn Walsh",
    team: "Finance",
    roleId: "viewer",
    status: "offline",
    portrait: 8,
    detail: "Sample reporting",
  },
  {
    id: "maya",
    name: "Maya Ortiz",
    team: "Marketing",
    roleId: "editor",
    status: "away",
    portrait: 9,
    detail: "Launch planning",
  },
  {
    id: "owen",
    name: "Owen Clark",
    team: "Partnerships",
    roleId: "viewer",
    status: "available",
    portrait: 10,
    detail: "Sample programs",
  },
];

const STATUS_LABELS: Record<TidalTeamMemberStatus, string> = {
  available: "Available",
  away: "Away",
  offline: "Offline",
};

export function TeamMembersDemo() {
  const searchInputRef = useRef<HTMLInputElement>(null);
  const undoButtonRef = useRef<HTMLButtonElement>(null);
  const restoredRemoveRef = useRef<HTMLButtonElement>(null);
  const pendingFocusRef = useRef<"undo" | { memberId: string } | null>(null);
  const [members, setMembers] =
    useState<readonly SampleMember[]>(INITIAL_MEMBERS);
  const [query, setQuery] = useState("");
  const [statusFilter, setStatusFilter] = useState<StatusFilter>("all");
  const [removed, setRemoved] = useState<{
    member: SampleMember;
    index: number;
  } | null>(null);
  const [message, setMessage] = useState(
    "Showing ten fictional members. Every change stays in this local preview.",
  );

  const counts = useMemo(
    () => ({
      all: members.length,
      available: members.filter((member) => member.status === "available")
        .length,
      away: members.filter((member) => member.status === "away").length,
      offline: members.filter((member) => member.status === "offline").length,
    }),
    [members],
  );

  const visibleMembers = useMemo(() => {
    const normalizedQuery = query.trim().toLocaleLowerCase();
    return members.filter((member) => {
      const matchesStatus =
        statusFilter === "all" || member.status === statusFilter;
      const matchesQuery =
        !normalizedQuery ||
        `${member.name} ${member.team} ${member.detail}`
          .toLocaleLowerCase()
          .includes(normalizedQuery);
      return matchesStatus && matchesQuery;
    });
  }, [members, query, statusFilter]);

  const componentMembers = useMemo<readonly TidalTeamMember[]>(
    () =>
      visibleMembers.map((member) => ({
        id: member.id,
        name: member.name,
        accessibleName: member.name,
        subtitle: member.team,
        avatar: {
          src: tidalExampleAvatarDataUri(String(member.portrait).padStart(2, "0")),
          alt: "",
        },
        roleId: member.roleId,
        status: {
          state: member.status,
          label: STATUS_LABELS[member.status],
        },
        meta: member.detail,
        removeButtonProps: {
          "aria-label": `Remove ${member.name} from the local sample`,
        },
        removeButtonRef:
          typeof pendingFocusRef.current === "object" &&
          pendingFocusRef.current?.memberId === member.id
            ? restoredRemoveRef
            : undefined,
      })),
    [visibleMembers],
  );

  useLayoutEffect(() => {
    const pendingFocus = pendingFocusRef.current;
    if (!pendingFocus) return;

    if (pendingFocus === "undo") {
      undoButtonRef.current?.focus({ preventScroll: true });
    } else {
      (restoredRemoveRef.current ?? searchInputRef.current)?.focus({
        preventScroll: true,
      });
    }

    pendingFocusRef.current = null;
    restoredRemoveRef.current = null;
  });

  function changeRole(memberId: string, roleId: string) {
    const member = members.find((entry) => entry.id === memberId);
    const role = ROLES.find((entry) => entry.id === roleId);
    if (!member || !role) return;
    setMembers((current) =>
      current.map((entry) =>
        entry.id === memberId ? { ...entry, roleId } : entry,
      ),
    );
    setMessage(
      `${member.name} is now ${role.label} in this local sample. No account changed.`,
    );
  }

  function removeMember(memberId: string) {
    const index = members.findIndex((member) => member.id === memberId);
    if (index < 0) return;
    const member = members[index];
    pendingFocusRef.current = "undo";
    setMembers((current) => current.filter((entry) => entry.id !== memberId));
    setRemoved({ member, index });
    setMessage(
      `${member.name} was removed from this rendered sample only. Undo is available.`,
    );
  }

  function undoRemoval() {
    if (!removed) return;
    restoredRemoveRef.current = null;
    pendingFocusRef.current = { memberId: removed.member.id };
    setMembers((current) => {
      const next = [...current];
      next.splice(Math.min(removed.index, next.length), 0, removed.member);
      return next;
    });
    setMessage(`${removed.member.name} was restored to the local sample.`);
    setRemoved(null);
  }

  const filterOptions = (["all", "available", "away", "offline"] as const).map(
    (id) => ({
      id,
      label: id === "all" ? "All" : STATUS_LABELS[id],
      count: counts[id],
    }),
  );

  return (
    <section className="team-members-demo" aria-label="Team members preview">
      <div className="team-members-demo-shell">
        <TidalTeamMembers
          title="Team members"
          eyebrow={null}
          description="Search the sample team or change a role."
          members={componentMembers}
          roles={ROLES}
          search={{
            value: query,
            label: "Search members",
            placeholder: "Search name or team",
            inputRef: searchInputRef,
            inputProps: { autoComplete: "off", name: "member-search" },
            onValueChange: (value) => {
              setQuery(value);
              setMessage(
                value.trim()
                  ? `Showing local matches for “${value.trim()}”.`
                  : "Search cleared. Showing members in the selected status.",
              );
            },
          }}
          filter={{
            value: statusFilter,
            label: "Filter members by sample availability",
            options: filterOptions,
            onValueChange: (value) => {
              const next = value as StatusFilter;
              setStatusFilter(next);
              setMessage(
                next === "all"
                  ? "Showing every fictional member."
                  : `Showing fictional members marked ${STATUS_LABELS[next].toLowerCase()}.`,
              );
            },
          }}
          onRoleChange={(member, roleId) => changeRole(member.id, roleId)}
          onRemoveMember={(member) => removeMember(member.id)}
          removeLabel={() => "Remove"}
          emptyMessage="No fictional members match this local view."
          footer={
            <span>Fictional sample data. Changes stay in this preview.</span>
          }
        />

        <div className="team-members-demo-status-row">
          <p role="status" aria-live="polite" aria-atomic="true">
            {message}
          </p>
          {removed ? (
            <button ref={undoButtonRef} type="button" onClick={undoRemoval}>
              <Undo2 aria-hidden="true" size={15} />
              Undo removal
            </button>
          ) : null}
        </div>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <TeamMembersDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title, consumer-owned members, and string-labelled roles are required. Members have stable ids, visible and accessible names, controlled role ids, visible typed available|away|offline status, and optional subtitle, avatar with native image props/ref, meta, disabled state, article props/ref, role-select props/ref, and remove-button props/ref. Optional controlled search and filter objects each require their value, accessible label, and change callback; native input/button handlers run first and preventDefault suppresses higher callbacks. onRoleChange converts the role control from static text to a native controlled select; onRemoveMember adds a native button. Both preserve attributes, external form ownership, refs, disabled state, and prevented handlers. Optional heading levels, description, eyebrow, labels, empty message and footer remain consumer-owned. The section forwards native attributes/ref. The component does not search, filter, change a role, remove a member, invite, email, request, store, authenticate, or mutate data. Controls are44px, search/select text is16px on coarse pointers, desktop rows reflow to cards, logical layout supports RTL, entrances are bounded, and reduced motion is static.
