Base UI

Knowledge base from the Base UI (base-ui.com, @base-ui/react) documentation — unstyled, accessible React component library from the creators of Radix, Material UI, and Floating UI. Use when building with Base UI directly, looking up a component's anatomy/props/data-attributes, choosing between similar components (Dialog vs AlertDialog vs Drawer, Autocomplete vs Combobox vs Select), or implementing composition/styling/animation patterns like the render prop, data-state styling, or collision-aware positioning. Also relevant when working in shadcn/ui, since shadcn/ui is now built on Base UI.

51 capítulos

Base UI

Package: @base-ui/react | Components: 45 | Guides: 6 | Utilities: 4 | Generated: 2026-08-25

How to Use This Skill

  • Without arguments — load Core Patterns below for the composition/styling conventions shared across every component
  • With a component name — ask about Dialog, Select, Forms-style topics; I find and read the matching chapter
  • With a chapter — ask for ch021; I load that specific chapter
  • Browse — ask "what chapters do you have?" to see the full index

When you ask about a topic not covered in Core Patterns below, I will read the relevant chapter file before answering.


Core Patterns & Conventions

Anatomy first. Every component is Root + named sub-parts (Trigger, Popup, Item...) — always start from a component's Anatomy before reaching for individual props.

render is the universal composition prop — not asChild. Nearly every part accepts render={<Element/>} (swap the rendered element) or render={(props, state) => <el/>} (function form, full control + state access). The target must spread props and forward its ref. Coming from Radix Primitives: render replaces asChild conceptually, but the syntax differs.

Style off data-*, never off tracked JS state. Stateful parts expose data-* attributes (data-open/data-closed, data-checked, data-highlighted, data-disabled, ...) — target these directly in CSS/CSS-in-JS. className/style also accept a (state) => value function form for anything not already exposed as a data attribute.

Unstyled by design. Nothing renders visually except structure and behavior — plan both functional (positioning/sizing) and presentational styles from the start.

Positioned overlays share one API. Menu, Popover, Select, Combobox, Autocomplete, Tooltip, ContextMenu, NavigationMenu, PreviewCard, and Toast all expose the same side/align/collisionBoundary/sticky family on Positioner, and the same --anchor-width/-height, --available-width/-height, --transform-origin CSS variables. Learn it once on any of them — except Select's alignItemWithTrigger mode, which overrides side/align while active.

CSS transitions animate [data-starting-style]/[data-ending-style]; JS animation needs keepMounted. CSS transitions/keyframes work out of the box keyed off data-* state. A JS library (Motion) needs Portal keepMounted + AnimatePresence, or a state.open-driven render function for always-mounted components — and must animate opacity (even minimally) so Base UI's getAnimations() completion check fires.

Detached triggers use Handle. Component.createHandle() + the handle prop connects a Trigger to a Root that isn't its sibling (Dialog, AlertDialog, Popover, Menu, Tooltip, PreviewCard, Drawer) — call handle.open()/.close() only from event handlers/effects.

Form controls share one field-state vocabulary. data-valid/data-invalid, data-dirty, data-touched, data-filled, data-focused recur on nearly every form-capable component; Field.Root name="..." + Fieldset.Root render={<Group/>} is the accessible naming/validation/grouping backbone (ch009, ch023, ch024).

Roving tabindex is built in. Menu items, radio items, tabs, toggle groups, toolbar items share one Tab stop with internal arrow-key movement — configure loopFocus/orientation, don't hand-roll it.

Accessibility is opinionated, not optional. ARIA roles, keyboard interaction, and focus management (initialFocus/finalFocus) are handled internally — visual focus styling, color contrast, and accessible labelling (aria-label, Field.Label) are still your responsibility.


Chapter Index

Overview

#TitleKey Concepts
ch001Introductionheadless, render prop origin, shadcn/ui foundation
ch002Getting Startedinstall, portal stacking, iOS Safari fix
ch003Accessibilitykeyboard nav, focus management, contrast
ch004Releases & Versioning1.0.0 milestone, canary installs

Handbook

#TitleKey Concepts
ch005StylingclassName/style function form, data attributes, CSS variables
ch006AnimationCSS transitions/keyframes, Motion integration patterns
ch007Compositionrender prop, nesting, function form
ch008CustomizationeventDetails, cancel/allowPropagation, controlled state
ch009Formsnaming, constraint/custom/server validation, RHF/TanStack
ch010TypeScriptProps/State/ChangeEventDetails namespaces

Components

