Skip to content

Settings

Settings roles

The roles list for a BTS space, with a search field, a create-role button, and a table of existing roles showing each role's icon, colour, and member count.
Available
Ports as-is

Examples

Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.

Settings roles

Rendered live from Storybook

Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.

Props

The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.

PropTypeDefaultDescription
roles*SpaceRole[]—Undocumented — add TSDoc to the prop in the library.
foldersSpaceRoleFolder[][]One folder per form that generates roles. Each collapses to a single row that drills into `SettingsRoleFolder`. Defaults to none.
onOpenFolder(formId: string) => void—Called with a folder's `formId` when its row is opened.
onManageRole*(id: string | "new") => void—Called with a role id to edit, or the literal `"new"` to open the create flow.
onDeleteRole*(id: string) => void—Fired when the delete confirmation is confirmed.
querystring—Search box contents. Controlled when supplied.
initialQuerystring""Uncontrolled starting query — use to render the filtered or empty state statically.
onQueryChange(query: string) => void—Undocumented — add TSDoc to the prop in the library.
initialRemoveTargetIdstring | nullnullOpens the delete confirmation on mount for the role with this id.
classNamestring—Undocumented — add TSDoc to the prop in the library.

Reference

Transcribed from the component audit. If this disagrees with the source, the source is right.

Source
src/components/settings/SettingsRoles.tsx
Portability
Copies across unchanged — only the utils import path moves.
Notes
Use as the entry point into role management; the whole row opens the role editor while a kebab menu offers edit and delete, deleting a role requires confirmation, and the layout switches from a bordered table to a bare stacked list on mobile.