bits-ui/SKILL.md
Build, refactor, review, or debug Svelte 5 components that use Bits UI primitives. Use when working with bits-ui dialogs, popovers, dropdowns, comboboxes, selects, tabs, date/time controls, menus, tooltips, portals, render delegation, or Bits UI type helpers.
npx skillsauth add llblab/skills bits-uiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill whenever the task involves bits-ui, Svelte 5 headless UI primitives, or components that wrap Bits UI.
Bits UI is a headless Svelte 5 component library. It owns accessibility, keyboard behavior, focus management, ARIA contracts, compound-component state, and portal/floating mechanics. The app owns visual style, copy, data loading, persistence, and domain policy.
Before implementing or reviewing a Bits UI component, read the local docs that match the surface. Resolve paths relative to this skill directory.
Always start with these when the task is non-trivial:
intro/getting-started.md — installation, import shape, basic compound components.intro/state-management.md — bind: and function bindings.intro/styling.md — class/style props, data attributes, CSS variables, mount-state attributes.intro/child-snippet.md — render delegation, custom elements, floating content wrapper rules.intro/ref.md — bind:ref and delegated refs.Read additional docs as needed:
intro/transitions.md for Svelte transitions, forceMount, and animated content.intro/dates.md for calendar/date/time controls and @internationalized/date values.utilities/merge-props.md when composing wrappers or chaining event handlers.utilities/portal.md for portal targets/stacking behavior.utilities/bits-config.md for global Bits configuration.type-helpers/*.md when typing wrapper props.components/<component>.md for every primitive being used.Component docs live in components/, for example:
dialog.md, alert-dialog.md, popover.md, tooltip.md, dropdown-menu.md, context-menu.md, link-preview.md.select.md, combobox.md, radio-group.md, checkbox.md, switch.md, toggle.md, toggle-group.md.tabs.md, accordion.md, collapsible.md, navigation-menu.md, menubar.md, toolbar.md, separator.md, scroll-area.md, pagination.md.calendar.md, date-field.md, date-picker.md, date-range-field.md, date-range-picker.md, range-calendar.md, time-field.md, time-range-field.md.progress.md, meter.md, slider.md, rating-group.md, pin-input.md, avatar.md, aspect-ratio.md, label.md, button.md, command.md.bits-ui and compose the documented Root, Trigger, Portal, Content, Item, Group, etc. parts. Do not skip required structure for accessibility.bind:open, bind:value, bind:checked, etc. for simple state. Use Svelte function bindings for validation, business rules, transformations, or external stores.Dialog.RootProps, Combobox.ContentProps, etc. Use Bits type helpers (WithoutChild, WithoutChildren, WithoutChildrenOrChild, WithElementRef) when removing/overriding snippets or exposing refs.bind:ref, pass custom id to the Bits component, not directly to the delegated child element.mergeProps when composing user props with internal props/handlers/classes/styles. Remember that event handlers chain and event.preventDefault() stops later event handlers.Use child snippets when you need scoped styles, Svelte transitions/actions, app components, or exact DOM control.
Standard delegated element:
<Component.Part>
{#snippet child({ props })}
<button {...props} class="...">...</button>
{/snippet}
</Component.Part>
Floating content requires a two-level structure:
<Popover.Content forceMount>
{#snippet child({ wrapperProps, props, open })}
{#if open}
<div {...wrapperProps}>
<div {...props} class="...">...</div>
</div>
{/if}
{/snippet}
</Popover.Content>
Rules:
{...props} onto the actual interactive/content element.{...wrapperProps} onto an unstyled outer wrapper.child snippet and expect them to matter; delegated children are ignored.Floating components that need the wrapper pattern include Combobox.Content, DatePicker.Content, DateRangePicker.Content, DropdownMenu.Content, LinkPreview.Content, Menubar.Content, Popover.Content, Select.Content, and Tooltip.Content.
Bits UI Svelte 5 does not use old transition* props. For Svelte transitions:
forceMount on the conditionally mounted part.child snippet.open is true.For CSS-only mount animations, prefer documented state attributes such as data-starting-style and data-ending-style when available.
class props for simple Tailwind styling.data-* selectors for consistent global styling of repeated parts.data-state="open", data-state="closed", and data-disabled for state styling.When using Calendar, DatePicker, DateField, TimeField, or range variants:
@internationalized/date types (CalendarDate, CalendarDateTime, ZonedDateTime, DateValue) as documented.@internationalized/date if the project does not already include it..set(), .add(), .subtract(), or .cycle().placeholder to control initial visible date/type when no value is selected.Date only at app boundaries where needed.Before finishing Bits UI work, verify:
npm run check, svelte-check, unit tests, or the project's documented command).wrapperProps element instead of the inner content element.{...props} in a child snippet.id only on a delegated child, breaking bind:ref tracking.forceMount plus snippets.development
Manage a guarded release flow that commits prepared release work on dev, opens a dev-to-main pull request with a release-focused PR summary, waits for checks, merges on success, tags, and optionally publishes an existing npm package. Use when the user asks to prepare or execute a dev→main release PR, hotfix release PR, or Dev2Main PR Summary workflow.
development
Evidence-grounded review for code, diffs, PRs, documents, plans, specs, and architecture. Use for evidence review, review, code review, quick review, sanity check, quality check, architecture review, production readiness, security review, scaling review, document review, evaluate, or check.
development
Collaborative idea-to-design and inquiry protocol. Use for product/architecture exploration, research-style question shaping, feature design, standards, specs, UX concepts, module boundaries, and non-trivial behavior changes when uncertainty matters.
development
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.