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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQAumujy5kXaOKurr6zgTP2krHrFVXi2kj8seRYrlvq2GssUjReh5MiVpQbLFQNy9HsmcasqpBNVsXytWTw0ZDjA=

OrderedList

import { OrderedList } from '@dxos/react-ui-list';
Terminal window
npm install @dxos/react-ui-list

An ordered list is a list of rows the user drags into order. OrderedList gives each row a drag handle.

A drop, or a keyboard move from the handle, calls onMove with the old and the new index. You then update your state.

Each part handles keyboard navigation and the current and selected states. Each part also sets its own spacing, so put the list in a panelโ€™s body with no padding around it.

Part What it is
OrderedList.Root The root, which takes the items, getId, getLabel and onMove. Its child is a function of the items
OrderedList.Label The listโ€™s name
OrderedList.Viewport The scroll area for the list. It also scrolls during a drag near its edges
OrderedList.Content The list element
OrderedList.Item A row. collapsible folds an OrderedList.Detail under it
OrderedList.DragHandle The grip the user drags, or moves with Alt and the arrow keys
OrderedList.Detail A collapsible rowโ€™s detail, at full width
OrderedList.ItemIcon The rowโ€™s icon
OrderedList.ItemText The rowโ€™s text
OrderedList.ItemDescription The rowโ€™s description
OrderedList.Empty The placeholder shown while there are no items

getLabel names each row for screen readers as it moves. The child of OrderedList.Root is a function of the items, so the rows always follow the order you hold.

Example (Reordering an agenda)

import {
function useCallback<T extends Function>(callback: T, deps: React.DependencyList): T

useCallback will return a memoized version of the callback that only changes if one of the inputs has changed.

@version โ€• 16.8.0

@see โ€• https://react.dev/reference/react/useCallback

useCallback
,
function useState<S>(initialState: S | (() => S)): [S, React.Dispatch<React.SetStateAction<S>>] (+1 overload)

Returns a stateful value, and a function to update it.

@version โ€• 16.8.0

@see โ€• https://react.dev/reference/react/useState

useState
} from 'react';
import {
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
} from '@dxos/react-ui-list';
import * as
import SystemButton
SystemButton
from '@dxos/react-ui/SystemButton';
/** Rows the user can drag into a new order, each with a remove button. */
export const
const Agenda: () => React.JSX.Element

Rows the user can drag into a new order, each with a remove button.

