Selection API
A headless component for managing selection state in collections with support for single and multi-selection patterns.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| Selection | Providers |
| createSelection | Selection |
| Single | Providers |
| Group | Providers |
Selection.Root
Props
namespace
string | undefinedNamespace for dependency injection (must match SelectionItem namespace)
Default: "v0:selection"
mandatory
boolean | "force" | undefinedControls mandatory selection behavior:
- false (default): No mandatory selection enforcement
- true: Prevents deselecting the last selected item
- force: Automatically selects the first non-disabled item on registration
Default: false
modelValue
T | T[] | undefinedEvents
update:model-value
[value: T | T[]]Slots
default
SelectionRootSlotPropsSelection.Item
Props
Slots
default
SelectionItemSlotProps<V>