Skip to content
SENVENLI UI

Split

Panes side by side that stack below a width of the layout itself: split screens, list and detail, media and text.
A sign-in screen
import { Split, SplitPane } from "@senvenli/react/layout";

Examples

List and detail

A fixed-width list beside the item it opens; stacked when narrow.

Guidelines

When to use it

  • A screen of two (or more) panes that sit side by side when there is room: a sign-in form beside a brand pane, a list beside its detail.
  • The split must follow the space the layout gets (a dialog, a shell with a sidebar), not the window.

Use something else when

  • Equal columns of cards or tiles that wrap. Grid
  • The app's navigation beside the page. Sidebar

Do and avoid

  • Hide a decorative pane on narrow layouts with hideOnNarrow; never hide the pane that holds the task.
  • Put the page's one main landmark on the pane that holds the task (as="main") when the Split is the whole page.

Accessibility

Built in

  • A pane hidden on narrow layouts is display: none, so it leaves the accessibility tree too.
  • Panes follow source order in every layout, so reading and tab order never jump.

You provide

  • The landmark of each pane (as="main", as="aside") and the headings in it.

API reference

Split

as
LayoutElementDefault "div"
ratio
stringDefault "1fr 1fr"

The columns side by side, as a CSS grid template: "1fr 1fr" (default), "1.05fr 1fr", "20rem 1fr".

collapseBelow
SplitCollapseDefault "48rem"

Below this width of the layout itself the panes stack in one column. Default "48rem".

hideOnNarrow
"start" | "end"

The pane that is left out when stacked (a brand or picture pane that adds nothing on a phone). Default: none.

space
Space

The gap between the panes. Default none: panes meet edge to edge, each with its own ground.

fullHeight
booleanDefault false

At least as tall as the viewport: a screen of its own, like a sign-in page.

Also takes 375 standard DOM and ARIA attributes (id, aria-label, event handlers…).

SplitPane

padding
Space
paddingInline
Space
paddingBlock
Space
background
Background
radius
Radius
shadow
Shadow
border
Border
as
LayoutElementDefault "div"
align
"center" | "stretch"Default "stretch"

stretch (default): content fills the pane. center: content sits in the middle, both ways.

Also takes 375 standard DOM and ARIA attributes (id, aria-label, event handlers…).