Skip to content
PixiKit

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
NameTypeDefaultDescription
rolesstring[]DEFAULT_ROLESThe role names, one column each.
groupsRoleGridGroup[]DEFAULT_GROUPSThe permission groups, each with its rows; allow and locked hold one flag per role.
titlestring"Roles"The name in the top bar and the hidden table caption.
countLabelstring"{n} allowed"The summary text; {n} becomes the number of allowed cells.
cellLabelstring"{role}: {permission}"The hidden label of each cell; {role} and {permission} are replaced.
lockedLabelstring"Always on for this role"The hidden label added to a cell that cannot change.
columnLabelstring"Allow all for {role}"The hidden label of a role header button; {role} is replaced.
onChange(groups: RoleGridGroup[]) => voidNoneCalled with the new matrix when a visitor changes a cell or a column.
autoplaybooleantrueStarts when the scene scrolls into view; when off it waits for a click on replay.
loopbooleantruePlays again from the start layout after the hold.
speednumber1Playback speed multiplier.
heightnumber360The height of the scene in px.
widthnumber560The widest the scene grows, in px.
replayLabelstring"Replay"What screen readers call the replay button.
classNamestringNone

Related