Skip to main content

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 bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
role"owner" | "admin" | "editor" | "viewer" | string—Known roles get an icon + tone; any other string renders neutral.
iconReact.ReactNode—
childrenReact.ReactNode—Override the label (defaults to the capitalised role).