Migration Guide
Learn how to migrate from 0.x to 1.x
Bits UI v1 is a major update that introduces significant improvements, but it also comes with breaking changes. Since anything before v1.0 was a pre-release, backward compatibility was not guaranteed. This guide will help you transition smoothly, though it may not cover every edge case.
We highly recommend reviewing the documentation for each component you use, as their APIs may have changed.
Note
Looking for the old documentation? You can still access Bits UI v0.x at v0.bits-ui.com. However, we encourage you to migrate as soon as possible to take advantage of the latest features and improvements.
Why Upgrade?
Bits UI has been completely rewritten for Svelte 5, bringing several key benefits:
- Performance improvements – Faster rendering and reduced overhead.
- More flexible APIs – Easier customization and integration.
- Bug fixes and stability – Addressing every bug and issue from v0.x.
- Better developer experience – Improved consistency and documentation.
Once you get familiar with Bits UI v1, we're confident you'll find it to be a more powerful and streamlined headless component library.
Shared Changes
el
prop replaced withref
: Theel
prop has been removed across all components that render and HTML element. Use theref
prop instead. See the ref documentation for more information.asChild
prop replaced withchild
snippet: Components that previously usedasChild
now use thechild
snippet prop. See the Child Snippet documentation.- Transition props removed: Components no longer accept
transition
props. Instead, use thechild
snippet along withforceMount
to leverage Svelte transitions. More details in the Transitions documentation. let:
directives replaced with snippet props: Components that used to expose data vialet:
directives now provide it throughchildren
/child
snippet props.
Accordion
- The
multiple
prop has been removed from theAccordion.Root
component and replaced with a requiredtype
prop which can be set to either'single'
or'multiple'
. This is used as a discriminant to properly type thevalue
prop as either astring
orstring[]
. - The various
transition
props have been removed from theAccordion.Content
component. See the Transitions documentation for more information.
See the Accordion documentation for more information.
Alert Dialog
- The various
transition
props have been removed from theAlertDialog.Content
andAlertDialog.Overlay
components. See the Transitions documentation for more information. - To render the dialog content in a portal, you now must wrap the
AlertDialog.Content
in theAlertDialog.Portal
component. - The
AlertDialog.Action
component no longer closes the dialog by default, as we learned it was causing more harm than good when attempting to submit a form with theAction
button. See the Form Submission section for more information on how to handle submitting forms before closing the dialog.
Button
- The
Button
component no longer accepts abuilders
prop, instead you should use thechild
snippet on the various components to receive/pass the attributes to the underlying button. See Child Snippet for more information.
Checkbox
- The
Checkbox.Indicator
component has been removed in favor of using thechildren
snippet prop to get a reference to thechecked
state and render a custom indicator. See the Checkbox documentation for more information. - The
Checkbox.Input
component has been removed in favor of automatically rendering a hidden input when thename
prop is provided to theCheckbox.Root
component. - The
checked
state of theCheckbox
component is now of typeboolean
instead ofboolean | 'indeterminate'
,indeterminate
is its own state now and can be managed via theindeterminate
prop. - A new component,
Checkbox.Group
has been introduced to support checkbox groups.
See the Checkbox documentation for more information.
Combobox
- The
multiple
prop has been removed from theCombobox.Root
component and replaced with a requiredtype
prop which can be set to either'single'
or'multiple'
. This is used as a discriminant to properly type thevalue
prop as either astring
orstring[]
. - The
selected
prop has been replaced with avalue
prop, which is limited to astring
(orstring[]
iftype="multiple"
). - The combobox now automatically renders a hidden input when the
name
prop is provided to theCombobox.Root
component. - The
Combobox.ItemIndicator
component has been removed in favor of using thechildren
snippet prop to get a reference to theselected
state and render a custom indicator. See the Combobox documentation for more information. Combobox.Group
andCombobox.GroupHeading
have been added to support groups within the combobox.- In Bits UI v0, the
Combobox.Content
was automatically portalled unless you explicitly set theportal
prop tofalse
. In v1, we provide aCombobox.Portal
component that you can wrap around theCombobox.Content
to portal the content.Combobox.Portal
accepts ato
prop that can be used to specify the target portal container (defaults todocument.body
), and adisabled
prop that can be used to disable portalling.
Context Menu/Dropdown Menu/Menubar Menu
- The
*Menu.RadioIndicator
and*Menu.CheckboxIndicator
components have been removed in favor of using thechildren
snippet prop to get a reference to thechecked
orselected
state and render a custom indicator. See the Context Menu, Dropdown Menu, and Menubar documentation for more information. - The
*Menu.Label
component, which was used as the heading for a group of items has been replaced with the*Menu.GroupHeading
component. - The
href
prop on the.Item
components has been removed in favor of thechild
snippet and rendering your own anchor element. - In Bits UI v0, the
*Menu.Content
was automatically portalled unless you explicitly set theportal
prop tofalse
. In v1, we provide a*Menu.Portal
component that you can wrap around the*Menu.Content
to portal the content.*Menu.Portal
accepts ato
prop that can be used to specify the target portal container (defaults todocument.body
), and adisabled
prop that can be used to disable portalling.
Pin Input
- The
PinInput
component has been completely overhauled to better act as an OTP input component, with code and inspiration taken from Input OTP by Guilherme Rodz. The best way to migrate is to reference the Pin Input documentation to see how to use the new component.
Popover
- In Bits UI v0, the
Popover.Content
was automatically portalled unless you explicitly set theportal
prop tofalse
. In v1, we provide aPopover.Portal
component that you can wrap around thePopover.Content
to portal the content.Popover.Portal
accepts ato
prop that can be used to specify the target portal container (defaults todocument.body
), and adisabled
prop that can be used to disable portalling.
Radio Group
RadioGroup.ItemIndicator
has been removed in favor of using thechildren
snippet prop to get a reference to thechecked
state which provides more flexibility to render a custom indicator as needed. See the Radio Group documentation for more information.
Scroll Area
ScrollArea.Content
has been removed as it is not necessary for functionality in Bits UI v1.
Select
- The
multiple
prop has been removed from theSelect.Root
component and replaced with a requiredtype
prop which can be set to either'single'
or'multiple'
. This is used as a discriminant to properly type thevalue
prop as either astring
orstring[]
. - The
selected
prop has been replaced with avalue
prop, which is limited to astring
(orstring[]
iftype="multiple"
). - The select now automatically renders a hidden input when the
name
prop is provided to theSelect.Root
component. - The
Select.ItemIndicator
component has been removed in favor of using thechildren
snippet prop to get a reference to theselected
state and render a custom indicator. See the Select documentation for more information. Select.Group
andSelect.GroupHeading
have been added to support groups within the Select.Select.Value
has been removed in favor of enabling developers to use thevalue
prop to render your own custom label in the trigger to represent the value.- In Bits UI v0, the
Select.Content
was automatically portalled unless you explicitly set theportal
prop tofalse
. In v1, we provide aSelect.Portal
component that you can wrap around theSelect.Content
to portal the content.Select.Portal
accepts ato
prop that can be used to specify the target portal container (defaults todocument.body
), and adisabled
prop that can be used to disable portalling.
Slider
Slider.Root
now requires atype
prop to be set to either'single'
or'multiple'
to properly type thevalue
as either anumber
ornumber[]
.- A new prop,
onValueCommit
has been introduced which is called when the user commits a value change (e.g. by releasing the mouse button or pressing Enter). This is useful for scenarios where you want to update the value only when the user has finished interacting with the slider, not for each movement of the thumb.
Tooltip
- A required component necessary to provide context for shared tooltips,
Tooltip.Provider
has been added. This replaces thegroup
prop on the previous version'sTooltip
component. You can wrap your entire app withTooltip.Provider
, or wrap a specific section of your app with it to provide shared context for tooltips.