Xzero UI
Pro library

Roles and permissionsPro

A permissions matrix with group toggles that ripple, role duplication and a review bar.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/roles-permissions
Live · keyboard ready

Use this on a workspace settings page to edit what each role can do. Load roles, permission groups and grants from your authorization API and connect Save to it; saving in the preview is simulated.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/roles-permissions

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { RolesPermissions } from "@/components/xzero/blocks/roles-permissions/roles-permissions";

export default function WorkspaceRoles() {
  return (
    <section>
      <RolesPermissions />
    </section>
  );
}

API reference

RolesPermissions

A permissions matrix with role columns, collapsible permission groups, group toggles, role duplication and a review bar for unsaved changes. Takes no props; roles, groups, grants and members are inline constants (ROLES, GROUPS, GRANTED, MEMBERS) in roles-permissions.tsx, and saving is simulated.

No props.

Keyboard interactions

KeysAction
Arrow keysMoves focus across the matrix, snapping to the nearest cell in the next row.
Home / EndJumps to the first or last cell in the row.
Ctrl + Home / Ctrl + EndJumps to the first or last cell in the grid.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components