Settings
Settings access
The Access pane of space settings, combining a public/private visibility chooser with a stack of access-tier cards and a Save/Cancel action row.
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 access
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 |
|---|---|---|---|
tiers | AccessTier[] | [] | The tiers to render, in order. Owned by the caller. |
defaultTierId | string | null | null | Id of the default tier. When exactly one tier exists it is treated as default regardless. |
accessType | SpaceAccessType | — | Controlled access type. Supply with `onAccessTypeChange`. |
initialAccessType | SpaceAccessType | "public" | Seeds the uncontrolled access type — also the baseline `hasChanges` compares against. |
onAccessTypeChange | (next: SpaceAccessType) => void | — | Undocumented — add TSDoc to the prop in the library. |
onAddTier | () => void | — | Undocumented — add TSDoc to the prop in the library. |
onUpdateTier | (id: string, updates: Partial<Omit<AccessTier, "id">>) => void | — | Undocumented — add TSDoc to the prop in the library. |
onRemoveTier | (id: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
onMakeDefaultTier | (id: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
onCopyTierLink | (tier: AccessTier, url: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
onSave | () => void | — | Undocumented — add TSDoc to the prop in the library. |
onCancel | () => void | — | Undocumented — add TSDoc to the prop in the library. |
hasChanges | boolean | — | Forces the dirty state of the Save/Cancel pair. Left undefined the pane computes it from the access-type radio alone — tier edits are the caller's to track, since the tiers themselves are props. |
maxTiers | number | 5 | Cap on tiers. Above it the dashed "Add access tier" button disappears. |
learnMoreHref | string | "#" | Target for the "Learn more" link in the tiers description. |
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/SettingsAccess.tsx- Portability
- Copies across unchanged — only the utils import path moves.
- Notes
- Use it on the space settings screen where an operator sets who can join and what each tier costs. A single tier is always treated as the default regardless of the configured default id, and the add-tier button disappears entirely once the tier cap is reached rather than disabling.