Skip to content
Dice UI

December 2026 - Controlled Components and Shared Hooks

Controlled components follow their props exactly, change callbacks run only for user actions, and every base uses the same hooks and stores from @base-ui/utils. Includes breaking changes.

Components with shared state now keep it the same way in both bases, on ReactStore from @base-ui/utils/store or on plain React state. Two controlled-mode bugs are gone with it.

Controlled components

  • Fully controlled. When you pass a value and reject a change in its callback, the component keeps rendering your value. Before, the rejected value still rendered.
  • Callbacks only for user actions. Changing a controlled prop no longer calls its change callback with the value you just passed.

Both apply to Angle Slider, Color Picker, Compare Slider, Cropper, Editable, File Upload, Key Value, Phone Input, Rating, Responsive Dialog, Scroll Spy, Selection Toolbar, Speed Dial, Stepper, Swap, Time Picker and Tour.

Stores

Each component's store is a ReactStore read with the standalone useStore(store, selector) hook, the same pattern tablecn uses. React Compiler can compile these components. The store's public selector hooks, such as useRating, useCropper and useSelectionToolbar, keep their names and signatures.

Breaking changes

  • Removed hook registry items. The use-as-ref, use-lazy-ref, use-isomorphic-layout-effect, use-ref-with-init and use-value-as-ref items are removed from both bases, as the October changelogs announced. shadcn add @diceui/use-as-ref and the others now return 404. Components import these hooks from @base-ui/utils instead. See Migrating.
  • Controlled or uncontrolled is decided once. Editable, Key Value, Phone Input, Responsive Dialog, Swap and Faceted's open now decide on their first render whether they're controlled, like Base UI's own inputs. Switching a prop between a value and undefined logs a warning in development and isn't followed. Pass a defined value from the start, such as value={user?.name ?? ""}.
  • Selector hooks take one argument. useEditable, useKeyValueStore, usePhoneInput and useSwap keep their names and their selector argument, but drop an undocumented second argument whose type was never exported.
  • Tour onSkip. onSkip runs only when the user closes the tour, not when the parent closes it through open.

Other fixes

  • Color Picker calls onValueChange once per change instead of twice, applies a controlled format after mount, and keeps alpha and hue that a controlled hex value can't carry.
  • Time Picker in Base UI stays open with openOnFocus when you press another segment, as the Radix version does.
  • Selection Toolbar asks to open once per selection while a controlled open stays false, instead of on every selection or scroll update.
  • Scroll Spy scrolls to a controlled value it didn't report itself, even after a change the parent rejected.
  • Visually Hidden uses Base UI's hidden styles, which position the element fixed instead of absolute. Visually Hidden Input stays absolute.
  • File Upload calls onValueChange once when files are accepted in controlled mode, instead of twice.
  • Cropper no longer resets the crop on every parent render when crop isn't passed.
  • Tour calls onStepLeave with the step being left, not the step being entered.
  • Stepper enables StepperNext as soon as its steps mount, and in manual activation mode arrow keys move focus without activating steps.
  • Angle Slider moves its thumbs when min, max, startAngle, endAngle or inverted change.
  • Base UI components render their data-disabled, data-readonly, data-invalid and similar attributes. They were left out before, so styles that select on them didn't apply.
  • Data Grid and the Data Table range and slider filters handle focus, outside clicks and keyboard shortcuts inside shadow DOM and iframes, where they used to read the top-level document.
  • Stack in Base UI renders data-front, data-visible and data-expanded as true or false, as the docs and the Radix version do.

Hooks

Components in every base, Radix included, now import their small hooks and helpers from @base-ui/utils instead of copying them into your project. The registry pins the version the components are tested with, @base-ui/utils@0.5.0.

Migrating

Existing components keep working, because your copies of the hooks stay in place. To drop them, reinstall the components, or update the imports yourself:

Radix
import { useComposedRefs, useLayoutEffect } from "radix-ui/internal"; 
import { useRefWithInit } from "@/hooks/use-ref-with-init"; 
import { useValueAsRef } from "@/hooks/use-value-as-ref"; 
import { useIsoLayoutEffect } from "@base-ui/utils/useIsoLayoutEffect"; 
import { useMergedRefs } from "@base-ui/utils/useMergedRefs"; 
import { useRefWithInit } from "@base-ui/utils/useRefWithInit"; 
import { useValueAsRef } from "@base-ui/utils/useValueAsRef"; 

Then rename useComposedRefs to useMergedRefs and useLayoutEffect to useIsoLayoutEffect, and delete the hook files.

On this page