Upgrade Guide
What changed in Ark UI v6, and the breaking changes to fix as you migrate.
v6 adds a render function that can read a part's state, merges the data-scope/data-part attributes, and lines the
four frameworks up on the same anatomy. asChild still works. Codemods handle most of the work. This guide covers what
they don't.
Before you start
- Solid requires Solid 2. See Solid 2.
- Commit your work. The codemods won't run on a dirty working tree.
Run the codemods
# List every transform
npx @ark-ui/codemod list
# Preview a transform without writing files
npx @ark-ui/codemod react/as-child-to-render "src/**/*.tsx" --dry
--dryprints a diff and writes nothing.- Anything ambiguous is skipped and reported with a file and a reason.
- Add
--cross-filewhen parts come through local barrels, re-exports or wrappers likestyled(ark.button).
Each transform exists for react/*, solid/*, svelte/* and vue/*:
| Transform | Change |
|---|---|
as-child-to-render | asChild → render (optional) |
carousel-props | slideCount → count, autoplay → autoPlay, padding → itemSpacing |
floating-panel-placement | resizeTriggerAxes → resizeTriggerPlacements, axis → placement |
image-cropper-placement | handles → placements, position → placement |
tabs-virtual-focus | composite → virtualFocus (value inverted) |
popover-portalled | removes portalled |
tags-input-editable | adds editable to keep the old default |
pin-input-count | length → count, or flags a missing count |
field-indicator | Field.RequiredIndicator → Field.Indicator type="required" |
Stylesheets and selectors have their own transform:
npx @ark-ui/codemod css/data-attributes "src/**/*.{css,ts,tsx,vue,svelte}" --dry
Everything else in this guide is a manual change.
Migrate with an AI agent
Paste this prompt into an agent (Claude Code, Cursor, Copilot) pointed at your codebase.
Migrate this codebase from Ark UI v5 to v6. Detect the framework (React, Solid,
Svelte or Vue) and change only Ark UI usage. Run the typecheck after each step.
Report anything ambiguous instead of guessing.
1. Run the codemods and review their reports:
npx @ark-ui/codemod list
npx @ark-ui/codemod css/data-attributes "src/**/*.{css,ts,tsx,vue,svelte}"
Add --cross-file if parts come through barrels, re-exports or wrappers.
2. Leave `asChild` as is; it is still supported. Where a part needs its
state, use `render`, which receives (props, state). React and Vue: spread
or v-bind `props`, an object. Solid/Svelte: `props` is a merge function, so
spread `props()` and call `props({ onClick })` to merge handlers. Solid's
`state` is an accessor.
3. Toaster: remove `render`/`asChild` and `ToasterState`. Style it with CSS.
4. Parts that now render `span` or `h2` (see the guide): add `display` where
styles assumed a block. React refs become HTMLSpanElement.
5. Overlays: move `z-index` from content to the positioner, using
`calc(<base> + var(--layer-index))`.
6. Apply the component changes in the guide: Accordion, Combobox/Listbox/
Select (`List` part, `Empty` placement), Field, Menu, NumberInput,
PinInput, Popover, Slider, Steps, TagsInput, Toc, Tour, and the
"previous" renames.
7. Solid: upgrade to Solid 2. Solid/Svelte/Vue: `useCollator`/`useFilter`
return values, not accessors. Svelte: pass `id` to `useX` hooks and update
renamed exports. Vue: update AngleSlider type names and NumberInput v-model.
Full guide: https://ark-ui.com/docs/overview/upgrade-guide
Composition
render alongside asChild
asChild still works, so this change is optional. render receives the part's props and its state, so you can read
state inline. React and Vue move the child into a function or slot. In Solid and Svelte, props is a function: call it
to spread, and pass your handlers to merge them instead of overwriting. In Vue, props is an object to v-bind.
Codemod (optional): <framework>/as-child-to-render.
Before
<Collapsible.Trigger asChild>
<button>Toggle</button>
</Collapsible.Trigger>
After (React)
<Collapsible.Trigger render={(props, state) => <button {...props}>{state.open ? 'Open' : 'Closed'}</button>} />
After (Solid)
<Collapsible.Trigger render={(props, state) => <button {...props()}>{state().open ? 'Open' : 'Closed'}</button>} />
After (Svelte)
<Collapsible.Trigger>
{#snippet render(props, state)}
<button {...props()}>{state.open ? 'Open' : 'Closed'}</button>
{/snippet}
</Collapsible.Trigger>
After (Vue)
<Collapsible.Trigger>
<template #render="{ props, state }">
<button v-bind="props">{{ state.open ? 'Open' : 'Closed' }}</button>
</template>
</Collapsible.Trigger>
Toaster is no longer polymorphic
Toaster drops render, asChild and ToasterState. Its children belong to the machine, and handing them over
dropped toasts. Style the group with data-placement, data-side and data-align, or wrap your own element around it.
Styling and markup
Data attributes are merged
data-scope, data-part and data-ownedby become one attribute per part, data-{scope}-{part}. Your JSX doesn't
change. Your CSS and querySelector calls do.
Codemod: css/data-attributes. It also turns toggle [data-state="on"] into [data-pressed], and replaces the removed
data-focus on toggle group and toolbar with :focus-within / :focus-visible.
Before
[data-scope='dialog'][data-part='trigger'] {
/* ... */
}
After
[data-dialog-trigger] {
/* ... */
}
The codemod skips selectors built from variables, with escaped quotes, or where scope and part aren't adjacent. Update those by hand.
Some parts were renamed:
| Component | v5 | v6 |
|---|---|---|
| TreeView | branch | node-group |
| TreeView | branch-control, item | node ([data-branch] on branches) |
| TreeView | branch-content, branch-indent-guide | node-group-content, indent-guide |
| TreeView | branch-indicator, branch-trigger | node-indicator, node-expand-trigger |
| TreeView | branch-text, item-text | node-text |
| TreeView | item-indicator | removed, use node-indicator |
| TreeView | node-checkbox-indicator | node-indicator with type="checked" or type="indeterminate" |
| ImageCropper handle | [data-position="nw"] | [data-placement="nw"] |
| FloatingPanel resize trigger | [data-axis="n"] | [data-placement="n"] |
| Field | input, textarea, select | control |
| Field | required-indicator | indicator |
| Toc nav | [data-toc-root] | [data-toc-nav] |
- The codemod renames all of these except
item-indicator,node-checkbox-indicatorand the Toc nav. It renamesdata-positionanddata-axisonly right after the handle or resize trigger selector. - A v5
itemorbranch-controlselector becomes two attribute selectors, which raises specificity. Check overrides that relied on order. - JsonTreeView uses the tree view's attributes:
[data-scope="json-tree-view"][data-part="branch"]→[data-tree-view-node-group].
Some parts render a different element
Parts inside a button or label now render span, since a div there is invalid HTML. A few others changed to match
the same part in other frameworks. A span is inline, so width, height and transform stop applying until you set
display. In React, the refs are HTMLSpanElement.
Before
[data-accordion-item-indicator] {
transition: transform 0.2s;
}
After
[data-accordion-item-indicator] {
display: inline-flex;
transition: transform 0.2s;
}
Now span:
Accordion.ItemIndicator,Collapsible.Indicator,Popover.Indicator,Toggle.IndicatorSelect.Indicator,Select.ItemIndicator,Combobox.ItemIndicator,Listbox.ItemIndicator,Listbox.ItemTextMenu.Indicator,Menu.ItemIndicator,NavigationMenu.ItemIndicatorCheckbox.Control,Checkbox.Indicator,RadioGroup.ItemControl,SegmentGroup.ItemControlClipboard.Indicator,Steps.Indicator,Splitter.ResizeTriggerIndicatorAvatar.Root,Avatar.RootProvider,Tabs.Indicator,NumberInput.ScrubberAngleSlider.Marker,AngleSlider.ValueText
Now h2: Popover.Title, like Dialog.Title. Without a CSS reset it picks up the browser's heading margins and font
size. Use render for another heading level.
Overlays no longer set a z-index
Popover, Menu, Select, Combobox, Tooltip, HoverCard, DatePicker, ColorPicker, Dialog, Drawer, Tour, FloatingPanel and
Toast no longer put an inline z-index on their content. Set it on the positioner or backdrop. Each exposes
--layer-index, its position among open layers, so nested overlays stay above their parent.
Before
[data-popover-content] {
z-index: 1400;
}
After
[data-popover-positioner] {
z-index: calc(1400 + var(--layer-index));
}
- Dialog and Drawer:
--z-indexis gone. Use--layer-indexon the backdrop and positioner. - FloatingPanel: style the positioner the same way to raise the focused panel.
- Tour: style the positioner with
--tour-layer. - Toast: set
z-indexon[data-toast-group].
Components
Accordion
loopFocusis removed. Triggers are reached withTab.collapsibledefaults totrue. Passcollapsible={false}to keep one item open.
Combobox, Listbox and Select
The listbox role, active descendant and keyboard focus move from Content to a new List part. Content becomes a
plain wrapper, so headers, footers and search inputs can sit in the popup. Empty moves out of List and stays mounted
with role="status", so screen readers announce it. Put its message in a child element.
Before
<Combobox.Content>
<Combobox.Empty className={styles.Empty}>No results found</Combobox.Empty>
{items.map((item) => (
<Combobox.Item key={item.value} item={item}>
{item.label}
</Combobox.Item>
))}
</Combobox.Content>
After
<Combobox.Content>
<Combobox.Empty>
<div className={styles.Empty}>No results found</div>
</Combobox.Empty>
<Combobox.List>
{items.map((item) => (
<Combobox.Item key={item.value} item={item}>
{item.label}
</Combobox.Item>
))}
</Combobox.List>
</Combobox.Content>
| v5 | v6 |
|---|---|
composite={false} | popupType="dialog" |
disableLayer | inline (Combobox) |
For loading and error states, use the new Status part.
Field and Fieldset
Field and Fieldset now run on @zag-js/field and @zag-js/fieldset, with native validation, a validate function,
validationMode and server errors. Most usage keeps working.
Codemods: <framework>/field-indicator and css/data-attributes.
Before
<Field.Label>
Email
<Field.RequiredIndicator>*</Field.RequiredIndicator>
</Field.Label>
After
<Field.Label>
Email
<Field.Indicator type="required">*</Field.Indicator>
</Field.Label>
- Generated ids are
{id}:labeland{id}:control. Field.ErrorTextstays mounted withhiddenwhile the field is valid. Style it with[hidden].Field.Rootno longer setsrole="group".
Menu
composite is replaced by popupType.
NumberInput
The value is a number, with null for an empty input. The input is a text field instead of a spinbutton.
Before
<NumberInput.Root onValueChange={(details) => setValue(details.valueAsNumber)}>
After
<NumberInput.Root onValueChange={(details) => setValue(details.value)}>
| v5 | v6 |
|---|---|
valueAsNumber | value |
allowOverflow / clampValueOnBlur | allowOutOfRange |
Vue v-model: string | number | null |
PinInput
| v5 | v6 |
|---|---|
length | count (codemod) |
sanitizeValue | normalizeValue |
blurOnComplete, selectOnFocus | removed; blur in onValueComplete |
Popover
The portalled prop and api.portalled are gone. The popover detects whether its content is portalled and fixes tab
order either way. To portal it, wrap the positioner in Portal.
Codemod: <framework>/popover-portalled removes the prop. Add the Portal yourself.
Before
<Popover.Root portalled>
<Popover.Trigger>Open</Popover.Trigger>
<Popover.Positioner>
<Popover.Content>...</Popover.Content>
</Popover.Positioner>
</Popover.Root>
After
<Popover.Root>
<Popover.Trigger>Open</Popover.Trigger>
<Portal>
<Popover.Positioner>
<Popover.Content>...</Popover.Content>
</Popover.Positioner>
</Portal>
</Popover.Root>
Slider
The aria-label and aria-labelledby arrays are replaced by getAriaLabel and getAriaLabelledBy functions.
Steps
Steps come from an items array and are addressed by a string value, not a count and an index. Each item can be
optional, invalid, disabled or editable, and carry a title and description.
Before
<Steps.Root count={3} defaultStep={0} onStepChange={(details) => setStep(details.step)}>
<Steps.List>
<Steps.Item index={0}>
<Steps.Trigger>Shipping</Steps.Trigger>
</Steps.Item>
</Steps.List>
<Steps.Content index={0}>...</Steps.Content>
</Steps.Root>
After
const items = [{ value: 'shipping' }, { value: 'gift', optional: true }, { value: 'payment' }]
<Steps.Root items={items} defaultValue="shipping" onValueChange={(details) => setStep(details.value)}>
<Steps.List>
<Steps.Item value="shipping">
<Steps.Trigger>Shipping</Steps.Trigger>
</Steps.Item>
</Steps.List>
<Steps.Content value="shipping">...</Steps.Content>
</Steps.Root>
| v5 | v6 |
|---|---|
count | items |
step / defaultStep | value / defaultValue |
onStepChange / onStepComplete | onValueChange / onComplete |
isStepValid / isStepSkippable | invalid / optional on the item |
onStepInvalid | onNavigationBlocked (reason, blockedBy) |
index on parts | value |
api.setStep(index) | api.setValue(value) |
api.isCompleted | api.complete |
Steps.ChangeDetails | Steps.ValueChangeDetails |
Steps.InvalidDetails | Steps.NavigationBlockedDetails |
--percent | --steps-percent |
Vue v-model:step, Svelte bind:step | v-model, bind:value |
Steps.SkipTriggerskips anoptionalstep, andcompletedValuesmakes completed steps controllable.- A step the user goes back to stays complete, so it can carry
data-currentanddata-completetogether. Put the current-step style last, or scope the completed one with:not([data-current]).
TagsInput
Tags open for editing on double-click only when you pass editable.
Codemod: <framework>/tags-input-editable.
Before
<TagsInput.Root>
After
<TagsInput.Root editable>
Toc
multipledefaults tofalse.Toc.Navrenders its own props: it carriesdata-toc-navand anid, and takesaria-labelledbyfromRoot.- Svelte:
Toc.Navreads the Toc fromToc.Rootand no longer acceptsuseTocprops. Wrap it inToc.Root.
Tour
The "prev" action is now "previous".
"Previous" is spelled out
Context and hook APIs use previous instead of prev. Part names like Pagination.PrevTrigger don't change.
| v5 | v6 |
|---|---|
getPrevTriggerProps() | getPreviousTriggerProps() |
goToPrevPage() | goToPreviousPage() |
translations.prevTriggerLabel | translations.previousTriggerLabel |
goToPrevStep() / hasPrevStep | goToPreviousStep() / hasPreviousStep |
selectPrev() | selectPrevious() |
scrollPrev() | scrollPrevious() |
Part state types
These keep their names but now describe the root state: CollapsibleTriggerState, EditableAreaState,
EditableInputState, EditableLabelState, EditablePreviewState, DateInputControlState, PasswordInputInputState,
PasswordInputVisibilityTriggerState, PinInputLabelState and RatingGroupControlState.
Frameworks
Solid 2
@ark-ui/solid requires solid-js and @solidjs/web >=2.0.0-rc.19, and no longer works with Solid 1.
npm install solid-js@next @solidjs/web@next
Before
{ "compilerOptions": { "jsxImportSource": "solid-js" } }
After
{ "compilerOptions": { "jsxImportSource": "@solidjs/web" } }
useCollator and useFilter return values
In Solid, Svelte and Vue, these hooks return values instead of accessors, like React. They still follow locale changes.
Before
const collator = useCollator()
collator().compare(a, b) // Solid, Svelte
collator.value.compare(a, b) // Vue
const filters = useFilter({ sensitivity: 'base' })
filters().contains(text, query)
After
const collator = useCollator()
collator.compare(a, b)
const { contains } = useFilter({ sensitivity: 'base' })
contains(text, query)
Svelte: hooks require an id
Without an id, two instances generated the same element ids. Components like <Collapsible.Root> still create their
own. $props.id() can be called once per component, so derive from it if you need two.
Before
const collapsible = useCollapsible()
After
const id = $props.id()
const collapsible = useCollapsible({ id })
Svelte: exports match the other frameworks
| v5 | v6 |
|---|---|
Positioner, Root, Title… (Dialog) | DialogPositioner, DialogRoot, DialogTitle… |
StepsStepChangeDetails | StepsValueChangeDetails |
ColorPickerColor | Color |
TabsContentState / TabsTriggerState | TabContentState / TabTriggerState |
CheckboxProvider, splitCollapsibleProps | removed (internal) |
Vue: type names
AngleSlideruses short type names like the other components:AngleSlider.AngleSliderRootProps→AngleSlider.RootProps.RootEmitstypes are now exported for AngleSlider, Drawer, FloatingPanel, JsonTreeView, PasswordInput, SignaturePad, Steps and TreeView.