component

Splitter

props · 29 shown · 29 total

Splitter

Content

  • children slot svelte
    Snippet

    The panes and handles, in source order — `<SplitterPane>` and `<SplitterHandle>` interleaved.

Appearance

  • "subtle" "bold"
    default "subtle"

    Weight of the divider line.

  • "inherit" "cyan" "danger" "dynamic" "mauve" "neutral" "pink" "primary" "sage" "slate" "stone" "success" "teal" "violet" "warning"
    default "neutral"

    Semantic palette the divider draws from, forwarded as `colorPalette`. The grip colour is published as an inheriting custom property, so this reaches every handle beneath the root without repeating it per handle.

Layout

  • "horizontal" "vertical"
    default "horizontal"

    Axis the panes are laid out along. `horizontal` splits left/right, `vertical` splits top/bottom.

  • SplitterPaneConfig[]

    Pane sizing, in source order — one entry per `<SplitterPane>`. `size` is a relative weight; `min` / `max` are pixels.

Behavior

  • number
    default 24

    Distance in px a pane must be dragged below its `min` before a `collapsible` pane snaps shut.

  • boolean
    default false

    Disable every handle. Panes keep their current sizes.

  • number
    default 16

    How far a keyboard arrow press resizes, in px.

  • string

    `localStorage` key under which the current sizes are saved and restored. Omit to keep the splitter stateless across reloads.

  • number[]

    Sizes (in px, along the split axis) that a drag snaps to when it comes within `snapThreshold`.

  • number
    default 8

    How close in px a drag must come to a `snap` stop before it latches.

Events

  • (id: string, collapsed: boolean) => void

    Fired when a pane collapses or expands.

  • (panes: SplitterPaneState[]) => void

    Fired whenever the resolved pane geometry changes.

Accessibility

  • string
    default "Resizable panes"

    Accessible label for the group of panes.

Advanced

  • element binding svelte
    HTMLDivElement null

    Bound reference to the root element (`bind:this`).

  • SplitterPassThrough<RootElementAttributes>

    Per-slot style and HTML-attribute overrides.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-splitter-config` so the client runtime hydrates this instance and `getPindoba(el, "splitter")` can `update()` it. Frameworks with their own reactivity don't need it.

Plus all standard <div> HTML attributes.

SplitterPane

Layout

  • string

    Identity of the pane, matching an entry in the root's `panes` array, and the target of the adjacent handle's `aria-controls`. Optional: the controller falls back to the pane's source position, so an unlabelled splitter still resizes — you only need an id to address a pane by name or to wire `aria-controls`.

Behavior

  • boolean

    Whether the pane is currently collapsed. Frameworks feed their reactive state in; the controller owns the transitions.

Advanced

  • SplitterPanePassThrough<PaneElementAttributes>

    Per-slot style and HTML-attribute overrides.

SplitterHandle

Layout

  • "horizontal" "vertical"
    default "horizontal"

    Axis the handle moves along. Normally inherited from the root; set it only when rendering a handle outside a `<Splitter>`.

Behavior

  • boolean
    default false

    Disable this handle.

  • boolean

    Whether a drag is in progress on this handle.

Accessibility

  • string

    `id` of the pane immediately before this handle — the one the handle's ARIA value describes and that <kbd>Enter</kbd> collapses.

  • string
    default "Resize panes"

    Accessible label for the handle.

  • number

    Largest percentage the controlled pane may reach.

  • number

    Smallest percentage the controlled pane may reach.

  • number

    Current size of the controlled pane as a percentage of the split axis, published as `aria-valuenow`. The controller keeps this live.

Advanced

  • SplitterHandlePassThrough<HandleElementAttributes>

    Per-slot style and HTML-attribute overrides.

Type

  • Components
  • Blocks