Elements Pro launch: $79 for the first 50 with LAUNCH50 · $129 standard.

Components / Blocks / PermissionMatrix

PermissionMatrix.

ProBlockAccessv0.2.0

A capability-by-role matrix that labels each cell granted, inherited, not granted or unavailable. Edits are held as unsaved until your server confirms them, and phones show one role at a time.

Get Elements Pro
Demo dataResponsive

Role permissions

Changes take effect only after they are saved and confirmed.

Records

  • Edit recordsGranted
  • Export recordsGranted

Workspace

  • Invite membersGranted
  • Manage billingGranted
  • Configure SSOUnavailable

Installation

Add the licensed registry once. Keep your license key in the project’s uncommitted environment.

components.json
{
  "registries": {
    "@elements-pro": {
      "headers": {
        "Authorization": "Bearer ${ELEMENTS_PRO_LICENSE_KEY}"
      },
      "url": "https://pro.elements.micropreneur.dev/r/{name}.json"
    }
  }
}
export ELEMENTS_PRO_LICENSE_KEY=mpro_...
pnpm dlx shadcn@latest add @elements-pro/permission-matrix

The shadcn CLI writes the source into your project. Files added:

  • components/elements-pro/permission-matrix.tsxblock
  • components/ui/badge.tsxui
  • components/ui/button.tsxui
  • components/ui/card.tsxui
  • components/ui/native-select.tsxui
Dependencies@base-ui/reactclass-variance-authorityclsxlucide-reacttailwind-merge

API

PropTypeDefaultDescription
roles (required)PermissionRole[]—Roles, optional inheritance label and locked flag.
capabilities (required)PermissionCapability[]—Grouped capabilities with optional descriptions.
permissions (required)Record<string, PermissionState>—Server state keyed by roleId:capabilityId.
onSave(changes) => Promise<{ status: "saved" | "error" }>—Persist pending changes; nothing reads as saved before it resolves.

PermissionState

PropTypeDefaultDescription
state (required)'granted' | 'inherited' | 'denied' | 'unavailable'—

Accessibility

  • States are shown in words and icons, not color alone.
  • Editable cells are toggle buttons with aria-pressed and a label naming the role, capability and state.
  • The matrix is a real table with row and column headers; phones get a labelled role picker and lists.