Split panel

Split panel for lit-material: two panes with a draggable, keyboard-operable divider.

  • 1.9 KB gzipped
  • @lit-material/split-panel 0.1.2
  • Renders on the server

Example

Install

npm install @lit-material/split-panel @lit-material/tokens
import "@lit-material/split-panel";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-split-panel>

Two panes with a divider between them that you drag, or move from the keyboard: request and response, editor and preview, list and detail.

Properties

PropertyAttributeTypeDefaultDescription
positionpositionnumber50The start pane's share, in percent.
minminnumber10Smallest start pane, in percent.
maxmaxnumber90Largest start pane, in percent.
orientationorientationSplitOrientation"horizontal"
labellabelstring"Resize panes"Accessible name of the divider; name it after the start pane, e.g. "Request".
disableddisabledbooleanfalse

Events

EventDescription
changeWhen the divider has moved (after a drag or a key press); detail: { position }.

Slots

SlotDescription
startThe first pane (left, or top when vertical).
endThe second pane.

CSS parts

PartDescription
dividerThe divider.

CSS custom properties

PropertyDescription
--lit-material-split-panel-divider-sizeDivider thickness (default 8px; the visible line is 1px).

Source on GitHub npm