RoleBadge
A compact role label — known roles (owner/admin/editor/viewer) get an icon and tone; any other string renders neutral.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A compact role label — known roles (owner/admin/editor/viewer) get an icon and tone; any other string renders neutral.
Accessibility
Explains why access is limited in text, not colour alone, and offers the next action (request access). Banners use role="status".
Install and import
npx shadcn@latest add @prism/role-badge
import { RoleBadge } from '@/components/prism/RoleBadge';
In a no-build prototype, read it from the bundle instead: const { RoleBadge } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
role | "owner" | "admin" | "editor" | "viewer" | string | — | Known roles get an icon + tone; any other string renders neutral. |
icon | React.ReactNode | — | |
children | React.ReactNode | — | Override the label (defaults to the capitalised role). |