Skip to content

feat(rune-kit): add composable headless primitives and expose reusable utilities - #3208

Merged
Hona merged 1 commit into
devfrom
feat/headless-components-and-utilities
Dec 2, 2026
Merged

Hona merged 1 commit into
devfrom
feat/headless-components-and-utilities

Conversation

@Hona

@Hona Hona commented Dec 2, 2026

Copy link
Copy Markdown
Member

Adds an additive rune_kit::headless module and exposes rune-kit's shared component-authoring utilities publicly so downstream applications and custom design systems can reuse keyboard navigation, ARIA roles/states, focus management, and floating placement without adopting rune-kit's default visual chrome.

What changed

  • Composable headless primitives (rune_kit::headless):
    • Button, Toggle, Switch, Checkbox — wrap arbitrary caller-supplied El visuals with WAI-ARIA roles, pressed/checked/mixed/expanded/controls/has_popup states, focusability, keyboard activation, and disabled-safe handler attachment.
    • Disclosure + DisclosureState (DisclosurePhase, DisclosureEvent, DisclosureEffect) — explicit open/close state machine and headless trigger/region builder with build_parts() for full layout control.
    • Listbox & Menu (ListboxItem, ListboxItemState, MenuItem) — render-prop / slot-based builders with listbox/option and menu/menuitem ARIA wiring, roving keyboard navigation, disabled-item skipping, type-ahead, and optional anchored popup mounting.
    • Tabs (TabItem, TabState, TabActivation::{Automatic, Manual}) — tablist/tab/tabpanel ARIA wiring, horizontal/vertical orientation, disabled-tab skipping, automatic and manual keyboard activation, and build_parts().
    • Popover — anchors any custom surface El to a keyed trigger with FloatingPlacement, focus return, modal or non-modal outside-press scrim, and Escape dismissal without requiring &Kit.
  • Public reusable utilities:
    • RovingFocus / ListNav (RovingAxis, RovingOutcome), FloatingPlacement / FloatingRect, and Dismiss (outside_dismiss, escape_dismiss, modal_dismiss and *_tx variants).
    • Exposed existing shared internals used by styled components: list_nav (NavStep, NavAction, NavPolicy, TypeAhead, type_select, page_size, allows_list_mods), Grip, Acts, ButtonSkin, over, press_over, Placement::{split, from_parts, opposite_side}, and Kit visual-state/focus/disabled/motion helpers (surface_state, hover_surface, overlay_state, focus_ring, focus_ring_state, disabled_dim, disabled_dim_alpha, apply_*_motion).
  • Backward compatibility: Existing styled rune-kit components remain 100% source- and behavior-compatible and share the same underlying helpers.

Verification

  • cargo test -j 1 -p rune-kit --lib headless (10/10 passed: roving focus arrows/RTL/Home/End/PageUp/PageDown/typeahead/disabled-skip, floating placement flip/align-flip/shift/bounds/round, disclosure state machine & builder, headless Button/Toggle/Switch/Checkbox/Listbox/Menu/Tabs/Popover ARIA & keyboard, public utilities)
  • cargo test -j 1 -p rune-kit --lib list_nav, grip, popover::tests (all passed)
  • cargo check -j 1 -p rune-kit --all-features (passed)
  • cargo check -j 1 -p rune-kit --target wasm32-unknown-unknown (passed)
  • scripts/file-size.sh (0 errors, 0 folder-shape issues)

Fixes #2653

Copilot AI balanced review requested due to automatic review settings December 2, 2026 02:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Hona
Hona merged commit 1dcbb2c into dev Dec 2, 2026
5 checks passed
@Hona
Hona deleted the feat/headless-components-and-utilities branch December 2, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rune-kit: Composable headless components and public reusable utilities

2 participants