Drag and Drop List
Allows users to create vertically sortable lists supporting drag and drop, touch or keyboard input.
When to use
- When a user wants to change a collection order.
Accessibility
tab
andshift+tab
to focus itemsspace
tolift
or drop the itemj
orarrow down
to move the lifted item downk
orarrow up
to move the lifted item upescape
to cancel the lift and return the item to its initial position
This component also supports iOS and Android browsers and screen readers.
Drag and Drop with varying heights
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- Donec ornare.
- Morbi malesuada id ante ac tincidunt. Phasellus at varius enim, fringilla pretium lorem. Integer placerat, est in aliquam tempus, ex urna hendrerit quam, eu sagittis nulla lorem eu magna.
- Morbi nibh nunc.
- Nunc consequat erat id ante mollis tincidunt in a nulla.
Overrides
Additionally, you can fully customize any part of the Drag and Drop List through the overrides prop. The Drag and Drop List consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:
- Item 1
- Item 2
- Item 3
- Item 4
Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!
List API
Warning
any
= "Prop types are not shown in dev mode"
extract-react-types is not being run in dev mode for speed reasons. If you need to
see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES
eg:
FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>
Stateful List API
Warning
any
= "Prop types are not shown in dev mode"
extract-react-types is not being run in dev mode for speed reasons. If you need to
see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES
eg:
FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>
Stateful List Container API
Warning
any
= "Prop types are not shown in dev mode"
extract-react-types is not being run in dev mode for speed reasons. If you need to
see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES
eg:
FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>