Skip to contentKino
Skip to Content
Docs

Density

How much room controls, rows and surfaces take. Pick Snug, Balanced or Airy for the whole app, or for one part of it.

Pick a density

Density
A digest at 09:00 on weekdays, to maya@example.com.

When someone writes @you in a comment or a description.

The tabs, the rows and the buttons change height and padding together, and text stays the same size.

Set the density

Components install with the density tokens and use Balanced unless you set another. Put data-density on <html>:

tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {  return (    <html lang='en' data-density='snug'>      <body>{children}</body>    </html>  )}

Or on any element, to change one part of a page:

tsx
<aside data-density='snug'>  <Filters /></aside>

A dialog or a popover renders under <body>, so it takes the page's density, not the density of the element its trigger sits in.

Tokens

Each density gives every token a size, here in pixels at a 16px root.

TokenUsed forSnugBalancedAiry
--control-heightA button, an input, a tab list323640
--control-height-xsThe smallest control, never under 24242428
--control-height-smA small control283236
--control-height-lgA large control364044
--control-paddingThe space beside a control's label81014
--row-paddingAbove and below a row, such as an accordion's trigger101620
--surface-paddingInside a popover or a card121620
--surface-padding-lgInside a dialog162024
--surface-gapBetween the blocks of a surface121620

The tokens are in your global CSS, one block per density. To change a value, add a rule of your own below them:

css
[data-density='snug'] {  --control-height: 1.875rem;}

Don't edit the blocks themselves, because adding another Kino component writes them again.

Use the tokens in your own component

tsx
function SearchField(props: React.ComponentProps<'input'>) {  return (    <input      type='search'      className='h-(--control-height) rounded-md border px-(--control-padding) text-sm'      {...props}    />  )}