Early bird: 30% off Dashral ProSee pricing

Dashral

Team membersPro

The team and the invitations still out: invite several people with a role, change roles in place, suspend or remove someone, and resend or revoke an invite.

Installation

When to use

  • The team and its invitations: invite several people with a role, change roles, suspend or remove.
  • Any product with seats: workspace settings, admin consoles.

When not to use

  • Single-user products.
  • Managing customers rather than teammates: Orders table or a Data Table.

Usage

Team members with your own data: every prop has the sample as its default, so pass only what you have.

example.tsx
"use client"

import { TeamMembers } from "@/components/dashral/blocks/team-members"

export default function Team() {
  return (
    <TeamMembers
      members={[
        { id: 1, name: "Olivia Martin", email: "olivia@acme.com", role: "owner", active: "Now", you: true },
        { id: 2, name: "Liam Johnson", email: "liam@acme.com", role: "member", active: "2 hours ago" },
      ]}
      invites={[{ id: 10, email: "sofia@acme.com", role: "admin", sent: "Yesterday" }]}
      seats={5}
      onInvite={(emails, role) => console.log("invite", emails, "as", role)}
      onRoleChange={(id, role) => console.log(id, role)}
      onRemove={(id) => console.log("remove", id)}
    />
  )
}

API reference

TeamMembers

A team page: who's in it, with their role and when they were last active, and the invitations still out. Invite several people at once with a role (seats count them), change a role in place, suspend, reactivate or remove someone, and resend, copy or revoke an invitation. The owner stays; you can't demote or remove yourself. Your team comes in as members and invites (a new list replaces what's shown), and every change goes to your handlers; one that throws is undone, with its message.

PropTypeDefault
workspacestring

The workspace, in "Who can sign in to …".

"Northwind Studio"
membersTeamMember[]sample
invitesTeamInvite[]sample
seatsnumber

Seats on the plan: invitations hold one until they're accepted or revoked.

10
inviteLink(invite: TeamInvite) => string

An invitation's link, for "Copy link".

sample
onInvite(emails: string[], role: TeamInvite["role"]) => Promise<TeamInvite[] | void> | TeamInvite[] | void

Invites people with a role; return the invitations made to show them (sample ones without it).

—
onRoleChange(id: TeamMember["id"], role: Exclude<TeamRole, "owner">) => Promise<void> | void—
onSuspend(id: TeamMember["id"], suspended: boolean) => Promise<void> | void—
onRemove(id: TeamMember["id"]) => Promise<void> | void—
onResend(id: TeamInvite["id"]) => Promise<void> | void

"Send a new link" for an invitation.

—
onRevoke(id: TeamInvite["id"]) => Promise<void> | void—

type TeamRole

= "owner" | "admin" | "member"

type TeamMember

PropTypeDefault
idnumber | string—
namestring—
emailstring—
roleRole—
activestring—
suspendedboolean—
youboolean—
srcstring—

type TeamInvite

PropTypeDefault
idnumber | string—
emailstring—
roleExclude<Role, "owner">—
sentstring—
expiredboolean—