Grid size
YouTube picks how many videos fit in a row from your window width. Grid size lets you set the count yourself, on Home, Subscriptions and channel tabs (Videos, Live, Shorts). Search and History are lists, so they stay as they are.
Settings
Section titled “Settings”The switch is Feeds → Grid size, off by default.
| Option | Range | Default |
|---|---|---|
| Videos per row | 2 to 8 | 4 |
| Shorts per row | 3 to 10 | 6 |
A new count applies at once, without a reload. The Subscriptions timeline headers keep spanning the full row.
How it works
Section titled “How it works”- The count is one CSS variable. YouTube writes its per-row counts inline on each grid (
--ytd-rich-grid-items-per-row,--ytd-rich-grid-slim-items-per-row). A stylesheet rule with!importantbeats a plain inline value, and YouTube’s item widths arecalc(100% / per-row - margin), so they follow. - Rows stay aligned. YouTube drops the left margin of the items it counted as first in a row. With a different count those are the wrong items, so Kempt gives every item the same margins.
- Home’s Shorts shelf needs code. The shelf draws only as many Shorts as YouTube’s own count, even when it holds more. On Home, a page-world handler sets the shelf’s
elementsPerRowto your count. YouTube resets that count whenever the window width changes, so the handler watches the shelf’selements-per-rowattribute and sets it again. - Off means YouTube’s count. Turning Grid size off, or leaving Home, gives the shelf back to YouTube’s layout code.