From 6eb62b48b90005ca763550c0967f17b28d7dcba4 Mon Sep 17 00:00:00 2001 From: Pavel Grinchenko Date: Sun, 28 Jun 2026 00:01:52 +0100 Subject: [PATCH] docs: fix incomplete tab panel snippet in cookbook Complete the truncated effect to toggle panel visibility via context $active, matching the working tabs example. Drop unused register field from TabsAPI so the snippet type-checks. Closes #12 --- apps/docs/src/content/docs/cookbook.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/docs/src/content/docs/cookbook.md b/apps/docs/src/content/docs/cookbook.md index 6c9b807..0c929d7 100644 --- a/apps/docs/src/content/docs/cookbook.md +++ b/apps/docs/src/content/docs/cookbook.md @@ -149,7 +149,7 @@ When components form a logical group (Tabs/Tab, Accordion/Panel), the parent pro ```typescript import { createContext } from "nanotags/context"; -type TabsAPI = { register: (el: Element) => void; $active: WritableAtom }; +type TabsAPI = { $active: WritableAtom }; const tabsContext = createContext("tabs"); const XTabs = define("x-tabs").setup((ctx) => { @@ -165,7 +165,7 @@ define("x-tab-panel") .withContexts({ tabs: tabsContext }) .setup((ctx) => { ctx.effect(ctx.contexts.tabs.$active, (active) => { - ctx.host.setAttribute('aria-) + ctx.host.hidden = active !== ctx.props.$value.get(); }) }); ```