Migration Guide
Learn how to migrate from 0.x to 1.x+
Bits UI v1
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
elprop replaced withref: Theelprop has been removed across all components that render and HTML element. Use therefprop instead. See the ref documentation for more information.asChildprop replaced withchildsnippet: Components that previously usedasChildnow use thechildsnippet prop. See the Child Snippet documentation.- Transition props removed: Components no longer accept
transitionprops. Instead, use thechildsnippet along withforceMountto 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/childsnippet props.
Accordion
- The
multipleprop has been removed from theAccordion.Rootcomponent and replaced with a requiredtypeprop which can be set to either'single'or'multiple'. This is used as a discriminant to properly type thevalueprop as either astringorstring[]. - The various
transitionprops have been removed from theAccordion.Contentcomponent. See the Transitions documentation for more information.
See the Accordion documentation for more information.
Alert Dialog
- The various
transitionprops have been removed from theAlertDialog.ContentandAlertDialog.Overlaycomponents. See the Transitions documentation for more information. - To render the dialog content in a portal, you now must wrap the
AlertDialog.Contentin theAlertDialog.Portalcomponent. - The
AlertDialog.Actioncomponent no longer closes the dialog by default, as we learned it was causing more harm than good when attempting to submit a form with theActionbutton. See the Form Submission section for more information on how to handle submitting forms before closing the dialog.
Button
- The
Buttoncomponent no longer accepts abuildersprop, instead you should use thechildsnippet on the various components to receive/pass the attributes to the underlying button. See Child Snippet for more information.
Checkbox
- The
Checkbox.Indicatorcomponent has been removed in favor of using thechildrensnippet prop to get a reference to thecheckedstate and render a custom indicator. See the Checkbox documentation for more information. - The
Checkbox.Inputcomponent has been removed in favor of automatically rendering a hidden input when thenameprop is provided to theCheckbox.Rootcomponent. - The
checkedstate of theCheckboxcomponent is now of typebooleaninstead ofboolean | 'indeterminate',indeterminateis its own state now and can be managed via theindeterminateprop. - A new component,
Checkbox.Grouphas been introduced to support checkbox groups.
See the Checkbox documentation for more information.
Combobox
- The
multipleprop has been removed from theCombobox.Rootcomponent and replaced with a requiredtypeprop which can be set to either'single'or'multiple'. This is used as a discriminant to properly type thevalueprop as either astringorstring[]. - The
selectedprop has been replaced with avalueprop, which is limited to astring(orstring[]iftype="multiple"). - The combobox now automatically renders a hidden input when the
nameprop is provided to theCombobox.Rootcomponent. - The
Combobox.ItemIndicatorcomponent has been removed in favor of using thechildrensnippet prop to get a reference to theselectedstate and render a custom indicator. See the Combobox documentation for more information. Combobox.GroupandCombobox.GroupHeadinghave been added to support groups within the combobox.- In Bits UI v0, the
Combobox.Contentwas automatically portalled unless you explicitly set theportalprop tofalse. In v1, we provide aCombobox.Portalcomponent that you can wrap around theCombobox.Contentto portal the content.Combobox.Portalaccepts atoprop that can be used to specify the target portal container (defaults todocument.body), and adisabledprop that can be used to disable portalling.
Context Menu/Dropdown Menu/Menubar Menu
- The
*Menu.RadioIndicatorand*Menu.CheckboxIndicatorcomponents have been removed in favor of using thechildrensnippet prop to get a reference to thecheckedorselectedstate and render a custom indicator. See the Context Menu, Dropdown Menu, and Menubar documentation for more information. - The
*Menu.Labelcomponent, which was used as the heading for a group of items has been replaced with the*Menu.GroupHeadingcomponent. - The
hrefprop on the.Itemcomponents has been removed in favor of thechildsnippet and rendering your own anchor element. - In Bits UI v0, the
*Menu.Contentwas automatically portalled unless you explicitly set theportalprop tofalse. In v1, we provide a*Menu.Portalcomponent that you can wrap around the*Menu.Contentto portal the content.*Menu.Portalaccepts atoprop that can be used to specify the target portal container (defaults todocument.body), and adisabledprop that can be used to disable portalling.
Pin Input
- The
PinInputcomponent 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.Contentwas automatically portalled unless you explicitly set theportalprop tofalse. In v1, we provide aPopover.Portalcomponent that you can wrap around thePopover.Contentto portal the content.Popover.Portalaccepts atoprop that can be used to specify the target portal container (defaults todocument.body), and adisabledprop that can be used to disable portalling.
Radio Group
RadioGroup.ItemIndicatorhas been removed in favor of using thechildrensnippet prop to get a reference to thecheckedstate which provides more flexibility to render a custom indicator as needed. See the Radio Group documentation for more information.
Scroll Area
ScrollArea.Contenthas been removed as it is not necessary for functionality in Bits UI v1.
Select
- The
multipleprop has been removed from theSelect.Rootcomponent and replaced with a requiredtypeprop which can be set to either'single'or'multiple'. This is used as a discriminant to properly type thevalueprop as either astringorstring[]. - The
selectedprop has been replaced with avalueprop, which is limited to astring(orstring[]iftype="multiple"). - The select now automatically renders a hidden input when the
nameprop is provided to theSelect.Rootcomponent. - The
Select.ItemIndicatorcomponent has been removed in favor of using thechildrensnippet prop to get a reference to theselectedstate and render a custom indicator. See the Select documentation for more information. Select.GroupandSelect.GroupHeadinghave been added to support groups within the Select.Select.Valuehas been removed in favor of enabling developers to use thevalueprop to render your own custom label in the trigger to represent the value.- In Bits UI v0, the
Select.Contentwas automatically portalled unless you explicitly set theportalprop tofalse. In v1, we provide aSelect.Portalcomponent that you can wrap around theSelect.Contentto portal the content.Select.Portalaccepts atoprop that can be used to specify the target portal container (defaults todocument.body), and adisabledprop that can be used to disable portalling.
Slider
Slider.Rootnow requires atypeprop to be set to either'single'or'multiple'to properly type thevalueas either anumberornumber[].- A new prop,
onValueCommithas 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.Providerhas been added. This replaces thegroupprop on the previous version'sTooltipcomponent. You can wrap your entire app withTooltip.Provider, or wrap a specific section of your app with it to provide shared context for tooltips.