Agenda
= () => {
const [
const steps: Step[]
steps
,
const setSteps: React.Dispatch<React.SetStateAction<Step[]>>
setSteps
] =
useState<Step[]>(initialState: Step[] | (() => Step[])): [Step[], React.Dispatch<React.SetStateAction<Step[]>>] (+1 overload)

Returns a stateful value, and a function to update it.

@version โ€• 16.8.0

@see โ€• https://react.dev/reference/react/useState

useState
(
const STEPS: Step[]
STEPS
);
const
const move: (from: number, to: number) => void
move
=
useCallback<(from: number, to: number) => void>(callback: (from: number, to: number) => void, deps: React.DependencyList): (from: number, to: number) => void

useCallback will return a memoized version of the callback that only changes if one of the inputs has changed.

@version โ€• 16.8.0

@see โ€• https://react.dev/reference/react/useCallback

useCallback
(
(
from: number
from
: number,
to: number
to
: number) =>
const setSteps: (value: React.SetStateAction<Step[]>) => void
setSteps
((
steps: Step[]
steps
) => {
const
const next: Step[]
next
= [...
steps: Step[]
steps
];
const [
const step: Step
step
] =
const next: Step[]
next
.
Array<Step>.splice(start: number, deleteCount?: number): Step[] (+1 overload)

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

@param โ€• start The zero-based location in the array from which to start removing elements.

@param โ€• deleteCount The number of elements to remove. Omitting this argument will remove all elements from the start paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.

@returns โ€• An array containing the elements that were deleted.

splice
(
from: number
from
, 1);
const next: Step[]
next
.
Array<Step>.splice(start: number, deleteCount: number, ...items: Step[]): Step[] (+1 overload)

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

@param โ€• start The zero-based location in the array from which to start removing elements.

@param โ€• deleteCount The number of elements to remove. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.

@param โ€• items Elements to insert into the array in place of the deleted elements.

@returns โ€• An array containing the elements that were deleted.

splice
(
to: number
to
, 0,
const step: Step
step
);
return
const next: Step[]
next
;
}),
[],
);
return (
<
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element
Root
items: readonly Step[]
items
={
const steps: Step[]
steps
}
getLabel?: ((item: Step) => string) | undefined

The row's text for typeahead and the default drag preview; the preview falls back to the row's ItemText.

getLabel
={(
step: Step
step
) =>
step: Step
step
.
label: string
label
}
onMove?: ((fromIndex: number, toIndex: number) => void) | undefined

Called with (fromIndex, toIndex) after a pointer drop or a keyboard move.

onMove
={
const move: (from: number, to: number) => void
move
}
>
{({
items: readonly Step[]
items
}) => (
<
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
children: React.ReactNode;
} & React.RefAttributes<HTMLDivElement>>
Viewport
>
<
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Content: React.ForwardRefExoticComponent<Omit<Omit<Omit<ContainerProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<...> & React.RefAttributes<...>>
Content
"aria-label"?: string | undefined

Defines a string value that labels the current element.

@see โ€• aria-labelledby.

aria-label
='Agenda'>
{
items: readonly Step[]
items
.
ReadonlyArray<Step>.map<React.JSX.Element>(callbackfn: (value: Step, index: number, array: readonly Step[]) => React.JSX.Element, thisArg?: any): React.JSX.Element[]

Calls a defined callback function on each element of an array, and returns an array that contains the results.

@param โ€• callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

@param โ€• thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

map
((
step: Step
step
) => (
<
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Item: {
({ id, canDrag, collapsible, open, defaultOpen, onOpenChange, children, ...props }: OrderedListItemProps): React.JSX.Element | null;
displayName: string;
}
Item
Attributes.key?: React.Key | null | undefined
key
={
step: Step
step
.
id: string
id
}
id: string
id
={
step: Step
step
.
id: string
id
}>
<
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type DragHandle: {
({ asChild, children }: OrderedListDragHandleProps): React.JSX.Element;
displayName: string;
}
DragHandle
/>
<
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type ItemText: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
tone?: "default" | "muted";
} & React.RefAttributes<HTMLParagraphElement>>
ItemText
/>
<
import SystemButton
SystemButton
.
const Remove: React.ForwardRefExoticComponent<Omit<SystemButton.Props, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>
export Remove

Takes a row out of a list without destroying what it names; the glyph is Close's, the intent Delete's. In a list row it is named by its label followed by the row's ItemText ("Delete Q3 budget"); a label replaces both.

Remove
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined
onClick
={() =>
const setSteps: (value: React.SetStateAction<Step[]>) => void
setSteps
((
steps: Step[]
steps
) =>
steps: Step[]
steps
.
Array<Step>.filter(predicate: (value: Step, index: number, array: Step[]) => unknown, thisArg?: any): Step[] (+1 overload)

Returns the elements of an array that meet the condition specified in a callback function.

@param โ€• predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

@param โ€• thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

filter
(({
id: string
id
}) =>
id: string
id
!==
step: Step
step
.
id: string
id
),
)
}
/>
</
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Item: {
({ id, canDrag, collapsible, open, defaultOpen, onOpenChange, children, ...props }: OrderedListItemProps): React.JSX.Element | null;
displayName: string;
}
Item
>
))}
</
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Content: React.ForwardRefExoticComponent<Omit<Omit<Omit<ContainerProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & Pick<...> & React.RefAttributes<...>>
Content
>
</
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
children: React.ReactNode;
} & React.RefAttributes<HTMLDivElement>>
Viewport
>
)}
</
const OrderedList: {
Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element;
Label: React.ForwardRefExoticComponent<Omit<ListboxLabelProps, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & React.RefAttributes<HTMLLabelElement>>;
Viewport: React.ForwardRefExoticComponent<Omit<Pick<ScrollAreaRootProps, "mode" | "native" | "width">, "className"> & {
classNames?: import("@dxos/ui-types").ClassNameValue;
} & {
...;
} & React.RefAttributes<...>>;
... 7 more ...;
ItemDescription: React.ForwardRefExoticComponent<...>;
}

Reorderable list on Listbox, sharing its row vocabulary: rows are Items composed from a DragHandle, ItemIcon, ItemText and trailing controls; a collapsible Item adds a caret and a Detail. The ARIA grid keyboard enters a row with ArrowRight, where the DragHandle moves it with Alt+ArrowUp/Down.

@example <OrderedList.Root items={items} getLabel={(item) => item.label} onMove={move}> {({ items }) => ( <OrderedList.Viewport> <OrderedList.Content> {items.map((item) => ( <OrderedList.Item key={item.id} id={item.id}> <OrderedList.DragHandle /> <OrderedList.ItemText /> </OrderedList.Item> ))} </OrderedList.Content> </OrderedList.Viewport> )} </OrderedList.Root>

OrderedList
.
type Root: <T>({ items, getId, getLabel, onMove, dragPreview, readonly, columns, virtual, size, loopFocus, children, ...selection }: OrderedListRootProps<T>) => React.JSX.Element
Root
>
);
};

move takes the step out at its old index and puts it back at the new one. Each row also has a SystemButton.Remove, which takes its step out of steps.