Get started
Introduction
What Jali is, the problem it solves for apps where people work on several things at once, and when not to use it.
On this page
Jali is a layout library for apps where people work on several things at once. Each thing gets a pane, and the panes sit in rows, columns and tabs. You describe the kinds of pane your app has. Jali decides where they go, how they fit the window, and how people move between them.
Its core has no framework and no dependencies. React renders it, from jali-layout/react.
The problem
Link to this section: The problemSome work doesn't happen one screen at a time. A support agent reads a ticket while checking the customer's last order. A credit reviewer keeps an application open beside the borrower's file. Someone in operations compares two shipments.
Most web apps show one view at a time, so people open browser tabs, lose their place and copy details between windows. Building panes by hand is a lot of work. You have to split and resize, decide what happens when the window gets narrow, keep focus in the right place, and remember the layout.
Jali does that work once, for every screen size.
What it gives you
Link to this section: What it gives youPanes that fold instead of squeeze
Link to this section: Panes that fold instead of squeezeEach pane kind says the narrowest and shortest it can be and still work. When the window is too small for every pane, Jali folds some of them into tabs of their neighbours. It never squeezes a tiled pane below its minimum. When the room comes back, so do the panes.
The pane you are working in, the pane it was opened from, and the details it opened fold last. On a phone, Jali shows one pane at a time; widen the window and the arrangement you had comes back.
Focus, undo and the keyboard
Link to this section: Focus, undo and the keyboardOne pane has focus, and commands act on it. Closing or tucking a pane away can be undone. F6 moves focus to the next pane, and every command has a key you can change or turn off. With the palette feature, ⌘K (Ctrl+K on Windows and Linux) lists them all.
A pane can report unsaved work, such as an edited query that hasn't run. Jali asks before any change would lose it.
A detail that follows a list
Link to this section: A detail that follows a listOpen a record from a list, and the record's pane follows the list's selection: move down the list and the detail shows each row in turn. It waits until the selection rests, so holding a key doesn't load every row on the way. Keep the detail to hold it on one record.
The layout in the address
Link to this section: The layout in the addressWith the urlSync() feature, the layout is written into the URL. A link opens the same panes in the same places, and Back and Forward step through the changes people made. If your app has a router, the router can own the address instead.
Curated pages
Link to this section: Curated pagesFor work that centres on one item, such as reviewing a loan application, you can design a page: a set of views in tabs, with a list of items beside it.
- In Single view, people see one view at a time, like any web app, and links open in a sheet over it.
- In Split view, they lay the views out side by side, starting from the layout you designed.
Only what you use
Link to this section: Only what you useEverything beyond laying out panes is a feature you pass in: the address, the ⌘K palette, Settings, renaming, Pop out. An app ships only the features it imports. See Features.
One package
Link to this section: One packagejali-layout is one package, with an entry for each part:
jali-layout: pane kinds, layouts,createJali, actions and events. No framework.jali-layout/react:<JaliRoot>,definePane, the hooks and the parts you place in your own chrome.- One entry per feature, such as
jali-layout/urlandjali-layout/palette, andjali-layout/featuresfor Jali's usual set. jali-layout/testingfor your tests. To give an AI model your panes as tools, see Let an agent arrange panes.
npm install jali-layoutpnpm add jali-layoutyarn add jali-layoutbun add jali-layoutvp add jali-layoutWhen not to use it
Link to this section: When not to use it- An app that shows one view at a time. If people never need two things on screen together, a router and ordinary pages are simpler.
- A dashboard of fixed tiles. Jali is for panes that people open, close, move and resize. A grid of charts that never changes shape doesn't need a layout tree.
- Windows that float and overlap. Jali's panes tile: they sit in rows, columns and tabs, not on top of each other. The one exception is Pop out, which moves a single pane into a window of its own.
- Bundle size above all. With React, Jali's floor is about 84 KB gzipped (its core, its React parts and its styles), because it fits, focuses, undoes and announces. A splitter on its own is much smaller. See Why Jali.