# Member list

- **[App UI](/app/)**
- **[Team](/app/team/)**
- **Member list**

The people on a team: avatar, name, email and a role select per member, a locked owner row, Remove with a confirmation that keeps focus in the list, role changes and…

## Notes

- **When to use it**: A list of the people on a team, each with a role select and a Remove button. Use `app-team-pending` for invitations that are not accepted yet and `app-team-invite` for adding someone; this one is for people who already have access.
- **Writing for it**: - roles (2 to 5 names, 20 characters) feeds every row's select, so list all of them, including Owner if one row is locked.
- Each member's sample must be one of the roles. Set locked: true on the owner so that row shows a badge and has no Remove button.
- roleLabel (30) is spoken before the name, so end it with a word like 'Role for'. Write notices.roleNow and notices.removed so they read after the person's name.
- **Watch out for**: Removing a member is a confirm step in the list, but the block removes the row only on screen. With up to 8 members the count in the heading follows the rows that are left, and when it reaches zero the empty message takes over.

## Pairs well with

- **[App, invite form](/blocks/app/team-invite)**
- **[App, pending invites](/blocks/app/team-pending)**
- **[App, plan and usage](/blocks/app/billing-plan)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppTeamMembers from '@/components/klarhimmel/blocks/app-team-members';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppTeamMembers props={{
          "eyebrow": "Team",
          "title": "Name the group of people",
          "description": "Say who is listed and who can change roles.",
          "summaryWord": "members",
          "roles": [
            "Owner",
            "Admin",
            "Member"
          ],
          "roleLabel": "Role for",
          "members": [
            {
              "name": "Person one",
              "email": "one@example.com",
              "sample": "Owner",
              "locked": true
            },
            {
              "name": "Person two",
              "email": "two@example.com",
              "sample": "Admin",
              "locked": false
            },
            {
              "name": "Person three",
              "email": "three@example.com",
              "sample": "Member",
              "locked": false
            }
          ],
          "remove": {
            "label": "Remove",
            "question": "Remove this one?",
            "yes": "Yes, remove",
            "no": "Keep"
          },
          "notices": {
            "roleNow": "is now",
            "removed": "removed"
          },
          "state": "filled",
          "messages": {
            "emptyTitle": "Say you are alone here",
            "emptyBody": "Say how to add a person and where they appear."
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **eyebrow**: Text, up to 60 characters. Optional; empty is not rendered.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters. Optional; empty is not rendered.
- **summaryWord**: Text, up to 20 characters.
- **roles**: List of 2 to 5.
- **roleLabel**: Text, up to 30 characters.
- **members**: List of 1 to 8. Each item: name, email, sample, locked.
- **remove**: Fields: label, question, yes, no.
- **notices**: Fields: roleNow, removed.
- **state**: One of 'filled', 'empty'.
- **messages**: Fields: emptyTitle, emptyBody.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

## Install

- **CLI**

  ```
  npx shadcn add @klarhimmel/app-team-members
  ```

Uses

- Avatar
- Badge
- NativeSelect
- EmptyState

- **About**: The people on a team: avatar, name, email and a role select per member, a locked owner row, Remove with a confirmation that keeps focus in the list, role changes and removals announced by name, a count that follows, and an empty state.
- **States**: Filled and empty. Every role select is named for its member; the owner row is locked. New project? Set it up once: /get-started/installation.
