Cookbook / Tabs

Tabs

container

Tabs — derived() computes the selected tab, each/key renders the tablist, onMount picks the initial tab.

id
aihu-tabs
since
0.5.0
file
aihu-tabs.aihu
propstatederivedactiononMounteachkeyifelsegroupon:clickinterpolation

Run it

source · static

This recipe doesn't have a hydrated island in the demo gallery yet. An in-browser, WASM-compiled playground (edit this source and re-render live) is planned as a follow-up — read the real source below.

Source

aihu-tabs.aihu

Requires

concerns
statea11y

Anti-patterns

  • Do not recompute the active tab inline in the template — derived() memoizes the selection once for every read site.

Related recipes