Calm motion: animations on this site only fade, with no movement
SplitView
Master / detail with a draggable divider
A list on one side and what you picked on the other: mail, files, settings. On a wide view both show with a divider to drag. On a narrow one they take turns, with a Back button. For two panes that always show, use Resizable, which this is built on.
Basic
Docs review
The new component pages read well. Two typos on the Gantt page.
#masteris the list and#detailis the content. The master slot getsopen(). When the view is stacked, it shows the detail. When both panes are on screen, it does nothing. So the same click handler works at every width.- The view looks at its own width, not the window's: under
breakpoint(default 560 px) it stacks. Resize the window and it switches without a reload. - Stacked,
v-model:detailsays which pane shows. Opening the detail moves focus to it. Back returns to the list and focuses it, and firesback. Nothing is left focused on a hidden element. v-modelis the master's width in % (minandmaxlimit it, 20 to 60 by default). Withstorage-keythe divider is remembered inlocalStorage. A missing, broken or out-of-range value is ignored.- The divider itself is Resizable's: a focusable separator, arrows move it, Home and End go to the limits, Enter or a double-click resets it.
Usage
ts
import { BlessSplitView } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
breakpoint | number | 560 | under this width (px of the view itself) the panes stack: one at a time |
min | number | 20 | |
max | number | 60 | |
storageKey | string | — | remember the divider in localStorage under this key |
label | string | "Resize list" | |
labels | Partial<{ back: string; }> | — | |
modelValue | number | 35 | master pane width in % |
detail | boolean | false | when stacked: is the detail showing (true) or the list (false)? |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: number] | |
back | [] | |
update:detail | [value: boolean] |
Slots
| Name | Scope | Description |
|---|---|---|
master | { open: () => boolean; stacked: boolean; } | |
detail | { stacked: boolean; } |