Cal.comdesign-system

Selection List

Compact list of selected items with removable or read-only rows and composable content.

Use SelectionList with SelectionListItem for selected people, teams, or orgs in a compact list. They render accessible div elements with list roles. SelectionList owns the card background, scroll area, border, radius, and row dividers; children own the leading row content. Pass badges or other end-aligned content through trailing. Pass onRemove and removeAriaLabel when the row can be removed; omit both for a read-only row. Do not use ListItem here; that composite is the heavier event-type / workflow card row.

Use the components directly for ordinary lists. No virtualization setup is needed: the list uses a max-height COSS ScrollArea with an edge fade by default. HostSelect adds virtualization only when it has more than 100 selected hosts; that optimization belongs to the consumer, not this composite.

Example

HostSelect selected-host list below the virtualization threshold: divided bordered container, priority badge on a round-robin host, close on every row.

apps/web · booking link assignment selected hosts
apps/web/modules/event-types/components/host-select.tsx

Set scrollable={false} only when the list should grow with its content or a parent already owns scrolling. For unusually large lists, consumers may pass native ref and style props to the list and position virtualized items themselves, as HostSelect does.

API

Call sites

Example URLs

Not exhaustive — a few places you can open locally (e.g. http://localhost:3000) to see this in product.

Source

packages/coss-ui/src/shared/selection-list.tsx