Settings
Settings role manage
The role editor for a BTS space, letting an admin set a role's name, icon, and colour, toggle its permissions, and assign or remove members across three tabs.
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 role manage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
role | SpaceRole | — | The role being edited. Omit for the "Create role" flow. |
folderName | string | — | Folder the role belongs to when a form generated it. Named in the hint under the locked name field. |
onBack* | () => void | — | Undocumented — add TSDoc to the prop in the library. |
onSave* | (role: SpaceRole) => void | — | Undocumented — add TSDoc to the prop in the library. |
members | RoleAssignableMember[] | [] | Pool the "Add member" picker offers. Defaults to an empty list. |
isMobile | boolean | false | Overrides the mobile fork. The picker is a vaul Drawer below `md` and a Dialog at and above it; pass this to render either tree at any viewport. |
initialTab | RoleManageTab | "display" | Which tab opens first. |
initialName | string | — | Seeds the name field. Falls back to `role.name`. |
initialColor | string | — | Seeds the selected swatch. Falls back to `role.color`, then the first swatch. |
initialPermissions | SpaceRolePermissions | — | Seeds the permission flags. Falls back to `role.permissions`, then all-off. |
initialMemberIds | string[] | — | Seeds the assigned usernames. Falls back to `role.memberIds`. |
defaultAddMembersOpen | boolean | false | Opens the add-members picker on mount. |
initialMemberQuery | string | "" | Seeds the assigned-members search box. |
initialPickerQuery | string | "" | Seeds the picker's own search box. |
initialPickerSelected | string[] | — | Seeds the picker's checked set, so the "n/m selected" state is a static story. |
newRoleId | string | "role-new" | Id given to a role created here. Fixed rather than generated — no `Date.now()`. |
className | string | — | 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/SettingsRoleManage.tsx- Portability
- Copies across unchanged — only the utils import path moves.
- Notes
- Use for both creating a new role and editing an existing one; enabling moderation or member-management permissions surfaces a warning banner since those capabilities can be used against other members, and the member picker renders as a drawer on mobile and a dialog on larger screens.