page templates

<tc-block-settings>

A settings page with a section list on the left driving named content slots on the right.

import "@ra9/tan-compose-kit/blocks/settings"

Props

NameTypeDefaultDescription
titlestring"Settings"Page heading.
descriptionstring"Manage your account and workspace preferences."Text under the heading.
sectionsArray<{ id, label, hint? }> (json)[4 defaults]Left-hand navigation entries.
activestringfirst section idId of the visible section. Reflects to the host attribute.

Events

EventDetailWhen
tc-block-settings-change{ active, previous }Fires when a section is activated.

Slots

SlotDescription
(per section id)One named slot per section id; `<div slot="profile">…</div>` shows when `active === "profile"`.

CSS variables

VariableDefaultDescription
--tc-block-side-bgvar(--tc-color-surface, #ffffff)Section list background.
--tc-block-side-fgvar(--tc-color-ink, #14171f)Section label color.
--tc-block-side-softvar(--tc-color-ink-soft, #4a5061)Inactive section / hint color.
--tc-block-side-active-bgvar(--tc-color-accent-soft, #efe2cf)Active section background.
--tc-block-surfacevar(--tc-color-surface, #ffffff)Content panel background.
--tc-block-rulevar(--tc-color-rule, #ece5d3)Border color.
--tc-block-radiusvar(--tc-radius-lg, 12px)Content panel corner radius.
--tc-block-fontvar(--tc-font-sans, …)Font family.

Examples

<tc-block-settings> is a vertical-tabs layout for preferences pages. Each section's content is a named slot, so the block stays presentation-only and your form controls live in the light DOM.

Basic usage

<tc-block-settings title="Settings" description="Manage your workspace." ></tc-block-settings> import "@ra9/tan-compose-kit/blocks/settings"; const settings = document.querySelector("tc-block-settings"); settings.sections = [ { id: "profile", label: "Profile", hint: "Name and avatar" }, { id: "billing", label: "Billing", hint: "Plan and invoices" }, ];

Slotting sections

<tc-block-settings> <div slot="profile"> <tc-input label="Full name" name="name"></tc-input> </div> <div slot="billing"> <tc-select label="Plan" name="plan"></tc-select> </div> </tc-block-settings>

The blocks demo previews all five page templates with a switcher, including this one — with form controls slotted into each section.