Skip to content

Split

Two-column layout with configurable proportions that stacks to a single column when its own width gets narrow.

Import

import { Split } from "@hyzer-labs/ui"

Demo

fraction is the first column's share. auto sizes the first column to its content and gives the rest to the second. Below the stackBelow width (default sm, 640px of the Split's own width) the columns stack.

First
Second
<Split fraction="1/2">
	<div>First</div>
	<div>Second</div>
</Split>

Props

NameTypeDefaultNote
fraction'1/4' | '1/3' | '1/2' | '2/3' | '3/4' | 'auto''1/2'
gap'none' | 'sm' | 'md' | 'lg' | 'near' | 'away''md'near/away are the density distances — they tighten inside data-density-shift regions.
reversebooleanfalse
stackBelow'sm' | 'md' | 'lg''sm'Stacks under the --hz-width-sm/md/lg token (640/968/1200px) of the Split's own width. Resolves via var() — overriding the token retunes the threshold.
padding'none' | 'sm' | 'md' | 'lg' | 'near' | 'away''none'Both axes, on the split root — stackBelow measures the padded-down width. Shared LayoutPadding scale.
paddingInline'none' | 'sm' | 'md' | 'lg' | 'near' | 'away'Per-axis override — wins over padding on the inline axis. Same LayoutPadding scale.
paddingBlock'none' | 'sm' | 'md' | 'lg' | 'near' | 'away'Per-axis override — wins over padding on the block axis. Same LayoutPadding scale.
asstring'div'
classstringMerged after the hz-split class.
childrenSnippetTwo direct children become the columns.

Theme hooks

What this component promises your CSS. The reference theme styles exactly these — from @layer hz-theme, so your unlayered rules win. See Styling Components for the how.

Root class: .hz-split

Data attributes

HookValuesStyles
data-fraction'1/4' | '1/3' | '1/2' | '2/3' | '3/4' | 'auto'Ratio of the two columns above the stack threshold. Default 1/2.
data-gap'none' | 'sm' | 'md' | 'lg' | 'near' | 'away'Gap between the columns. Default md.
data-reversepresent when reversedVisual-only swap via order — DOM and focus order are preserved.
data-stack-below'sm' | 'md' | 'lg'Picks which --hz-width-* token the stack threshold resolves through, so overriding that token retunes when the split stacks. Default sm.
data-padding'none' | 'sm' | 'md' | 'lg' | 'near' | 'away'Padding, applied to the root. Default none.

Part classes

HookValuesStyles
.hz-split-layoutchild elementThe flex row. Carries the gap; the fraction and order rules reach your two children through it.

Accessibility

Split is a layout primitive with no ARIA semantics. DOM order determines reading and focus order regardless of visual arrangement.