#TitleKey Concepts
ch011Accordionmultiple, panel height CSS var
ch012Alert DialogHandle, nested dialogs, initialFocus
ch013Autocompletefree-form text, filtering, grid mode
ch014AvatarImage/Fallback, delay
ch015ButtonnativeButton, never for links
ch016Checkboxtri-state, indeterminate, labeling patterns
ch017Checkbox Groupparent checkbox, allValues
ch018Collapsiblesingle-panel open/close
ch019Comboboxfilterable Select, chips, multi-select
ch020Context Menuright-click, must be an enhancement
ch021Dialogmodal, Handle, no gesture support
ch022Drawerswipe, snap points, indent effect
ch023FieldLabel/Control/Error, shared state attributes
ch024Fieldsetgroup labeling via render composition
ch025Formerrors, onFormSubmit, validationMode
ch026Inputplain text control
ch027Menuitems, submenus, Viewport transitions
ch028Menubarcross-menu arrow navigation
ch029Meterstatic read-only gauge
ch030Navigation Menushared Viewport, site nav
ch031Number Fieldscrubbing, stepping, locale formatting
ch032OTP FieldautoSubmit, mask, autoComplete
ch033Popovernon-modal default, hover trigger
ch034Preview Cardhover-only, sighted-mouse-only
ch035Progressindeterminate, complete, progressing
ch036Radiomutually exclusive, RadioGroup
ch037Scroll Areanative scroll, overlay scrollbar
ch038SelectalignItemWithTrigger, no filtering
ch039Separatororientation
ch040Slidermulti-thumb, minStepsBetweenValues
ch041Switchtwo-state, no indeterminate
ch042TabsIndicator, activateOnFocus, keepMounted
ch043Toastimperative manager, stacking CSS vars
ch044Togglesingle pressed/unpressed button
ch045Toggle Groupmultiple vs. exclusive
ch046Toolbarmixed controls, one input max
ch047Tooltipsighted-only, disabled on touch

Utilities

#TitleKey Concepts
ch048CSP Providernonce, disableStyleElements
ch049Direction ProviderRTL behavior, useDirection
ch050mergePropsclassName/style/handler merging
ch051useRenderbuilding your own render-accepting component

Topic Index

  • Accessibility (general) → ch003, ch009
  • Animation (CSS) → ch006, ch011, ch018
  • Animation (Motion/JS) → ch006, ch038
  • render / composition → ch001, ch007, ch051
  • Collision-aware positioning → ch013, ch019, ch020, ch027, ch030, ch033, ch034, ch038, ch043, ch047
  • Data attributes / styling → ch005
  • Detached triggers (Handle) → ch012, ch021, ch027, ch033, ch034
  • Focus management → ch003, ch012, ch021
  • Forms / validation → ch009, ch023, ch024, ch025
  • Form-compatible controls → ch016, ch017, ch025, ch031, ch036, ch040, ch041
  • Gestures / swipe → ch022, ch043
  • Menu family (items, checkbox items, radio items, submenus) → ch020, ch027, ch028
  • Multi-thumb / multi-select → ch017, ch019, ch038, ch040, ch045
  • Portal / DOM escape → ch002
  • RTL / direction → ch049
  • Roving tabindex → ch020, ch027, ch036, ch042, ch045, ch046
  • Server-side rendering → ch010
  • TypeScript namespaces → ch010, ch051
  • Versioning / changelog → ch004

Supporting Files

Scope & Limits

This skill covers the Base UI (@base-ui/react) documentation as of the fetch date in the source (2026-08-23) — component anatomy, props/data-attributes/CSS variables, and the Handbook guides (styling, animation, composition, customization, forms, TypeScript). The 30+ dated changelog entries in the source are not reproduced 1:1 — ch004 summarizes the versioning approach and cites only notable milestones.

Relationship to radix-primitives-docs. Both skills cover unstyled, accessible React primitive libraries — Base UI (from the team behind Radix, Material UI, and Floating UI) and Radix Primitives (WorkOS) are competing primitive layers, not one built on the other. As of this documentation, shadcn/ui is built on Base UI, not Radix — a shift from shadcn/ui's earlier Radix-based versions. If working in a shadcn/ui codebase, check which underlying primitive library the installed version actually uses before consulting either skill. Base UI additionally ships several components Radix Primitives doesn't have in this project's indexed set: Autocomplete, Combobox, Toast, Meter, NumberField, OTPField, PreviewCard, Drawer, CSPProvider. The core API difference to remember when moving between them: Base UI's composition prop is render (element or function form); Radix's is asChild (always paired with a literal child element).