Guides
Styling
How to style react-splitkit using CSS, Tailwind, or data attributes.
react-splitkit is fully headless — it ships no visual opinions. You can style it with Tailwind CSS, CSS Modules, plain CSS, or any CSS-in-JS solution.
The styles.css file
The package includes a minimal styles.css that provides:
- CSS custom properties (design tokens) for the resizer
- Structural flex rules for the tablist slot layout (leading / items / trailing)
- Hover and resize-mode visual feedback on the built-in resizer
Import it once at the root of your app:
If you control all visuals yourself via Tailwind or custom CSS, you can skip this import entirely and copy the structural flex rules inline.
Styling via className and style props
Every component accepts className and style props for direct styling:
Styling via data attributes
Every rendered element carries data-* attributes you can target in CSS without adding extra classnames. This is useful for global stylesheets or design systems.
Layout structure
| Attribute | Element | Notes |
|---|---|---|
data-splitkit-root | LayoutRoot outer div | |
data-splitkit-tree | Underlying tree div | Hidden when a panel is maximized |
data-splitkit-split | Every SplitNode container | |
data-splitkit-cell | Each child slot inside a split | |
data-splitkit-maximized-overlay | Maximized panel overlay | |
data-direction="horizontal|vertical" | Split and cell elements | |
data-collapsed | Cell when its panel is collapsed | Only present when collapsed |
Resizer
| Attribute | Element | Notes |
|---|---|---|
data-splitkit-resizer | Resizer div | |
data-split-id | Resizer div | Which split it belongs to |
data-resizer-index | Resizer div | Position within the split |
data-direction | Resizer div | "horizontal" or "vertical" |
data-resizing | Resizer div | Present while actively dragging |
data-resize-mode | Resizer div | Present while in keyboard resize mode |
TabList
| Attribute | Element |
|---|---|
data-panel-tablist | role="tablist" container |
data-panel-id | role="tablist" container |
data-panel-tablist-leading | Leading slot wrapper |
data-panel-tablist-items | Tab items scroll wrapper |
data-panel-tablist-trailing | Trailing slot wrapper |
CSS examples
Resizer visual feedback
Collapsed cell
Tailwind example
The live examples use Tailwind exclusively. A typical panel chrome: