Dual List Box

View in Lexicon

Dual List Box provides users with two Select Boxes with the ability to move items between lists.

installyarn add @clayui/form
versionNPM Version
useimport {ClayDualListBox} from '@clayui/form';

Table of Contents

ClayDualListBox consists of low-level utilities that provides the ability to create a Select with multiple options selectable. Users are allowed to multi-select different items from a list and sometimes, options in use can be re-order. It’s a high level component using ClaySelectBox under the hood.

Note: The actual select functionality will not work here due to a pending issue at FormidableLabs/react-live#196. To see it in action, check out the storybook demo.

API Reference

DualListBox

({ ariaLabels, className, disabled, disableLTR, disableRTL, items, left, leftMaxItems, onItemsChange, right, rightMaxItems, size, spritemap, ...otherProps }: IProps) => JSX.Element
Parameters
Properties

ariaLabels

{ error?: string; transferLTR: string; transferRTL: string; } | undefined= {"error":"The maximum number of items for {0} is {1}","transferLTR":"Transfer Item Left to Right","transferRTL":"Transfer Item Right to Left"}

Labels for the aria attributes

disabled

boolean | undefined

Disables the component.

disableRTL

boolean | undefined

Disables the button responsible for moving items from right to left box.

disableLTR

boolean | undefined

Disables the button responsible for moving items from left to right box.

items

Array<Array<TItem>>= [[],[]]

Items spread across two arrays that will be displayed in the two Select Boxes.

onItemsChange *

(value: Array<Array<TItem>>) => void

Handler that triggers when the content of the items prop are changed. Caused by either reordering or transfering of items.

value *

Array<Array<TItem>>

left

BoxProps | undefined= {}

Props for the left Select Box.

right

BoxProps | undefined= {}

Props for the right Select Box.

size

number | undefined

Amount of items that can fit inside the both Select Boxes before a scrollbar is introduced.

spritemap

string | undefined

Path to the spritemap that Icon should use when referencing symbols.

leftMaxItems

number | undefined

Sets the maximum value of items on the left side.

rightMaxItems

number | undefined

Sets the maximum value of items on the right side.

Returns
Element
Edit this page on GitHub

Contributors

Matuzalém Teles, Krešimir Čoko, Bryce Osterhaus, Patrick Yeo

Last edited May 9, 2025 at 6:15:38 AM

Table of Contents