Conversation
Anatomy: Tabs (root) with Tabs.List, Tabs.Trigger, and Tabs.Content, backed by an agnostic core machine (@dunky.dev/tabs) and a React binding (@dunky.dev/react-tabs). WAI-ARIA APG tabs: controlled/uncontrolled selection, roving tabindex, arrow-key navigation with wrap and disabled-tab skipping, horizontal or vertical orientation, automatic or manual activation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Tabs primitive across two packages:
@dunky.dev/tabs— the framework-free core: a state machine (built on@dunky.dev/state-machine) that owns selection, focus movement, and activation behavior, plus aconnectexposing the bindings.@dunky.dev/react-tabs— the thin React binding: a compound<Tabs>component that renders the machine's bindings, adding no behavior of its own.The primitive implements the WAI-ARIA APG tabs pattern: a set of layered content sections (panels) where exactly one panel is shown at a time, selected via its tab.
Anatomy
Tabs— root; owns the machine, wires controlled/uncontrolled value.Tabs.List— therole="tablist"container for triggers.Tabs.Trigger— arole="tab"button;valuelinks it to its content panel.Tabs.Content— arole="tabpanel"shown when itsvalueis selected.Behavior
value+onValueChange) and uncontrolled (defaultValue) selection.Home/Endjump to the first/last enabled tab.orientation="horizontal" | "vertical"switches the active arrow axis andaria-orientation.activationMode="automatic" | "manual": automatic selects on focus; manual selects onEnter/Space/click.aria-selected,aria-controls, andaria-labelledbylink tabs and panels; disabled tabs are skipped, not focus-trapped.Test plan
pnpm test:cipnpm typecheckpnpm lintpnpm format:checkpnpm build🤖 Generated with Claude Code