Search the documentation

Type to search page titles, component names and descriptions.

    Data Entry

    ReorderList

    Order rows by dragging or with move controls.

    import { ReorderList } from 'faifo-design'

    ReorderList lets a reader order editable rows. Its content stays the caller's; the control emits the ordered ids through one native field, and move controls accompany the drag handles for keyboard use.

    #When to use

    • Use it when order is data: priorities, steps, the sequence of sections.

    #Examples

    Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.

    #Reorder list

    Controlled editable rows emit ordered ids through one native change field; move controls accompany drag handles.

    Show codeHide code
    import { Field, ReorderList } from 'faifo-design'
    
    export const Example = () => (
      <ReorderList
        id="reorder-demo"
        name="order"
        label="Values"
        labels={{
          add: 'Add value',
          remove: 'Remove',
          up: 'Move up',
          down: 'Move down',
          drag: 'Drag',
          empty: 'No values',
        }}
        items={[
          { id: 'red', content: <Field id="reorder-red" name="red" label="Value" value="Red" /> },
          { id: 'blue', content: <Field id="reorder-blue" name="blue" label="Value" value="Blue" /> },
        ]}
      />
    )

    #API

    Generated from the package source. A property without a description has none in the source yet.

    #ReorderListComponent

    Editable content stays caller-owned; this control emits its ordered ids through a native change event.

    PropertyDescriptionTypeDefault
    idrequired–string–
    namerequired–string–
    labelrequired–string–
    itemsrequired–readonly { id: string; content: JSXChild }[]–
    disabled–boolean–
    labelsrequired–{ add: string; remove: string; up: string; down: string; drag: string; empty: string }–

    #Types

    #ReorderListProps

    The properties of ReorderList, listed above.

    #Hooks

    The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.

    • reorder-list
    • reorder-list-value
    • reorder-list-rows
    • reorder-list-row
    • reorder-list-content
    • reorder-list-controls