Role Grid
A permission grid for roles: a pointer fills a column, selects a whole role and turns one cell off while the count rolls. Visitors can toggle any cell, press a role header to switch its whole column, and move between cells with the arrow keys.
pixikit.com/docs/blocks/illustrations/role-grid
Customize
Autoplay
Loop
Props
15| Name | Type | Default | Description |
|---|---|---|---|
roles | string[] | DEFAULT_ROLES | The role names, one column each. |
groups | RoleGridGroup[] | DEFAULT_GROUPS | The permission groups, each with its rows; allow and locked hold one flag per role. |
title | string | "Roles" | The name in the top bar and the hidden table caption. |
countLabel | string | "{n} allowed" | The summary text; {n} becomes the number of allowed cells. |
cellLabel | string | "{role}: {permission}" | The hidden label of each cell; {role} and {permission} are replaced. |
lockedLabel | string | "Always on for this role" | The hidden label added to a cell that cannot change. |
columnLabel | string | "Allow all for {role}" | The hidden label of a role header button; {role} is replaced. |
onChange | (groups: RoleGridGroup[]) => void | None | Called with the new matrix when a visitor changes a cell or a column. |
autoplay | boolean | true | Starts when the scene scrolls into view; when off it waits for a click on replay. |
loop | boolean | true | Plays again from the start layout after the hold. |
speed | number | 1 | Playback speed multiplier. |
height | number | 360 | The height of the scene in px. |
width | number | 560 | The widest the scene grows, in px. |
replayLabel | string | "Replay" | What screen readers call the replay button. |
className | string | None |