-
Notifications
You must be signed in to change notification settings - Fork 464
feat(ui): Settings block
#9377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(ui): Settings block
#9377
Changes from all commits
c30f053
7d5faf9
2c8760c
5a6ccdb
0cd0c3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import * as SettingsStories from './settings.stories'; | ||
|
|
||
| # Settings | ||
|
|
||
| A settings block that carries the canonical section, surface, row grouping, and item layout. Use it for product settings while composing each item's media, content, and actions as needed. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```tsx | ||
| import { Settings } from '@clerk/ui/mosaic/block/settings'; | ||
|
|
||
| <Settings.Root> | ||
| <Settings.Title>Account</Settings.Title> | ||
| <Settings.Group> | ||
| <Settings.Row> | ||
| <Settings.Item> | ||
| <Settings.Media>{icon}</Settings.Media> | ||
| <Settings.Content> | ||
| <Settings.Label>Name</Settings.Label> | ||
| <Settings.Description>Shown throughout the application.</Settings.Description> | ||
| </Settings.Content> | ||
| <Settings.Actions>{control}</Settings.Actions> | ||
| </Settings.Item> | ||
| </Settings.Row> | ||
| </Settings.Group> | ||
| </Settings.Root> | ||
| ``` | ||
|
|
||
| `Settings.Group` owns the outlined surface. Its direct `Settings.Row` children own separation and may stack one or more `Settings.Item` entries. Each item lays out optional media, flexible content, and trailing actions. `Settings.Media` accepts `md` and `lg` sizes. | ||
|
|
||
| Use `Settings.Items` for a nested value list beneath a row's header item. The row keeps an 8px header-to-list gap, nested items stack without gaps at a 44px minimum height, and their content receives 12px vertical padding. | ||
|
|
||
| Override `--cl-settings-items-gap` on `Settings.Root` or a specific `Settings.Row` to customize the space between the row header and its nested value list. It defaults to 8px. | ||
|
|
||
| ## Examples | ||
|
|
||
| <Story | ||
| name='Default' | ||
| storyModule={SettingsStories} | ||
| composition={[ | ||
| { name: 'Avatar', href: '/components/avatar', layer: 'Components' }, | ||
| { name: 'Button', href: '/components/button', layer: 'Components' }, | ||
| ]} | ||
| /> | ||
|
|
||
| ### Multiple email addresses and phone numbers | ||
|
|
||
| <Story | ||
| name='MultipleEmailAndPhoneNumbers' | ||
| storyModule={SettingsStories} | ||
| composition={[ | ||
| { name: 'Badge', href: '/components/badge', layer: 'Components' }, | ||
| { name: 'Button', href: '/components/button', layer: 'Components' }, | ||
| { name: 'Icon', href: '/components/icon', layer: 'Components' }, | ||
| ]} | ||
| /> | ||
|
|
||
| ### Connected accounts | ||
|
|
||
| <Story | ||
| name='ConnectedAccounts' | ||
| storyModule={SettingsStories} | ||
| composition={[ | ||
| { name: 'Button', href: '/components/button', layer: 'Components' }, | ||
| { name: 'Icon', href: '/components/icon', layer: 'Components' }, | ||
| ]} | ||
| /> | ||
|
|
||
| ### Destructive setting | ||
|
|
||
| <Story | ||
| name='Destructive' | ||
| storyModule={SettingsStories} | ||
| /> | ||
|
Comment on lines
+7
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use the compound component page structure.
Use As per coding guidelines, “Compound Components pages must use the exact section order: 🤖 Prompt for AI AgentsSources: Coding guidelines, Learnings |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Add a release entry for
@clerk/ui.This PR adds the public
SettingsAPI. An empty changeset produces no@clerk/uirelease or changelog entry. Add the appropriate version bump and a concise release note.Proposed changeset
As per coding guidelines, “Use Changesets for version management and changelogs.” Based on learnings, empty changesets apply only when changes do not include functionality changes.
📝 Committable suggestion
🤖 Prompt for AI Agents
Sources: Coding guidelines, Learnings