# SortableGroup Connects two or more `Sortable` lists so items can move between them. ## Usage Wrap two or more `Sortable` children to connect them. ```svelte ``` ## Anatomy The `class` attribute values represent part names. Other attributes represent their corresponding props. ```svelte
{children}
``` ## Props | Name | Type | Default | Description | |---|---|---|---| | `children*` | `Snippet` | - | Child content; render two or more `` children inside it | | `group` | `SortableGroupController` | - | Reuses an external controller created by `createSortableGroup(...)`; omitted groups create and provide their own controller | | `duration` | `number` | `300` | Group motion duration in milliseconds; reduced motion resolves the duration to `0` | | `easing` | `EasingFunction` | `cubicOut` | Group motion easing function | | `styling` | `SVSClass` | - | Styling inherited by neutral descendant Sortables when `group` is omitted | | `variant` | `SVSVariant` | `NEUTRAL` | Variant inherited by neutral descendant Sortables when `group` is omitted | `*` required. Other `
` attributes are passed via rest props; `class` is merged onto the group. `SortableGroup` is children-only: render two or more `` children inside it. Descendant Sortables without a `group` prop resolve the shared controller from context. When `group` is omitted, neutral descendant Sortables inherit the group's `variant` and `styling`; when `group` is provided, that controller's own presentation is used. ## Styling To learn more, see [Styling](/docs/styling). ### Variant Management No automatic switching. ### Default Class Name `svs-sortable-group` ## Accessibility ### ARIA Roles and Attributes The component applies these automatically: - Group (`whole` `
`): `role="group"`. Name the group with `aria-label` or `aria-labelledby` through rest props. Each child `Sortable` provides keyboard reordering within its own list, and connected lists share the group controller's live-region announcements; see [`Sortable`](/docs/sortable) accessibility for the keyboard model. ## Exports ### Types ```ts interface SortableGroupProps extends Omit, "children" | "role"> { children: Snippet; group?: SortableGroupController; // reuse an externally created controller duration?: number; // (300) group motion duration easing?: EasingFunction; // (cubicOut) group motion easing styling?: SVSClass; variant?: SVSVariant; // (VARIANT.NEUTRAL) // other div attributes are passed to the group
via ...rest; `class` is merged // aria-label / aria-labelledby name the group } type SortableGroupReqdProps = "children"; type SortableGroupBindProps = never; ``` ### Others See [`Sortable`](/docs/sortable) for `createSortableGroup` and `SortableGroupController`. ## Examples The example code uses Tailwind CSS along with `SVSClass`. ### Basic **Code** ```svelte src=SortableGroupBasic.svelte

Todo

card.id} styling={childStyle}> {#snippet item(card)} {card.title} {/snippet}

Doing

card.id} styling={childStyle}> {#snippet item(card)} {card.title} {/snippet}

Done

card.id} styling={childStyle}> {#snippet item(card)} {card.title} {/snippet}
``` ### With Interactive Variant **Code** ```svelte src=SortableGroupPract.svelte

Planned

{#snippet item(value)} {value} {/snippet}

Shipped

{#snippet item(value)} {value} {/snippet}
``` ### Clone Mode **Code** ```svelte src=SortableGroupClone.svelte

Palette

block.id} clone={(block) => ({ ...block, id: `${block.id}-${nextId++}` })} {styling} > {#snippet item(block)} {block.label} {/snippet}

Canvas

block.id} {styling}> {#snippet item(block)} {block.label} {/snippet}
```