Description
Allotment is a React component for resizable split panes, derived from the split view code in VS Code. You place panes inside an Allotment element in a parent that has a height, and users can drag the edges to resize them, double-click an edge to reset it, and snap panes closed. Panes are declared with children, so adding, removing or hiding a pane is done by changing the React tree, and Allotment works out the new sizes. Each pane can have a minimum, maximum and preferred size, a fixed size, a snap behavior, and a priority that decides which panes resize first when the layout changes. You can nest one Allotment inside another to build editor-style layouts with sidebars and panels. The library is written in TypeScript and ships its own types, including a ref handle for resizing from code. It works with React 17, 18 and 19. The site says the library is used in more than 1,700 repositories on GitHub. It is installed with npm, and the stylesheet must be imported. The documentation also covers styling, including colors and sash size, and gives guidance for server rendering with frameworks such as Next.js.…
Highlights
- Resizable split panes from VS Code's code
- Declarative panes from React children
- Min, max, preferred and snap sizes
- Nested layouts
- TypeScript types and a ref handle
Ratings & Reviews
No ratings yet
Be the first to rate allotment.
People also visit
@gfazioli/mantine-split-pane
A Mantine 9 React component for resizable split pane layouts
allotment FAQ
What is Allotment?
A React component for resizable split panes, based on the split view code from VS Code.
Which React versions does it support?
React 17, 18 and 19, according to the site.
Why does nothing show up?
Check that the parent element has a height, since Allotment fills its parent and has no height of its own, and that the stylesheet is imported.
How do I stop a pane from being resized?
Set minSize and maxSize to the same value.
Can it be used with Next.js?
Yes. The FAQ says to render it on the client only, and the docs cover server rendering.
How do I let users drag a pane closed?
Set snap on the pane and give it a minSize. It snaps closed when it is dragged below half that size.
What are the best allotment alternatives?
Popular alternatives to allotment include react-split-pane, @rexxars/react-split-pane and @gfazioli/mantine-split-pane. See all allotment alternatives



















