Settings

Stacked cards, one per group of settings.

Updated

Default

Profile

How you appear to others.

AL

Danger zone

Deleting your account cannot be undone.


<div class="flex flex-col gap-4">
	{ui card, title: 'Profile', description: 'How you appear to others.'}
		<div class="flex items-center gap-4">
			{ui avatar, initials: 'AL', class: 'text-2xl' /}
			<div class="grow">
				{ui field, name: 'name', label: 'Name'}
					{ui input, name: 'name', value: 'Ada Lovelace' /}
				{/ui}
			</div>
		</div>
		{block footer}
			{ui button, title: 'Save' /}
		{/block}
	{/ui}
	{ui card, title: 'Danger zone', description: 'Deleting your account cannot be undone.'}
		{block footer}
			{ui button, title: 'Delete account', class: 'bg-destructive' /}
		{/block}
	{/ui}
</div>

One card per group, each with its own action in the footer. A destructive action gets its own card and a bg-destructive button, with no other styling.

Notifications

Notifications

Choose what we email you about.


{ui card, title: 'Notifications', description: 'Choose what we email you about.'}
	<div class="flex flex-col gap-4">
		{ui field}
			{ui switch, name: 'replies', label: 'Replies to my comments', checked: true /}
		{/ui}
		{ui field}
			{ui switch, name: 'mentions', label: 'Mentions', checked: true /}
		{/ui}
		{ui field}
			{ui switch, name: 'digest', label: 'Weekly digest' /}
		{/ui}
	</div>
	{block footer}
		{ui button, title: 'Save' /}
	{/block}
{/ui}

A group of on or off choices is a column of switches. Each switch is its own field, so the server reads them like any other form input. Stack this card with the ones above in the same flex flex-col gap-4.