Migrating to 0.5
Before you start
0.5 swaps Bits UI for ui-sdk under every interactive component. Most code keeps working once the imports and a few prop names change. Work through this page top to bottom and run svelte-check after each section. TypeScript flags most of the changes. The last section lists the ones it misses.
On 0.3 or older? Apply the breaking notes for each version in the changelog up to 0.4.0 first.
Porting with a coding agent? Give it the 0.5 notes for agents along with this page. They explain each change in more depth.
Update the package
If you import from @mielui/svelte, upgrade it. ui-sdk installs with it.
Mielui no longer uses bits-ui, vaul-svelte, @floating-ui/dom, or @internationalized/date. Remove the ones your own code does not import.
pnpm remove bits-ui vaul-svelte @floating-ui/dom @internationalized/dateUpdate copied components
If you copied components with the CLI, install both ui-sdk packages at the exact version Mielui 0.5 was built against. A newer beta can change behavior.
pnpm add @ui-sdk/svelte@0.1.0-beta.24 @ui-sdk/core@0.1.0-beta.24Copy the 0.5 source over every component you use. --overwrite replaces your local edits, so commit first and reapply them from the diff.
pnpm dlx @mielui/svelte@0.5.0 add button dialog select --overwriteadd leaves ui.css alone, and the 0.5 components need the new one because it imports ui-sdk's layer styles. Replace it, using the directory from your mielui.json:
curl -o src/lib/mielui/ui.css https://unpkg.com/@mielui/svelte@0.5.0/registry/files/ui.cssTheme
The default theme changed. The neutral is now moss, an olive-tinted grey, and the brand color is #e5808a. A custom theme that sets both is unaffected. To keep the 0.4 colors, set them in Theme Studio and export, or put them in your theme JSON:
{
"brand": "#ba7ca5",
"neutral": "true"
}Every frame now has one border. Delete chrome.borders from theme JSON, and delete any --mielui-inset-position, --mielui-border-inset-scale, or --mielui-modal-inset overrides. Nothing reads them. Footer, header, and toolbar strips now render in the order you write them.
Attachments
Morph, Number Shuffle, and Shimmer are Svelte attachments now, and they moved from @mielui/svelte/actions to @mielui/svelte/attachments. Change the import path and replace use: with {@attach}. The options object stays the same.
<script>
import { numberShuffle } from '@mielui/svelte/actions/number-shuffle';
</script>
<span use:numberShuffle={{ value: total }}>{total}</span><script>
import { numberShuffle } from '@mielui/svelte/attachments/number-shuffle';
</script>
<span {@attach numberShuffle({ value: total })}>{total}</span>The helpers in @mielui/svelte/utils changed the same way. pressable and visualViewportBounds attach as they are. travelingHighlight() and dynamicWidth() are called to create the attachment, even without options. dynamicWidth lost enabled, so attach it conditionally: {@attach wide && dynamicWidth()}.
Removed and renamed exports
ui-sdk now handles focus, dismissal, inert, and scroll lock for every overlay, so the old helpers are gone. Delete calls to them instead of looking for replacements.
- Utils
clickOutside,trapFocus,inertOutside,lockBodyScroll,lockBodyBackground,pushEscapeLayer,getFocusableElements,positionFloatingPanel,submenuPanelOffset, andisPointInSubmenuTriangleare removed. - Transitions
panelMotion,dialogIn,dialogOut,overlayIn,overlayOut,sheetIn,sheetOut, andSheetSideare removed. Overlays animate with CSS. - Drawer
DrawerRootPropsisDrawerProps.DrawerRegionPropssplits intoDrawerHeaderProps,DrawerBodyProps, andDrawerFooterProps. - Alert Dialog
AlertDialogActionPropssplits intoAlertDialogClosePropsandAlertDialogConfirmProps. - State types
TooltipState,SelectState, andContextMenuStateare removed.ComboboxStateis read-only forsearchPlacement,threshold, andappearance. - Trigger ids Dialog, Alert Dialog, Sheet, Drawer, Popover, Dropdown Menu, and Tooltip triggers no longer take
id. ui-sdk always replaced it. Select and Combobox triggers keepidfor<label for>.
Styling hooks
Parts no longer set data-state="open" or data-state="active". A selector that still uses them matches nothing, and nothing warns you. Search your code for data-state and data-[state and switch to these attributes:
- Open
data-openanddata-closedon disclosures and popups. In Tailwind,data-open:. - Selected
data-selectedon tabs and options. - Checked
data-checkedon radios, switches, and menu checkbox items. Checkbox is a native input and keepsdata-state. - Pressed
data-pressedon toggles. A selectedToolbar.Buttonreadsaria-pressed, and a currentToolbar.Linkreadsaria-current. - Highlighted
data-highlightedon the active menu or list item.
Mielui's own states still use data-state, such as streaming on Response Stream. Leave those selectors alone.
Overlays
Popups and dialogs now render where you write them and open in the browser's top layer. They are no longer moved to <body>. Remove portal and dismissLayer from Popover, Dropdown Menu, Combobox, and Date Picker content, and remove Drawer's Portal part.
Rendering in place means events from inside a popup bubble to its parents. A menu inside a clickable table row fires the row's click handler. Stop propagation, or move the menu out of the row. A Dialog that holds a <form> can't sit inside another form, so move it out of the outer one.
Tooltip.Trigger is the button now. Move the props of the Button you put inside it onto the trigger:
<Tooltip.Root>
<Tooltip.Trigger>
<Button variant="ghost" size="icon" aria-label="Copy">…</Button>
</Tooltip.Trigger>
<Tooltip.Content>Copy</Tooltip.Content>
</Tooltip.Root><Tooltip.Root>
<Tooltip.Trigger variant="ghost" size="icon" aria-label="Copy">…</Tooltip.Trigger>
<Tooltip.Content>Copy</Tooltip.Content>
</Tooltip.Root>Drawer drops handleOnly, closeThreshold, repositionInputs, and nested. Dragging follows ui-sdk's drawer physics.
Menus
Dropdown Menu and Context Menu items no longer fire onclick when someone picks them with Enter or Space. The code still type-checks, and the item silently does nothing from the keyboard. Move the work to callback, which runs for the pointer and the keyboard:
<DropdownMenu.Item callback={() => archive(id)}>Archive</DropdownMenu.Item>Dates
Calendar, Range Calendar, Date Picker, and Date Range Picker take ISO date strings instead of DateValue objects: "2026-09-17" for one day, ["2026-09-17", "2026-09-19"] for a range, or null. Times are gone, along with granularity, hourCycle, and hideTimeZone.
<script>
import { CalendarDate } from '@internationalized/date';
let value = $state(new CalendarDate(2026, 9, 17));
</script>
<DatePicker.Root bind:value minValue={start} numberOfMonths={2}><script>
let value = $state<string | null>('2026-09-17');
</script>
<DatePicker.Root bind:value min="2026-01-01" months={2}>- Bounds
minValueandmaxValueareminandmax. - Visible month
placeholderismonth, ordefaultMonthwhen uncontrolled. - Months
numberOfMonthsismonths, andpagedNavigationispageBy="page". - Unavailable days
isDateDisabledandisDateUnavailableareunavailable.excludeDisabledisallowUnavailable. - Selection
readonlyisreadOnly,preventDeselectisdeselectable, andcloseOnDateSelectandcloseOnRangeSelectarecloseOnSelect. - Validation
validateandonInvalidare removed. Calldetails.cancel()inonValueChangeto reject a value. - Calendar parts
GridHeadandHeadCellareWeekdaysandWeekday.GridBodyandGridRowareWeeks, andCellisDay. - Date Picker input One text field that accepts typed dates.
DatePicker.Segmentis removed.
calendarLabel, yearFormat, disableDaysOutsideMonth, initialFocus, onStartValueChange, onEndValueChange, and readonlySegments are removed with no replacement.
Changes TypeScript misses
These compile fine and behave differently. Check each one you rely on.
- Switch Enter submits the form. Space toggles.
- Range Slider A named range submits one
start/endvalue, such as20/80. Split it on/on the server instead of reading two fields. - OTP Field
elementbinds the root<div>.patterntakesdigits,letters,alphanumeric, or a RegExp for one character, not a regex string for the whole code. - Command and Combobox Results keep the order you write them in. The best match is highlighted instead of moved to the top. In Command, Escape clears the search before it closes.
- Combobox Opens on click or typing only.
hoverable,delay, andcloseDelayare removed. - Toolbar Arrow keys move only between toolbar parts. Render a Select or Dropdown Menu trigger through
Toolbar.Buttonwith itsrendersnippet to include it. - Radio Group
RadioGroup.Itemtakes button attributes, and itsonchangeis gone. UseonValueChangeon the root. - Accordion Arrow keys, Home, and End no longer move between headers. Tab does.
- Popover An open Popover locks page scrolling only, not scroll areas inside the page.
- Tooltip Outside a
Tooltip.Provider, a label that changes while open swaps instead of rolling. Wrap the trigger in a Provider to keep the roll.
The full list of 0.5 changes is in the changelog.
pnpm add @mielui/svelte@0.5.0