Extend the transfer list with bulk selection and the ability to add new items to either side. The state model doesn't change — still one items array with a side per item plus a selected Set — you're just adding two operations on top: a per-column "select all / none" toggle, and an append.
type Item = { id: string; label: string; side: 'left' | 'right' };
// A self-contained component. No props.
function App(): JSX.Element;
click "all" on the left → every left item is selected; click again → none
type "Svelte" + Add on the left → a new item appears in the left list
select-all toggle: allSelected ? remove all side ids : add all side ids
add: items = [...items, { id: uniqueId(), label, side }]
items (+side) and selected Set — bulk and add are operations over them.Unlock the solution & editor
Runnable editor + tests
Solve in the browser with instant Jest feedback.
Detailed solutions
Walkthroughs, edge cases, and complexity notes.
Multi-framework variants
React, Vue, Vanilla, Angular — same question, different stacks.