Skip to content
Klarhimmel UI

Member list

App, member list previewApp, member list preview

Install

npx shadcn add @klarhimmel/app-team-members
DetailsAbout, usage, props and more

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…

States

member list in 2 forms: filled, empty.

  • state: filled

    Team

    Name the group of people

    Say who is listed and who can change roles.

    4 members

    • Person one

      one@example.com

      Owner
    • Person two

      two@example.com

    • Person three

      three@example.com

    • Person four

      four@example.com

  • state: empty

    Team

    Name the group of people

    Say who is listed and who can change roles.

    Say you are alone here

    Say how to add a person and where they appear.

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.

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.

PropTypeDefaultDescription
eyebrowstring'Team'Text, up to 60 characters. Optional; empty is not rendered.
titlestring'Name the group of people'Text, up to 120 characters.
descriptionstring'Say who is listed and who can chang…'Text, up to 300 characters. Optional; empty is not rendered.
summaryWordstring'members'Text, up to 20 characters.
rolesstring[]4 itemsList of 2 to 5.
roleLabelstring'Role for'Text, up to 30 characters.
members{ name, email, sample, locked }[]4 itemsList of 1 to 8. Each item: name, email, sample, locked.
remove{ label, question, yes, no }{…}Fields: label, question, yes, no.
notices{ roleNow, removed }{…}Fields: roleNow, removed.
state'filled' | 'empty''filled'One of 'filled', 'empty'.
messages{ emptyTitle, emptyBody }{…}Fields: emptyTitle, emptyBody.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.

Install

Installs

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.