Skip to contentKino
Skip to Content

Resizable

Panels you resize by dragging the handle between them, or by keyboard. A panel can fold away and back, and every change that isn’t a drag glides.

npx shadcn add https://kinoui.com/r/resizable.json
Share on

Examples

Invoice totals round the tax twice

KN-482 · Maya Chen

2h
Export to CSV drops the last row

KN-479 · Tomás Alvarez

5h
Onboarding checklist forgets skipped steps

KN-475 · Priya Raman

1d
Dark mode chart labels are hard to read

KN-471 · Jonas Lindqvist

2d
Search misses issues renamed this week

KN-468 · Maya Chen

3d
Weekly digest is sent twice on Mondays

KN-460 · Priya Raman

4d
KN-482 · Billing revamp

Invoice totals round the tax twice

On invoices with more than one tax rate, each line’s tax is rounded and then the total is rounded again, so a $1,284.50 invoice can show $1,284.51. Round once, on the total.

MCMaya Chen opened this 2 hours ago

Default

Drag a handle, or focus it and use the arrow keys. The sidebar is collapsible: drag it past its smallest size, press Enter on its handle, or call collapse() from a button, and it folds away.

Invoice totals round the tax twice

KN-482 · Maya Chen

2h
Export to CSV drops the last row

KN-479 · Tomás Alvarez

5h
Onboarding checklist forgets skipped steps

KN-475 · Priya Raman

1d
Dark mode chart labels are hard to read

KN-471 · Jonas Lindqvist

2d
Search misses issues renamed this week

KN-468 · Maya Chen

3d
Weekly digest is sent twice on Mondays

KN-460 · Priya Raman

4d
KN-482 · Billing revamp

Invoice totals round the tax twice

On invoices with more than one tax rate, each line’s tax is rounded and then the total is rounded again, so a $1,284.50 invoice can show $1,284.51. Round once, on the total.

MCMaya Chen opened this 2 hours ago

Gutter

With variant="gutter" each panel is a surface of its own, and the gap between them is the handle. Its grip shows under the pointer and while the handle has focus.

Release notes · Draft

Billing, rounded once

Invoices with several tax rates now round tax once, on the total, so what a customer pays matches what they see. CSV exports keep their last row.

  1. 09:41:02Cloning kino/web at 3f9c2a7
  2. 09:41:05Installing 1,284 packages
  3. 09:41:31Building the web app
  4. 09:42:10Compiled 412 pages in 38.6s
  5. 09:42:12Running 2,031 tests
  6. 09:43:012,031 passed
  7. 09:43:04Uploading the build
  8. 09:43:09Deployed to kino-git-billing.vercel.app

Vertical

Set orientation to vertical to stack the panels. Sizes in pixels, such as minSize="72px", keep a panel from closing up on a short screen.

Invoice totals round the tax twice

KN-482 · Maya Chen

2h
Export to CSV drops the last row

KN-479 · Tomás Alvarez

5h
Onboarding checklist forgets skipped steps

KN-475 · Priya Raman

1d
Dark mode chart labels are hard to read

KN-471 · Jonas Lindqvist

2d
Search misses issues renamed this week

KN-468 · Maya Chen

3d
Weekly digest is sent twice on Mondays

KN-460 · Priya Raman

4d
KN-482 · Billing revamp

Invoice totals round the tax twice

On invoices with more than one tax rate, each line’s tax is rounded and then the total is rounded again, so a $1,284.50 invoice can show $1,284.51. Round once, on the total.

MCMaya Chen opened this 2 hours ago

3 comments · Tomás Alvarez replied 20 minutes ago

Nested

A group inside a panel resizes on its own, and takes the variant of the group around it.

Installation

npx shadcn@latest add https://kinoui.com/r/resizable.json
Files
lib/reduce-motion.tslib/grip.tslib/refs.tslib/resize.tslib/scroll.tscomponents/kino/resizable.tsx
Packages
class-variance-authorityreact-resizable-panels

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

ResizablePanelGroup

PropTypeDefaultDescription
variant'default''gutter''default'A line between the panels, or panels as surfaces of their own with the gap between them as the handle. A group inside a panel takes its parent’s.
orientation'horizontal''vertical''horizontal'Side by side, or stacked.
onLayoutChange(layout) => voidNoneCalled with each panel’s size by its id, in percent, as the layout changes.
groupRefRef<GroupImperativeHandle>NoneReads the layout with getLayout() and sets it with setLayout(). Make one with useGroupRef().
resizeTargetMinimumSize{ fine, coarse }24 / 40How far around a handle the pointer can grab it, in pixels: fine by mouse, coarse by touch.

ResizablePanel

PropTypeDefaultDescription
defaultSizenumberstringNoneIts size on load: "30%" is a percentage, "240px" or a number is pixels. Panels without one share what’s left.
minSizenumberstring0The smallest it can be dragged to, in the same units.
maxSizenumberstring'100%'The largest it can be dragged to.
collapsiblebooleanfalseFolds away when a drag takes it halfway from minSize to its folded size, and on Enter on its handle. While folded to nothing it is inert.
collapsedSizenumberstring0Its size while folded.
panelRefRef<PanelImperativeHandle>Nonecollapse(), expand(), isCollapsed(), resize() and getSize(). Make one with usePanelRef().
aria-labelstringNoneNames the panel while its content scrolls, for when no heading with an id inside does.
classNamestringNoneFor the content’s layout, on the box that scrolls.

ResizableHandle

PropTypeDefaultDescription
aria-labelstringNoneWhat it resizes, such as “Resize sidebar”.
disabledbooleanfalseIt stays where it is, and its grip fades.

Data attributes

AttributeOnDescription
data-separatorResizableHandleinactive at rest, hover under the pointer, active while dragged, focus and disabled.
data-collapsedResizablePanelPresent while it is folded to nothing.
data-followingResizablePanelGroupPresent while a handle is dragged or the group changes size, when the panels follow with no transition.
data-variantResizablePanelGroup, ResizableHandledefault or gutter.
data-orientationResizablePanelGrouphorizontal or vertical.

Accessibility

  • Each handle is a focusable separator, as in the WAI-ARIA window splitter pattern: the arrow keys step it, Home and End take it to its ends, and Enter folds a collapsible panel away and back. Name it with aria-label.
  • A panel whose content is larger than it takes focus as a region, so the keyboard can scroll it. A folded panel is inert, so Tab skips what can’t be seen.
  • Around each handle, 24 pixels by mouse and 40 by touch can grab it, though the line is 1 pixel wide.
  • In forced colours the line and the grip take the system’s text colour.
  • When the system asks for less motion, the panels take their new size at once, and the grip doesn’t stretch.
  • In right to left, Enter folds the panel on the left of the handle. Dragging and the arrow keys follow the direction.