Roles permissions
ProA matrix of roles against permissions.
pnpm dlx shadcn@latest add @caliper/roles-permissionsPermissions apply to everyone in the role, the moment you save.
| Permission | Owner1 member | Admin2 members | Editor5 members | Viewer3 members |
|---|---|---|---|---|
| Work | ||||
| View projects | ||||
| Edit projects | ||||
| Publish changesMake edits live for customers | ||||
| Delete projects | ||||
| People | ||||
| Invite people | ||||
| Change roles | ||||
| Remove people | ||||
| Billing | ||||
| View invoices | ||||
| Change plan |
When to use #
Use it for
- Defining who can do what.
Skip it when
- Few roles.
Installation #
pnpm dlx shadcn@latest add @caliper/roles-permissions
Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage #
Import it from your copy of the source. The example behind the preview comes with the source.
import { RolesPermissions } from "@/components/ui/roles-permissions"
The worked example comes with Pro
The 56-line example behind the preview opens here with a Pro or Team licence.
API reference #
RolesPermissions
component
Accessibility #
It exposes region and status semantics, with aria-label and aria-hidden kept in step with state. Changes that matter are announced through a live region.
Motion #
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.