GridKit v1.138.0

EN
Neu in 1.138.0, 1.137.0 und 1.135.1

1.138.0

> Built as 1.136.0 on the branch tabelle/sortierung-merken; numbered 1.138.0 once the Heatmap (1.137.0) had reached main.

Neu 8 Einträge

  • GK.sortMemory
  • What is kept
  • A live table and a SortLink list have no id of their own; they are told apart by their…
  • Restoring: a page that arrives without a sort in its address gets the kept one — a…
  • +4 weitere

Geändert 3 Einträge

  • SortLink writes data-gk-sort-param and data-gk-dir-param on the link — only when…
  • A static table no longer reads or writes its old key gk-sort-<id>; the sorts saved…
  • Unchanged

Behoben 1 Einträge

  • (after the review of this version)

1.137.0

GridKit\Heatmap is rows × columns with the colour as the value — weekdays by hours, pages by days — a real table with five steps taken from the design tokens, every cell spoken in words, and cells with no data or too little data marked…

Neu 7 Einträge

  • GridKit\Heatmap
  • A real table
  • Five steps
  • Narrow screens
  • +3 weitere
Neue Klassen gk-heat gk-heat-cell gk-heat-colhead gk-heat-count gk-heat-empty gk-heat-end +14

Beispiele: Heatmap

1.135.1

In the SSI Panel video list the like rate stood as "15,6" on one line and "%" on the next.

Behoben 1 Einträge

  • Table: a right-aligned column (align => 'right') gives its cells gk-nowrap, in…
Ältere Versionen (12)
  • 1.135.0 A click on a link in the SSI Panel gave no sign at all until the next page arrived — on a slow page (1 s and more on the server) it looked as if nothing had happened, and people clicked again.Neu 6
  • 1.134.0 The SSI Panel builds every list as one card — search on the left, filters as selects, the main button on the right of the toolbar — and GridKit had three gaps exactly there: newButton() could only open a modal (a "New invoice" that is a…Neu 4
  • 1.133.0 An image picker's action that cannot be done right now said nothing: the SSI Panel's customer pressed the bin on an image that is still used on another page, and the answer appeared somewhere below the gallery — "the delete does not work".Neu 5
  • 1.132.0 A switch between two drawings of one list.Neu 5
  • 1.131.0 The video frame in landscape. .gk-video-frame has been 9:16 only: the SSI Panel put a 16:9 video (its approval dialog "Video freigeben", a recording of a survival day) into a narrow portrait box with black bars on both sides (Martin…Neu 3
  • 1.130.0 One frame, not two.Geändert 4
  • 1.129.0 One look for every row button.Neu 2 Geändert 5
  • 1.128.0 Back keeps the list, and a row button that may not act says why.Neu 2 Geändert 2 Behoben 2
  • 1.127.0 The reset of TableHeader is seen at a glance.Geändert 2
  • 1.126.0 The name of the system is the first step of the "you are here" line and the way back to the dashboard — the path stands to its right, like a repository path on GitHub.Neu 3
  • 1.125.0 GridKit\FileManager is a media library and a receipt drawer — folders, thumbnails or a list, many files uploaded at once with a progress bar each, chosen, dropped or pasted — and FileManager::receive() checks every upload on the server…Neu 7 Geändert 2
  • 1.124.0 GridKit\Kanban puts tasks, orders, campaigns and tickets in columns of cards that move by drag and drop, by finger or entirely by keyboard, with limits per column and every move saved — and a "Move to" form on each card that works…Neu 6 Geändert 2

Alle Versionen im Changelog

Table seit 0.9

Complete table with all features

The "VAT" header has a help icon, and the delete button a tooltip of its own instead of the browser's title seit 0.9. Two articles are on invoices: their delete is locked with the reason ('lockedIf', 1.128.0), and Back after a search shows the list as it was left. The PDF symbol is one of the 40 row-action symbols that are SVG since 1.129.0; the buttons rest grey at full strength and take their colour on hover. The toolbar ends with a side button (toolbarButton()) and the main button, which is a link here (newButton() with 'href', 1.134.0).

New Article
UnitNetVATStatusAktionen
ART-001Webdesign Paket Spsch1.200,00 €20 %active
ART-002Hosting StandardStk9,90 €20 %active
ART-003SEO Beratungh95,00 €20 %inactive
ART-004Logo Designpsch450,00 €20 %draft
ART-005Newsletter Setuppsch350,00 €20 %active
Code anzeigen
$table = new Table('articles');
$table->setData($articles)
    ->search(['article_number', 'name'])
    ->column('article_number', 'Article No.', ['width' => '120px', 'sortable' => true, 'nowrap' => true, 'muted' => true])
    ->column('name', 'Description', ['sortable' => true, 'nowrap' => true])
    ->column('unit', 'Unit', ['width' => '80px', 'nowrap' => true])
    ->column('net_price', 'Net', ['format' => 'currency', 'align' => 'right', 'width' => '100px', 'nowrap' => true])
    ->column('tax_rate', 'VAT', ['format' => 'percent', 'width' => '80px', 'nowrap' => true,
                                 'tooltip' => 'The rate the net price is taxed at'])
    ->column('is_active', 'Status', ['format' => 'label', 'nowrap' => true])
    ->filter('is_active', 'select', ['options' => ['active' => 'Active', 'inactive' => 'Inactive', 'draft' => 'Draft'], 'placeholder' => 'All Status'])
    ->button('edit', ['icon' => 'edit', 'class' => 'primary', 'position' => 'right', 'params' => ['id' => 'article_id']])
    ->button('pdf', ['icon' => 'picture_as_pdf', 'class' => 'secondary', 'position' => 'right', 'params' => ['id' => 'article_id'], 'title' => 'PDF'])
    ->button('delete', ['icon' => 'delete', 'class' => 'danger', 'position' => 'right', 'params' => ['id' => 'article_id'],
                        'tooltip' => ['text' => 'Deletes the article', 'tone' => 'danger'], 'lockedIf' => 'in_use'])
    // The right of the toolbar (1.134.0): a side button, then the main button — here a link
    // ('href'; a modal or 'id'/'data' for your own script work too).
    ->toolbarButton('Import', ['icon' => 'upload'])
    ->newButton('New Article', ['icon' => 'add', 'href' => '#'])
    ->nowrap(true)
    // A box of its own where the content is narrower than the table
    // (a 900px window beside the sidebar); the page no longer scrolls sideways.
    ->stickyColumn()
    ->paginate(5)
    ->render();

Invoice list with date and currency formatting

AktionenDueStatusAktionen
RE-2026-001Mustermann GmbH1.450,00 €paid
RE-2026-002Tech Solutions AG3.200,00 €pending
RE-2026-003Weber & Partner890,50 €overdue
RE-2026-004Digital Agentur Wien5.600,00 €draft
RE-2026-005Startup Hub Vienna2.100,00 €paid

Compact table without toolbar

E-MailRoleActive
Martin Huber[email protected]admin✓
Anna Schneider[email protected]editor✓
Thomas Berger[email protected]viewer–
Lisa Wagner[email protected]editor✓
Peter Gruber[email protected]admin–

Rows that open a side sheet seit 1.91

List table seit 1.92 · column priority seit 1.92 · who cell seit 1.92

Read in the row, change in the sheet: a click anywhere on a row opens its record beside the list — full screen on a phone. One name cell with two lines, groups instead of a status label per row, and colour only for what needs acting on. The six rules behind it are in the agent skill. size('list') sets the row they describe, and 'priority' lets columns give way by the list's own width — open the sheet or narrow the window and watch "Last seen" go first.

Users
UserPlanLast seenLast 30 days
With access3
Without access2
Code anzeigen
// Rule 4: colour only where something needs acting on — a count that
// is fine stays plain text.
foreach ($people as &$p) {
    $p['failing_html'] = $p['failing'] > 0
        ? '<span class="gk-label gk-label-red">' . (int) $p['failing'] . ' failing</span>'
        : '—';
}
unset($p);

(new Table('demo-people'))
    ->setData($people)
    ->caption('Users')
    ->size('list')
    ->groupBy('access', ['with' => 'With access', 'without' => 'Without access'])
    ->rowLink(['sheet' => 'demo-person-sheet', 'url' => 'form/f_person_sheet.php'])
    ->column('name', 'User', ['sub' => 'email'])
    ->column('plan', 'Plan', ['priority' => 3])
    ->column('seen', 'Last seen', ['muted' => true, 'priority' => 4])
    ->column('failing_html', 'Last 30 days', ['format' => 'html', 'priority' => 2])
    ->toolbar(false)
    ->render();

One row standing for many seit 1.91

What is rarely needed folds into one row. The toggle shows and hides the rows its aria-controls names; the chevron and aria-expanded carry the state, so the label never has to change.

Users and chart profiles
UserPlan
Anna SchneiderPro
Thomas BergerTeam
Code anzeigen
echo <<<'HTML'
<div class="gk-table-wrap gk-table-mobile-card">
  <table class="gk-table">
    <caption class="gk-sr-only">Users and chart profiles</caption>
    <thead><tr><th scope="col">User</th><th scope="col">Plan</th></tr></thead>
    <tbody>
      <tr><td data-label="User">Anna Schneider</td><td data-label="Plan">Pro</td></tr>
      <tr><td data-label="User">Thomas Berger</td><td data-label="Plan">Team</td></tr>
      <tr class="gk-table-more"><td colspan="2">
        <button type="button" class="gk-table-more-toggle" aria-expanded="false" aria-controls="demo-profiles">
          <span class="gk-table-more-name">3 chart profiles</span>
          <span class="gk-cell-sub">Created from charts — they cannot sign in and have no plan.</span>
        </button>
      </td></tr>
    </tbody>
    <tbody id="demo-profiles" hidden>
      <tr><td data-label="User">Profile: Berlin, 1984</td><td data-label="Plan">—</td></tr>
      <tr><td data-label="User">Profile: Graz, 1991</td><td data-label="Plan">—</td></tr>
      <tr><td data-label="User">Profile: Linz, 2002</td><td data-label="Plan">—</td></tr>
    </tbody>
  </table>
</div>
HTML;

Sizes

size('sm') Compact
NameValueStatus
Widget A1.200 €active
Widget B340 €inactive
Widget C890 €active
size('md') Standard
NameValueStatus
Widget A1.200 €active
Widget B340 €inactive
Widget C890 €active
size('lg') Spacious
NameValueStatus
Widget A1.200 €active
Widget B340 €inactive
Widget C890 €active
$table->size('sm');  // compact
$table->size('md');  // standard (default)
$table->size('lg');  // spacious

Display variants

variant('default') Default
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('bordered') Bordered
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('striped') Striped
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('celled') Celled
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('padded') Padded
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('compact') Compact
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('selectable') Selectable
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('minimal') Minimal
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('flat') Flat
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft
variant('inverted') Inverted
DescriptionPriceStatus
Webdesign Paket1.200 €active
Hosting Standard9,90 €active
SEO Beratung95 €inactive
Logo Design450 €draft

Definition table

First column as label/key — ideal for detail views.

Company nameSSI Schaefer IT Solutions GmbH
Founded2003
LocationWien, Oesterreich
Employees24
Websitessi.at
StatusActive
$table->variant('default');     // Default
$table->variant('bordered');    // Full border lines
$table->variant('striped');     // Zebra stripes
$table->variant('celled');      // Grid lines around each cell
$table->variant('padded');      // Extra spacing
$table->variant('compact');     // Compact, more rows
$table->variant('selectable');  // Hover cursor, clickable
$table->variant('minimal');     // Only separator, no border
$table->variant('flat');        // Completely flat
$table->variant('inverted');    // Dark table (also in Light Mode)

// A variant is one slot: a second call REPLACES the first, it does not add.
$table->variant('celled')->variant('padded');   // celled is dropped — padded wins

// Variant and size are separate slots, so those two do stack:
$table->variant('striped')->size('sm');

Sticky head and column seit 0.9

stickyHead() keeps the header row in view while the rows scroll under it — on the page, or in a box as high as you say ('320px' here). stickyColumn() keeps the first column in view while the table scrolls sideways, with the checkbox in front of it. Scroll the box both ways. On a phone a table in card mode stays as it is.

Articles with a sticky head and column
Article No.UnitVATGrossStockSupplierStatusAktionen
Webdesign Paket SART-001psch1.200,00 €20 %1.440,00 €7Supplier Aactive
Hosting StandardART-002Stk9,90 €20 %11,88 €14Supplier Bactive
SEO BeratungART-003h95,00 €20 %114,00 €21Supplier Cinactive
Logo DesignART-004psch450,00 €20 %540,00 €28Supplier Ddraft
Newsletter SetupART-005psch350,00 €20 %420,00 €35Supplier Eactive
Social Media PaketART-006psch680,00 €20 %816,00 €42Supplier Factive
E-Mail MarketingART-007psch420,00 €20 %504,00 €49Supplier Gdraft
Content ErstellungART-008h75,00 €20 %90,00 €56Supplier Hactive
Server AdministrationART-009h110,00 €20 %132,00 €63Supplier Iinactive
SSL ZertifikatART-010Stk49,00 €20 %58,80 €70Supplier Jactive
Domain RegistrationART-011Stk15,00 €20 %18,00 €77Supplier Kactive
Webdesign Paket LART-012psch3.500,00 €20 %4.200,00 €84Supplier Lactive
App EntwicklungART-013h125,00 €20 %150,00 €91Supplier Mdraft
Datenbank MigrationART-014psch890,00 €20 %1.068,00 €98Supplier Nactive
Security AuditART-015psch1.500,00 €20 %1.800,00 €105Supplier Oinactive
Code anzeigen
(new Table('demo-sticky'))
    ->setData($stickyArticles)
    ->caption('Articles with a sticky head and column')
    ->selectable('article_id')
    ->column('name', 'Description', ['sortable' => true, 'minWidth' => '200px'])
    ->column('article_number', 'Article No.', ['muted' => true])
    ->column('unit', 'Unit')
    ->column('net_price', 'Net', ['format' => 'currency', 'sortable' => true])
    ->column('tax_rate', 'VAT', ['format' => 'percent'])
    ->column('gross', 'Gross', ['format' => 'currency'])
    ->column('stock', 'Stock', ['align' => 'right'])
    ->column('supplier', 'Supplier', ['minWidth' => '360px'])
    ->column('is_active', 'Status', ['format' => 'label'])
    ->button('edit', ['icon' => 'edit', 'params' => ['id' => 'article_id']])
    ->nowrap()
    ->toolbar(false)
    ->stickyHead('320px')
    ->stickyColumn()
    ->render();

Columns to show and hide seit 1.108

columnToggle() puts a "Columns" button in the toolbar. Untick a column in its menu and it is gone from the header and the rows — through a sort, a search and a page change, and on your next visit too: the browser remembers it for this table. 'hidden' => true starts a column hidden (here the unit and the VAT), 'toggle' => false keeps one on screen (the article number). The CSV holds what the table shows; on a phone a hidden column is left out of the card, and if it was the card's title the next column takes its place.

Article No.UnitVATStatus
ART-001Webdesign Paket Spsch1.200,00 €20 %active
ART-002Hosting StandardStk9,90 €20 %active
ART-003SEO Beratungh95,00 €20 %inactive
ART-004Logo Designpsch450,00 €20 %draft
ART-005Newsletter Setuppsch350,00 €20 %active
Code anzeigen
(new Table('demo-columns'))
    ->setData(array_slice($articles, 0, 8))
    ->search(['article_number', 'name'])
    ->column('article_number', 'Article No.', ['muted' => true, 'toggle' => false])
    ->column('name', 'Description', ['sortable' => true])
    ->column('unit', 'Unit', ['hidden' => true])
    ->column('net_price', 'Net', ['format' => 'currency', 'align' => 'right', 'sortable' => true])
    ->column('tax_rate', 'VAT', ['format' => 'percent', 'hidden' => true])
    ->column('is_active', 'Status', ['format' => 'label'])
    ->columnToggle()
    ->exportCsv('articles.csv')
    ->paginate(5)
    ->render();

Row spacing, chosen at the screen seit 0.9

densityToggle() puts Compact · Normal · Roomy into the toolbar. The steps are those of Theme::density() (konsole, the default, weit), applied to this table only and remembered for its id in this browser — choose one, sort or search, reload the page. Normal is GridKit's default rhythm; on a page set to konsole the control starts at Compact. Without the script the control is not shown.

No.NetStatusAktionen
ART-001Webdesign Paket S1.200,00 €active
ART-002Hosting Standard9,90 €active
ART-003SEO Beratung95,00 €inactive
ART-004Logo Design450,00 €draft
ART-005Newsletter Setup350,00 €active
ART-006Social Media Paket680,00 €active
Code anzeigen
(new Table('demo-density'))
    ->setData(array_slice($articles, 0, 6))
    ->search(['name'])
    ->column('article_number', 'No.', ['muted' => true, 'width' => '110px'])
    ->column('name', 'Description', ['sortable' => true])
    ->column('net_price', 'Net', ['format' => 'currency', 'align' => 'right'])
    ->column('is_active', 'Status', ['format' => 'label'])
    ->button('edit', ['icon' => 'edit', 'position' => 'right', 'params' => ['id' => 'article_id']])
    ->densityToggle()
    ->render();

Sort memory

Every sortable table remembers its sort — the column and the direction, nothing else. Click a header, reload the page or come back later: the same sort is there. A third click on the same column (ascending, descending, off) goes back to the default order and forgets it. It is kept per user, per page and per table, a sort in the address wins, and a search or a filter is never kept. It works for the static table here, for server-driven tables, live tables and SortLink lists alike, and needs no call. data-gk-sort-merken="aus" on a table (or any container around it) switches it off.

ART-001Webdesign Paket S1.200,00 €
ART-002Hosting Standard9,90 €
ART-003SEO Beratung95,00 €
ART-004Logo Design450,00 €
ART-005Newsletter Setup350,00 €
ART-006Social Media Paket680,00 €
Code anzeigen
(new Table('demo-sort-memory'))
    ->setData(array_slice($articles, 0, 6))
    ->column('article_number', 'No.', ['muted' => true, 'width' => '110px', 'sortable' => true])
    ->column('name', 'Description', ['sortable' => true])
    ->column('net_price', 'Net', ['format' => 'currency', 'align' => 'right', 'sortable' => true])
    ->toolbar(false)
    ->paginate(false)
    ->render();

Editing in the cell seit 0.9

editable() and a column's 'edit' ('text', 'number' or 'select') let a value be changed where it stands: click a cell with the dotted line, or Tab to it and press Enter. Enter or leaving the field saves, Escape puts the old value back, Tab saves and opens the next one. The field holds the stored value (1200, not €1,200.00). Every change fires gk:celledit; with a URL GridKit posts it there and shows the answer. This page has no server, so the listener below answers with respondWith() after a moment, the way an endpoint would — and refuses a negative price.

Articles, editable in the cell
No.DescriptionNetStatus
ART-001Webdesign Paket S1.200,00 €Active
ART-002Hosting Standard9,90 €Active
ART-003SEO Beratung95,00 €Inactive
ART-004Logo Design450,00 €Draft
Code anzeigen
(new Table('demo-edit'))
    ->setData(array_slice($articles, 0, 4))
    ->caption('Articles, editable in the cell')
    ->editable('article_id')           // with a URL: ->editable('article_id', '/api/article-cell.php')
    ->column('article_number', 'No.', ['muted' => true, 'width' => '110px'])
    ->column('name', 'Description', ['edit' => 'text'])
    ->column('net_price', 'Net', ['format' => 'currency', 'edit' => 'number'])
    ->column('is_active', 'Status', ['format' => 'label', 'edit' => 'select', 'labels' => [
        'active'   => ['color' => 'green', 'text' => 'Active'],
        'draft'    => ['color' => 'orange', 'text' => 'Draft'],
        'inactive' => ['color' => 'gray', 'text' => 'Inactive'],
    ]])
    ->toolbar(false)
    ->render();

Mobile-Responsive

Resize the browser window to <768px to see the mobile layout. In card mode the first line of a card is its head: the checkbox, the left buttons, the title and the right buttons side by side, then the other fields without rules (since 1.106.0). The title is the first column that is not 'muted' — here the description, because the article number is muted; on a row with rowLink() it is the cell with the link.

mobile('card') – Standard
Article No.DescriptionPriceStatusAktionen
ART-001Webdesign Paket S1.200 €active
ART-002Hosting Standard9,90 €active
ART-003SEO Beratung95 €inactive
mobile('scroll') – Horizontal Scroll
Article No.DescriptionPriceStatus
ART-001Webdesign Paket S1.200 €active
ART-002Hosting Standard9,90 €active
ART-003SEO Beratung95 €inactive
hideOnMobile – Hide columns
Article No.DescriptionPriceStatus
ART-001Webdesign Paket S1.200 €active
ART-002Hosting Standard9,90 €active
ART-003SEO Beratung95 €inactive
// Demo 1: Complete article table with pagination
$table = new Table('articles');
$table->setData($articles)
    ->search(['article_number', 'name'])
    ->column('name', 'Description', ['sortable' => true])
    ->column('net_price', 'Net', ['format' => 'currency'])
    ->column('tax_rate', 'VAT', ['format' => 'percent'])
    ->column('is_active', 'Status', ['format' => 'label'])
    ->button('edit', ['icon' => 'edit', 'class' => 'primary'])
    ->button('delete', ['icon' => 'delete', 'class' => 'danger'])
    ->newButton('New Article', ['icon' => 'add'])
    ->nowrap(true)
    ->paginate(5)
    ->render();

// Mobile-Responsive
$table->mobile('card');      // Cards on mobile (default): the first column that is
                             // not 'muted' is the card's title, beside the buttons
$table->mobile('scroll');    // Horizontal Scroll
$table->column('desc', 'Description', ['hideOnMobile' => true]);

Selection, bulk actions, CSV export, footer, a link in a cell seit 0.9

selectable() adds a checkbox column, a select-all in the header and a bulk bar that appears while rows are ticked; its delete button fires gk:bulkdelete with { ids, tableId }. footer() writes a summary row, loadTime() the milliseconds, toolbarHtml() puts your own markup into the toolbar, 'href' turns a cell into a link with a quiet second line from 'sub', bulkAction() adds a button to the bulk bar (it fires gk:bulkaction; tick a row and try it) and exportCsv() a toolbar button that downloads what the table shows, after the search and the sort, as CSV.

toolbarHtml()
Articles with a selection
No.NetStatus
ART-001Webdesign Paket S
psch
1.200,00 €active
ART-002Hosting Standard
Stk
9,90 €active
ART-003SEO Beratung
h
95,00 €inactive
ART-004Logo Design
psch
450,00 €draft
ART-005Newsletter Setup
psch
350,00 €active
ART-006Social Media Paket
psch
680,00 €active
Code anzeigen
(new Table('demo-select'))
    ->setData(array_slice($articles, 0, 6))
    ->caption('Articles with a selection')
    ->selectable('article_id')
    ->search(['name'])
    ->toolbarHtml('<span class="gk-label gk-label-blue">toolbarHtml()</span>')
    ->column('article_number', 'No.', ['muted' => true, 'width' => '110px'])
    ->column('name', 'Description', ['href' => '#table-select', 'sub' => 'unit', 'sortable' => true])
    ->column('net_price', 'Net', ['format' => 'currency', 'align' => 'right'])
    ->column('is_active', 'Status', ['format' => 'label'])
    ->footer(['Total', ['text' => '2,849.40', 'align' => 'right', 'bold' => true]])
    ->loadTime(37)
    ->bulkAction('archive', ['icon' => 'archive', 'label' => 'Archive'])
    ->bulkAction('void', ['icon' => 'block', 'confirm' => 'Void the selected articles?', 'color' => 'danger'])
    ->exportCsv('articles.csv')
    ->stickyColumn()   // a box of its own just above the phone width, where it was 8px too wide
    ->render();

Form seit 0.9

Grid Layout (16 columns)

Code anzeigen
$form = new Form('article_form');
$form->action('save/process_article.php')
    ->ajax()
    ->hidden('article_id', '')
    ->row()
        ->field('article_number', 'Article No.', 'text', ['required' => true, 'width' => 8])
        ->field('name', 'Description', 'text', ['required' => true, 'width' => 8])
    ->endRow()
    ->field('description', 'Description', 'textarea', ['rows' => 3])
    ->row()
        ->field('unit', 'Unit', 'select', ['options' => ['Stk' => 'Piece', 'h' => 'Hour', 'psch' => 'Flat rate'], 'width' => 5])
        ->field('net_price', 'Net price', 'number', ['step' => '0.01', 'width' => 5])
        ->field('tax_rate', 'VAT %', 'select', ['options' => ['20' => '20%', '10' => '10%', '0' => '0%'], 'width' => 6])
    ->endRow()
    ->field('is_active', 'Active', 'toggle', ['inline' => true])
    ->submit('Save')
    ->render();

Checkbox & Radio seit 0.9

Toggle & Slider seit 0.9

50
75

File Upload seit 0.9

Dateien hierher ziehen oder klickenMax. 10MB

RichText Editor (CKEditor 5) seit 0.9

Local vendor bundle (assets/ckeditor5/), no CDN. Initialization via IntersectionObserver — works in tabs and modals too.

RichText with pictures

Add 'upload' => '/your/endpoint' and the editor gains a picture button, drag & drop, paste, size handles and alt text. Without it nothing changes — an upload button with nowhere to put the file is worse than no button.

Pictures render as a plain <img> inside the paragraph, carrying their size as an inline style — deliberately not as <figure class="image">, so the same content survives being sent as an e-mail, where no stylesheet loads and Outlook does not lay out <figure> reliably.

Try it: click the picture below to get the size handles and the alt-text button. The upload button works too, but this public demo stores nothing and says so.

Clearable date/time fields

Trash icon only appears when a value is set — disappears automatically after clearing.

New field types

Uniform height of 44px for all input types. No browser spinner for number.

Select extensions seit 0.9

Searchable Select – Country selection with search field


Multi-Select – Select multiple categories (with chips)

Webdesign
SEO
Hosting
Development
Support
Consulting

Ajax Select – Customer search via API (min. 2 characters)

// Grid Layout (16 columns)
$form->row()
    ->field('name', 'Name', 'text', ['width' => 8])
    ->field('email', 'E-Mail', 'email', ['width' => 8])
->endRow()
->field('agree', 'Accept terms', 'checkbox', ['checked' => true])
->field('payment', 'Payment method', 'radio', [
    'options' => ['card' => 'Credit card', 'bank' => 'Bank transfer'],
    'value' => 'card', 'inline' => true
])
->field('active', 'Active', 'toggle', ['inline' => true])
->field('volume', 'Volume', 'range', ['min' => 0, 'max' => 100, 'value' => 50])
->field('doc', 'Document', 'file', ['accept' => '.pdf', 'multiple' => true, 'maxSize' => '10MB'])
->field('content', 'Content', 'richtext', ['preset' => 'full'])
->field('datum',  'Date',    'date',     ['value' => date('Y-m-d'),      'clearable' => true])
->field('farbe', 'Color',  'color',  ['value' => '#6750a4'])
->field('preis', 'Price',  'number', ['placeholder' => '0.00'])

File Upload (extended)

Drag & Drop

Select files via drag & drop or click

Validation

Type, size (min/max), count and total size

Preview

Image thumbnails directly in the upload zone

Queue UI

Progress indicator, states, errors per file

Variant 1 — Simple

Document upload with type filter and size limit.

Datei hierher ziehen oder klickenPDF or Word, max. 10 MB

Variant 2 — Images with preview

Multi-upload with image thumbnails directly in the zone.

Dateien hierher ziehen oder klickenMax. 8 MB

Variant 3 — Full configuration

All options combined: types, min/max size, total limit, file count.

Dateien hierher ziehen oder klickenMax. 10 MB/file · 50 MB total · 10 files

Queue states live

Manually cycle queue items through states: pending → uploading → done / error.

Validation error demo

Zone with strict limits — PDF only, max. 100 KB.

Datei hierher ziehen oder klickenPDF only, max. 100 KB — other files will be rejected

Color Picker seit 1.0

Styled native color input — color swatch on the left (clickable) + hex field on the right. Swatch and hex value sync automatically, validated as #RRGGBB.

Live Demo

Behavior

  • Clicking the color swatch opens the native browser color picker
  • The hex text field shows the current value and is directly editable
  • Both fields synchronize in real time
  • Validation: only valid #RRGGBB values are accepted
  • Uniform 44px height like all other GridKit inputs

Form Density

Wrap any form in .gk-form-compact for reduced spacing. All elements — inputs, selects, toggles, checkboxes — scale down proportionally.

Normal (default)
Compact .gk-form-compact
<!-- Normal (default) -->
<form>
  <div class="gk-field">...</div>
</form>

<!-- Compact -->
<form class="gk-form-compact">
  <div class="gk-field">...</div>
</form>

<!-- Also works as wrapper -->
<div class="gk-form-compact">
  <div class="gk-card">
    <div class="gk-field">...</div>
  </div>
</div>

Fill from a record, show errors

values() fills every field whose name is a key of the record (a field's own 'value' wins), errors() puts each message under its field, and a message that names no field is shown once above the form. Together they are an edit form shown again after a failed save.

Code anzeigen
$invoice = ['number' => 'INV-2026-007', 'customer' => '', 'status' => 'draft', 'amount' => '12,5', 'ignored' => 'a key without a field'];
(new Form('demo-values'))
    ->field('number', 'Number', 'text', ['width' => 8, 'required' => true])
    ->field('status', 'Status', 'select', ['width' => 8, 'options' => ['draft' => 'Draft', 'paid' => 'Paid']])
    ->field('customer', 'Customer', 'text', ['required' => true])
    ->field('amount', 'Amount', 'text')
    ->values($invoice)
    ->errors(['customer' => 'Required', 'amount' => 'Not a number', '_form' => 'The invoice was not saved.'])
    ->render();

Conditional fields

'showIf' shows a field only while another field has a value: equals, not, in or filled. A field that is not shown is hidden and disabled, so it is not posted and required blocks nothing. Choose a kind below; the VAT id waits for the company name, which waits for the kind.

Code anzeigen
(new Form('demo-show-if'))
    ->field('kind', 'Kind', 'select', ['native' => true, 'value' => 'person', 'options' => ['person' => 'Person', 'company' => 'Company', 'club' => 'Club']])
    ->field('company', 'Company name', 'text', ['required' => true, 'showIf' => ['field' => 'kind', 'equals' => 'company']])
    ->field('vat', 'VAT id', 'text', ['showIf' => ['field' => 'company', 'filled' => true]])
    ->field('birthday', 'Date of birth', 'date', ['showIf' => ['field' => 'kind', 'equals' => 'person']])
    ->field('board', 'Board members', 'text', ['showIf' => ['field' => 'kind', 'in' => ['company', 'club']]])
    ->render();

Tabs in a form seit 0.9

tab() puts the fields that follow it into a tab: fields before the first tab stand above the tabs, fields after endTabs() below them. Press Save while the city is empty: the form opens the tab Address, the browser points at the field, and the tab carries a badge that counts what is wrong until it is put right. Sent, the form comes back on the tab you were on — it posts that tab as _gk_tab, and values($_POST) hands it back (this demo stores nothing). In a modal or a side sheet add tabsSecondary().

Code anzeigen
$customer = ['ct_number' => 'C-1042', 'ct_name' => 'Ada Lovelace', 'ct_email' => '[email protected]'];
(new Form('demo-tabs'))
    ->action('#form')
    ->field('ct_number', 'Customer no.', 'text', ['width' => 8])
    ->tab('general', 'General', ['icon' => 'person'])
        ->field('ct_name', 'Name', 'text', ['required' => true])
        ->field('ct_email', 'Email', 'email')
    ->tab('address', 'Address', ['icon' => 'home'])
        ->row()
            ->field('ct_street', 'Street', 'text', ['width' => 10])
            ->field('ct_zip', 'Postcode', 'text', ['width' => 6])
        ->endRow()
        ->field('ct_city', 'City', 'text', ['required' => true])
    ->tab('notes', 'Notes', ['icon' => 'sticky_note_2', 'count' => 2])
        ->field('ct_note', 'Internal note', 'textarea')
    ->endTabs()
    ->field('ct_tags', 'Tags', 'text')
    ->values(array_filter($_POST, 'is_string'))   // what was sent, the tab included …
    ->values($customer)              // … else the record
    ->submit('Save')
    ->render();

The same form shown again after a failed save. errors() opens the first tab with an error — over the tab that was posted (here Notes) — and every tab with errors carries the count, in PHP, so it holds without a script.

Code anzeigen
(new Form('demo-tabs-errors'))
    ->action('#form')
    ->field('ce_number', 'Customer no.', 'text', ['width' => 8])
    ->tab('general', 'General', ['icon' => 'person'])
        ->field('ce_name', 'Name', 'text', ['required' => true])
        ->field('ce_email', 'Email', 'email')
    ->tab('address', 'Address', ['icon' => 'home'])
        ->row()
            ->field('ce_street', 'Street', 'text', ['width' => 10])
            ->field('ce_zip', 'Postcode', 'text', ['width' => 6])
        ->endRow()
        ->field('ce_city', 'City', 'text', ['required' => true])
    ->tab('notes', 'Notes', ['icon' => 'sticky_note_2', 'count' => 2])
        ->field('ce_note', 'Internal note', 'textarea')
    ->endTabs()
    ->values(['ce_number' => 'C-1042', 'ce_name' => 'Ada Lovelace', 'ce_zip' => '10A', '_gk_tab' => 'notes'])
    ->errors(['ce_city' => 'Required', 'ce_zip' => 'Not a postcode', '_form' => 'The customer was not saved.'])
    ->submit('Save')
    ->render();

Cards seit 0.9

Card grid for structured content — responsive, with header, body and footer.

Auto-Grid (responsive)

Webdesign
Package S · from 1,200 €
Responsive design, CMS integration and SEO basics for small projects.
Hosting
Managed · from 9.90 €/month
SSD storage, daily backups and SSL included. 99.9% uptime.
SEO
Consulting · 95 €/h
Keyword analysis, on-page optimization and monthly reports.

Fixed column count

Performance
99.9% Uptime
Security
SSL & Firewall
Support
Available 24/7
Backups
Daily automatic

2 columns

Development
Frontend and backend development with modern technologies.
Consulting
Strategic IT consulting for digital transformation.

3 columns

Web
Mobile
Cloud
.gk-cards          // Auto-Grid (min 280px)
.gk-cards-2 / -3 / -4  // Fixed columns
.gk-card .gk-card-header / .gk-card-body / .gk-card-footer
.gk-card-link      // Clickable Card

Stat Cards seit 0.9

Customers248
Revenue84.250,00 €
Orders64
Outstanding12.480,00 €
$stats = new StatCards('dashboard');
$stats->card('Customers', 248, ['format' => 'number', 'color' => 'blue'])
    ->card('Revenue', 84250.00, ['format' => 'currency', 'color' => 'green'])
    ->card('Outstanding', 12480.00, ['format' => 'currency', 'color' => 'red'])
    ->render();

Admin blocks

The small parts an admin page used to style itself, as classes. Light and dark come from the roles.

Compact figures seit 1.92

3failing
12openfor 3 days
40done
Code anzeigen
(new StatCards('demo-tiles'))
    ->compact()
    ->card('failing', 3, ['color' => 'danger'])
    ->card('open', 12, ['sub' => 'for 3 days'])
    ->card('done', 40)
    ->render();

Setting seit 1.92 and answer tiles seit 1.92

Takes effect at once, also on running sessions.
Signs the person out everywhere.
Code anzeigen
(new Form('demo-settings'))
    ->field('demo_login', 'Sign-in allowed', 'toggle', ['hint' => 'Takes effect at once, also on running sessions.', 'value' => 1])
    ->field('demo_lock', 'Lock the account', 'toggle', ['hint' => 'Signs the person out everywhere.', 'danger' => true])
    ->field('demo_next', 'What happens now?', 'choice', ['value' => 'fix', 'options' => [
        'fix'   => 'Fix it now',
        'later' => ['title' => 'Later', 'hint' => 'Stays on the list until next week.'],
    ]])
    ->render();

Read-only value seit 1.92

Plan Everything The superuser always has everything.
Code anzeigen
echo <<<'HTML'
<div class="gk-field-static">
  <span class="gk-field-static-label">Plan</span>
  <span class="gk-field-static-value">Everything</span>
  <span class="gk-field-hint">The superuser always has everything.</span>
</div>
HTML;

Status dots seit 1.92 and avatar colours seit 0.9

today 08:12 3 days ago running never
Code anzeigen
echo <<<'HTML'
<div class="gk-flex gk-flex-col gk-gap-xl">
  <div class="gk-flex gk-flex-wrap gk-gap-xl gk-items-center">
    <span><span class="gk-dot gk-dot-success" aria-hidden="true"></span> today 08:12</span>
    <span><span class="gk-dot gk-dot-warning" aria-hidden="true"></span> 3 days ago</span>
    <span><span class="gk-dot gk-dot-primary gk-dot-pulse" aria-hidden="true"></span> running</span>
    <span><span class="gk-dot gk-dot-outline" aria-hidden="true"></span> never</span>
  </div>
  <div class="gk-flex gk-gap-md">
    <span class="gk-avatar gk-avatar-sm gk-avatar-initials gk-avatar-tone-1" aria-hidden="true">AS</span>
    <span class="gk-avatar gk-avatar-sm gk-avatar-initials gk-avatar-tone-2" aria-hidden="true">TB</span>
    <span class="gk-avatar gk-avatar-sm gk-avatar-initials gk-avatar-tone-3" aria-hidden="true">LW</span>
    <span class="gk-avatar gk-avatar-sm gk-avatar-initials gk-avatar-tone-4" aria-hidden="true">PG</span>
    <span class="gk-avatar gk-avatar-sm gk-avatar-initials gk-avatar-tone-5" aria-hidden="true">MH</span>
  </div>
</div>
HTML;

Chart colours seit 1.92

Model A 41 % Model B 27 % Model C 18 % Model D 9 % Other 5 %
Code anzeigen
echo <<<'HTML'
<div class="gk-flex gk-flex-wrap gk-gap-xl">
  <span><span class="gk-swatch gk-swatch-1" aria-hidden="true"></span> Model A 41 %</span>
  <span><span class="gk-swatch gk-swatch-2" aria-hidden="true"></span> Model B 27 %</span>
  <span><span class="gk-swatch gk-swatch-3" aria-hidden="true"></span> Model C 18 %</span>
  <span><span class="gk-swatch gk-swatch-4" aria-hidden="true"></span> Model D 9 %</span>
  <span><span class="gk-swatch gk-swatch-5" aria-hidden="true"></span> Other 5 %</span>
</div>
HTML;

Actions in a message seit 1.0, a finger-sized button seit 0.9

2 runs are stuck.
Code anzeigen
echo <<<'HTML'
<div class="gk-message gk-message-warning">
  <span>2 runs are stuck.</span>
  <div class="gk-message-actions"><button type="button" class="gk-btn gk-btn-outlined gk-btn-warning gk-btn-touch">Check now</button></div>
</div>
HTML;

Sortable container seit 1.97

Entries a person puts in order by hand. Write the container with data-gk-sortierbar and give each entry a data-gk-sort-id; js/sortierbar.js adds a handle to every entry (from two entries on). Drag the handle with a mouse or a finger, or focus it and press Space, move with the arrow keys, press Space again to put it down or Esc to cancel. Links and buttons inside an entry keep working. With data-gk-sortierbar-url and -csrf the new order is posted as {"ids":[…]}; without a url the container only fires gk:sortiert, as here.

survivaltraining.at

Online, 14 pages

manifestor-akademie.net

Draft, 6 pages

paneon.ssi.at

Online, 9 pages

deike.at

Online, 4 pages · Open

lohr.example

Draft, 2 pages

  • Welcome mail

    Sent right after the sign-up

  • Reminder

    Two days later

  • Offer

    A week later

Code anzeigen
echo <<<'HTML'
<div class="demo-sort-grid" data-gk-sortierbar aria-label="Websites, in the order you want them">
  <div data-gk-sort-id="12"><h4>survivaltraining.at</h4><p>Online, 14 pages</p></div>
  <div data-gk-sort-id="7"><h4>manifestor-akademie.net</h4><p>Draft, 6 pages</p></div>
  <div data-gk-sort-id="31"><h4>paneon.ssi.at</h4><p>Online, 9 pages</p></div>
  <div data-gk-sort-id="18" data-gk-sort-titel="Deike Pfeil"><h4>deike.at</h4><p>Online, 4 pages · <a href="#sortierbar">Open</a></p></div>
  <div data-gk-sort-id="22"><h4>lohr.example</h4><p>Draft, 2 pages</p></div>
</div>
<ul class="demo-sort-list" data-gk-sortierbar>
  <li data-gk-sort-id="a"><h4>Welcome mail</h4><p>Sent right after the sign-up</p></li>
  <li data-gk-sort-id="b"><h4>Reminder</h4><p>Two days later</p></li>
  <li data-gk-sort-id="c"><h4>Offer</h4><p>A week later</p></li>
</ul>
<script>
  document.addEventListener('gk:sortiert', function (e) { console.log('gk:sortiert', e.detail.ids); });
</script>
HTML;

Card variants seit 0.9

gk-card-elevated trades the border for a shadow, gk-card-flat keeps a hairline, gk-card-image puts a picture flush with the top, gk-card-title and gk-card-actions fill a header, and gk-card-link makes the whole card a link.

Elevated
A shadow instead of a border.
Flat
A hairline and nothing else.
A picture flush with the top.
Link
The whole card is the link.

KPI cards: colour roles and trends seit 0.9

A card takes a colour role (primary, success, info, warning, danger) as well as the colour names; 'trend' with a sign draws the arrow, 'highlight' frames the card that needs attention.

Revenue12.450,80 €+12%
Paid98+3%
Open14-2%
Late6
Errors3
Code anzeigen
(new StatCards('demo-stat-roles'))
    ->card('Revenue', 12450.80, ['format' => 'currency', 'icon' => 'euro', 'color' => 'primary', 'trend' => '+12%'])
    ->card('Paid', 98, ['format' => 'number', 'icon' => 'check_circle', 'color' => 'success', 'trend' => '+3%'])
    ->card('Open', 14, ['format' => 'number', 'icon' => 'schedule', 'color' => 'info', 'trend' => '-2%'])
    ->card('Late', 6, ['format' => 'number', 'icon' => 'warning', 'color' => 'warning'])
    ->card('Errors', 3, ['format' => 'number', 'icon' => 'error', 'color' => 'danger', 'highlight' => true])
    ->render();

Layout

Segment seit 1.0

Container for related content — single, stacked or with header.

A simple segment visually groups related content.

Segment with header

Project overview

Segments can have a header to describe the content.

Stacked segments

Step 1

Create account and confirm email.

Step 2

Fill out profile and configure settings.

Step 3

Create first project and get started.

Variants

Raised

With shadow — stands out more from the background.

Muted

Muted background — for secondary content.

Compact

Less padding — for denser layouts.

.gk-segment / .gk-segment-raised / .gk-segment-muted / .gk-segment-compact
.gk-segment-padded / .gk-segment-basic
.gk-segments > .gk-segment  // Stacked

Message seit 1.0

Notices, warnings and status messages for users.

A neutral message without a specific status.

Types

Information
Your changes are saved automatically.
Success
The profile has been successfully updated.
Warning
Your SSL certificate expires in 7 days.
Error
Could not establish connection to the database.
  • Host unreachable
  • Timeout after 30 seconds

Compact

Compact message for less space.

Small seit 1.0

A notch denser and without a margin of its own, for a place that sets its own gaps: the sentence above a chat, a hint beside a form. All four tones work, light and dark; a long address wraps.

Your data stays with us
The conversation is stored on our server and never passed on.
Saved. Nothing else to do.
The link expires in 7 days.
Could not reach the server. Try again in a minute.

Dismissible

This message can be closed.
.gk-message / .gk-message-info / .gk-message-success
.gk-message-warning / .gk-message-error / .gk-message-compact
.gk-message-sm       // Denser, no margin of its own
.gk-message-dismiss  // Close button

The title on the left and the actions on the right. A long title pushes the buttons to the next line instead of squeezing them.

Customers

Code anzeigen
echo '<div class="gk-page-header"><h1>Customers</h1><div class="gk-page-header-actions">';
echo Button::render('Export', ['variant' => 'outlined', 'icon' => 'download']);
echo Button::render('New customer', ['variant' => 'filled', 'color' => 'primary', 'icon' => 'add', 'shape' => 'pill']);
echo '</div></div>';

Tabs seit 1.0

Karteireiter: the tabs sit framed on their surface, the chosen one grows into it — taller, bold, a 3px accent on top. Ordered with .gk-tab-nav-karte and .gk-tab-flaeche; without them every tab row keeps the previous shape. Levels: page tabs > second row (on a line, also inside a window) > segmented button. On a phone every Karteireiter row is a grid, two columns up to 480px — nothing scrolls, nothing is cut.

Tabs from PHP seit 1.0

GridKit\Tabs writes the markup of this page for you: every style, alignment and option below is a call, a panel is HTML or a callable. Like Table it prints; html() returns the same string. Under each example is the code that ran. A wrong value (an unknown style, a key used twice, an active() that names no tab) raises a warning and renders the nearest correct thing — never an exception.

The sign-up form — our default texts apply.

Your own text for the confirmation page.

Three reminders.

Legal notice and privacy.

Code anzeigen
(new Tabs('demo-php'))
    ->style('karte')
    ->label('Texts of this page')
    ->tab('signup', 'Sign-up', ['icon' => 'edit_note', 'content' => '<p>The sign-up form — our default texts apply.</p>'])
    ->tab('confirm', 'Confirmation page', ['icon' => 'task_alt', 'badge' => 'Customised', 'content' => '<p>Your own text for the confirmation page.</p>'])
    ->tab('remind', 'Reminders', ['icon' => 'alarm', 'count' => 3, 'content' => '<p>Three reminders.</p>'])
    ->tab('legal', 'Legal', ['icon' => 'gavel', 'badge' => ['text' => 'Error', 'tone' => 'error'], 'content' => '<p>Legal notice and privacy.</p>'])
    ->tab('stats', 'Statistics', ['icon' => 'bar_chart', 'disabled' => true])
    ->render();

Styles — style('karte' | 'linie' | 'kapsel' | 'text'); the card style puts its panels on the surface by itself (surface(false) takes it away).

style('karte')

Three details.

The history.

style('linie')

Three details.

The history.

style('kapsel')

Three details.

The history.

style('text')

Three details.

The history.

Code anzeigen
foreach (['karte', 'linie', 'kapsel', 'text'] as $style) {
    (new Tabs('demo-php-' . $style))->style($style)->label("Style $style")
        ->tab('a', 'Overview', ['content' => "<p>style('$style')</p>"])
        ->tab('b', 'Details', ['count' => 3, 'content' => '<p>Three details.</p>'])
        ->tab('c', 'History', ['content' => '<p>The history.</p>'])
        ->render();
}

Alignment and size — align('top' | 'links' | 'rechts' | 'unten' | 'fest') and size('sm' | 'md' | 'lg'). A bottom row is written after its panels, so the reading order is the order on the screen.

The row stands after the panels.

The details.

Code anzeigen
(new Tabs('demo-php-links'))->style('linie')->align('links')->label('Settings, left')
    ->tab('general', 'General', ['icon' => 'tune', 'content' => '<p>General settings.</p>'])
    ->tab('look', 'Look', ['icon' => 'palette', 'content' => '<p>Colours and fonts.</p>'])
    ->tab('privacy', 'Privacy', ['icon' => 'lock', 'content' => '<p>Who sees what.</p>'])
    ->render();
(new Tabs('demo-php-unten'))->style('kapsel')->align('unten')->size('sm')->label('Sections, bottom')
    ->tab('a', 'Overview', ['content' => '<p>The row stands after the panels.</p>'])
    ->tab('b', 'Details', ['content' => '<p>The details.</p>'])
    ->render();

Options — iconOnly() keeps the word for a screen reader and gives every tab aria-label (with its badge and count) and title; neutral(), fluid(), iconTop(); secondary(), fill(), oneRow() and flat() for the shapes of 1.99 and 1.104.

The word stays for a screen reader.

Twelve messages.

The history.

Home.

Search.

Inbox.

Code anzeigen
(new Tabs('demo-php-icons'))->style('kapsel')->iconOnly()->neutral()->label('Symbols only')
    ->tab('a', 'Overview', ['icon' => 'dashboard', 'content' => '<p>The word stays for a screen reader.</p>'])
    ->tab('b', 'Inbox', ['icon' => 'inbox', 'count' => 12, 'content' => '<p>Twelve messages.</p>'])
    ->tab('c', 'History', ['icon' => 'history', 'content' => '<p>The history.</p>'])
    ->render();
(new Tabs('demo-php-fluid'))->style('linie')->fluid()->iconTop()->size('lg')->label('Full width, symbol above')
    ->tab('a', 'Home', ['icon' => 'home', 'content' => '<p>Home.</p>'])
    ->tab('b', 'Search', ['icon' => 'search', 'content' => '<p>Search.</p>'])
    ->tab('c', 'Inbox', ['icon' => 'inbox', 'content' => '<p>Inbox.</p>'])
    ->render();

Links between pages — when every tab has an href the row is a <nav> of links, the current page (active() or the parameter) marked with aria-current="page". A row is links or panels, never both.

Code anzeigen
(new Tabs('demo-php-pages'))->style('linie')->label('Pages')->active('results')
    ->tab('edit', 'Edit', ['href' => '#tabs-php', 'icon' => 'edit'])
    ->tab('results', 'Results', ['href' => '#tabs-php', 'icon' => 'bar_chart'])
    ->tab('mails', 'Mails', ['href' => '#tabs-php', 'icon' => 'mail', 'count' => 2])
    ->render();

Deep links and memory seit 1.0

hash() keeps the chosen tab in the address: choose one and look at the address bar (#tabs&demo-deep=…) — the demo's own part of the fragment stays beside it, and Back still leaves the page. Open that address in another window and the tab is there. remember() keeps the last tab of the row in this browser: reload the page. param('tab') lets the server open a tab from ?tab=… without any script. The address wins over the memory, active() — the page's own decision — over both.

Your profile.

Your password.

Where you are signed in.

Billing.

Code anzeigen
(new Tabs('demo-deep'))->style('linie')->label('Account')->hash()->remember()->param('tab')
    ->tab('profile', 'Profile', ['content' => '<p>Your profile.</p>'])
    ->tab('password', 'Password', ['content' => '<p>Your password.</p>'])
    ->tab('sessions', 'Sessions', ['content' => '<p>Where you are signed in.</p>'])
    ->tab('billing', 'Billing', ['content' => '<p>Billing.</p>'])
    ->render();

Links into it: #tabs&demo-deep=billing switches here and now; ?tab=sessions loads the page with Sessions open on the server.

Lazy panels seit 1.0

'url' => … leaves the panel empty until its tab is opened, then fetches it (same origin, X-Requested-With), with a skeleton meanwhile and aria-busy on the panel, and keeps it. Widgets inside work: the table in Figures sorts, because GK.initContent() runs on the answer. A failure shows the table's failure state with “Try again” — never the server's own error page. 'reload' => true fetches every time. A page with an older gridkit.js shows a link to the panel's address instead.

This panel came with the page; the others are fetched when you open them.

Code anzeigen
(new Tabs('demo-lazy'))->style('karte')->label('Invoices')
    ->tab('now', 'Now', ['content' => '<p>This panel came with the page; the others are fetched when you open them.</p>'])
    ->tab('figures', 'Figures', ['icon' => 'insights', 'url' => 'api/tab-panel.php?part=figures'])
    ->tab('slow', 'Slow', ['icon' => 'hourglass_top', 'url' => 'api/tab-panel.php?part=slow'])
    ->tab('fail', 'Fails', ['icon' => 'error', 'url' => 'api/tab-panel.php?part=fail'])
    ->tab('time', 'Every time', ['icon' => 'schedule', 'url' => 'api/tab-panel.php?part=time', 'reload' => true])
    ->render();

Events: a switch that can be refused seit 1.0

Every switch — a click, the arrow keys, GK.tabs.select(), the address — fires gk:tabchange first, and it is cancelable: change the name below and choose another tab. The tab stays (focus included) and asks; after a yes the page switches with { force: true }. gk:tabshown follows every switch.

Twelve orders.

No notes yet.


Code anzeigen
(new Tabs('demo-unsaved'))->style('linie')->label('Customer')
    ->tab('edit', 'Edit', ['content' => '<div class="gk-field"><label class="gk-label-text" for="demo-unsaved-name">Name</label><input class="gk-input" id="demo-unsaved-name" value="Ecklund &amp; Partner"></div>'])
    ->tab('orders', 'Orders', ['content' => '<p>Twelve orders.</p>'])
    ->tab('notes', 'Notes', ['content' => '<p>No notes yet.</p>'])
    ->render();
echo <<<'HTML'
<pre class="demo-tabs-log" id="demo-unsaved-log" aria-live="polite"></pre>
<script>
(function () {
  var row = document.getElementById('demo-unsaved');
  var field = document.getElementById('demo-unsaved-name');
  var log = document.getElementById('demo-unsaved-log');
  var saved = field.value;
  function say(line) { log.textContent = [line].concat(log.textContent.split('\n').slice(0, 3)).join('\n'); }
  row.addEventListener('gk:tabchange', function (e) {
    if (e.target !== row) return;   // the events bubble: a row nested inside fires here too
    say('gk:tabchange ' + e.detail.from + ' → ' + e.detail.to + ' (' + e.detail.source + ')');
    if (!e.cancelable || e.detail.from !== 'edit' || field.value === saved) return;
    e.preventDefault();             // the tab stays: the name is not saved
    GK.confirm('Leave without saving the name?', { confirmText: 'Leave', danger: true }).then(function (yes) {
      if (!yes) return;
      field.value = saved;
      GK.tabs.select(row, e.detail.to, { force: true });
    });
  });
  row.addEventListener('gk:tabshown', function (e) {
    if (e.target === row) say('gk:tabshown ' + e.detail.to);
  });
})();
</script>
HTML;

The JS API seit 1.0

GK.tabs.select(), current(), badge(), count() and reload() take the row or its id — rows written by hand as well as by Tabs.

Four new messages.

No drafts.

Sent mail.

Code anzeigen
(new Tabs('demo-api'))->style('linie')->label('Mail')
    ->tab('inbox', 'Inbox', ['count' => 4, 'content' => '<p>Four new messages.</p>'])
    ->tab('drafts', 'Drafts', ['content' => '<p>No drafts.</p>'])
    ->tab('sent', 'Sent', ['content' => '<p>Sent mail.</p>'])
    ->render();
echo <<<'HTML'
<div class="demo-tabs-api" id="demo-api-buttons">
  <button type="button" class="gk-btn gk-btn-outlined gk-btn-neutral gk-btn-sm" data-demo-api="more">One more mail</button>
  <button type="button" class="gk-btn gk-btn-outlined gk-btn-neutral gk-btn-sm" data-demo-api="error">Mark Drafts as failed</button>
  <button type="button" class="gk-btn gk-btn-outlined gk-btn-neutral gk-btn-sm" data-demo-api="clear">Clear the marks</button>
  <button type="button" class="gk-btn gk-btn-outlined gk-btn-neutral gk-btn-sm" data-demo-api="sent">Open Sent</button>
  <output id="demo-api-current"></output>
</div>
<script>
document.getElementById('demo-api-buttons').addEventListener('click', function (e) {
  var b = e.target.closest('[data-demo-api]');
  if (!b) return;
  var count = document.querySelector('#demo-api [data-tab="inbox"] .gk-tab-count');
  if (b.dataset.demoApi === 'more') GK.tabs.count('demo-api', 'inbox', (count ? Number(count.textContent) : 0) + 1);
  if (b.dataset.demoApi === 'error') GK.tabs.badge('demo-api', 'drafts', 'Error', { tone: 'error' });
  if (b.dataset.demoApi === 'clear') { GK.tabs.badge('demo-api', 'drafts', null); GK.tabs.count('demo-api', 'inbox', null); }
  if (b.dataset.demoApi === 'sent') GK.tabs.select('demo-api', 'sent', { focus: true });
  document.getElementById('demo-api-current').textContent = 'GK.tabs.current() → ' + GK.tabs.current('demo-api');
});
</script>
HTML;

A row wider than its box seit 1.0

Ten tabs in a 340px box. A line, pill or text row still scrolls sideways, and a round arrow shows at each side that has more — a click pages the row. Measured on the row itself, like the card grid. Every tab stays a tab of the one row: the arrow keys and Home/End reach all of them and bring each into view, a screen reader hears all ten; the arrows are only for the pointer. The card style keeps its grid.

Overview.

Details.

History.

Settings.

Members.

Billing.

Invoices.

Reports.

Integrations.

Audit log.

Overview.

Details.

History.

Settings.

Members.

Billing.

Invoices.

Reports.

Integrations.

Audit log.

Overview.

Details.

History.

Settings.

Members.

Billing.

Invoices.

Reports.

Integrations.

Audit log.

Code anzeigen
$areas = ['Overview', 'Details', 'History', 'Settings', 'Members', 'Billing', 'Invoices', 'Reports', 'Integrations', 'Audit log'];
foreach (['linie', 'kapsel', 'text'] as $style) {
    $row = (new Tabs('demo-over-' . $style))->style($style)->label("Ten tabs, $style");
    foreach ($areas as $i => $area) $row->tab('t' . $i, $area, ['content' => "<p>$area.</p>"]);
    echo '<div class="demo-tabs-box demo-tabs-box-340">';
    $row->render();
    echo '</div>';
}

Page tabs with symbol, badge and count

A badge only reports a deviation from the default (“Customised”, “Error”) — never “Default” on every tab. gk-tab-badge-error is the red one: the word stays, because colour alone says nothing. A count is a number of things behind the tab.

The sign-up form — our default texts apply.

Your own text for the confirmation page.

The welcome mail.

Three reminders.

The unsubscribe page.

Legal notice and privacy.

<div class="gk-tabs">
    <div class="gk-tab-nav gk-tab-nav-karte">
        <button class="gk-tab-btn gk-active" data-tab="a"><span class="material-icons gk-tab-icon" aria-hidden="true">edit_note</span><span>Sign-up</span></button>
        <button class="gk-tab-btn" data-tab="b">…<span>Confirmation page</span><span class="gk-tab-badge">Customised</span></button>
        <button class="gk-tab-btn" data-tab="c">…<span>Reminders</span><span class="gk-tab-count">3</span></button>
        <button class="gk-tab-btn" data-tab="d">…<span>Legal</span><span class="gk-tab-badge gk-tab-badge-error">Error</span></button>
    </div>
    <div class="gk-tab-panel gk-tab-flaeche gk-active" data-tab="a">…</div>
    <div class="gk-tab-panel gk-tab-flaeche" data-tab="b">…</div>
</div>

A page of tabs: page tabs, surface, second row, card

The shape of an editor page. The page tabs are cards on their surface; the second row inside the surface is a line tab row — words on a thin line, the chosen one with a 3px stroke in the main colour, no boxes, no grey. The levels never look alike. The corners of both are --gk-tab-radius (4px; set it on any ancestor to change it).

  1. Changes
  2. Approval
  3. Publish

Two steps to go until publishing: the preview is not up to date, and the page changed after it was approved.

<nav class="gk-tab-nav gk-tab-nav-karte" aria-label="Areas">…</nav>
<div class="gk-tab-flaeche">
    <nav class="gk-tab-nav gk-tab-nav-karte gk-tab-nav-secondary" aria-label="Ways to edit">…</nav>
    <div class="gk-card">…</div>
</div>

One card alone on the surface

When a card is the only thing on a framed surface, the surface already is the card: the card loses its edge, shadow, rounding and padding, and its head (symbol, heading, line) and body stand flush with the content of the other tabs. A card inside it, or a card next to other content, keeps its frame. Nothing to order — it follows from .gk-card being the only child of .gk-tab-flaeche.

Material and rights

Made with AI (for the video as a whole): Yes. Material of others needs a proof of rights.

Music: a card inside the card keeps its frame.

Costs — a card next to another one keeps its frame.

Steps.

<div class="gk-tab-panel gk-tab-flaeche" data-tab="a">
    <div class="gk-card">   <!-- the only child: no second frame -->
        <div class="gk-card-header">…</div>
        <div class="gk-card-body">…</div>
    </div>
</div>

A row that does not fit its box

Six tabs in boxes of 700, 560 and 340px. A row that fits stays the one line above; one that does not becomes the grid of the phone — every tab whole, every cell as tall as its row, the chosen one still grown into the surface. GK.tabsFit measures the row itself, so no window width has to be guessed (it puts .gk-tab-nav-raster on and takes it off). Without the script the row simply stays a line.

Preview, 700px box.

Script, 700px box.

Conversation, 700px box.

Material & rights, 700px box.

Log & costs, 700px box.

Publication, 700px box.

Preview, 560px box.

Script, 560px box.

Conversation, 560px box.

Material & rights, 560px box.

Log & costs, 560px box.

Publication, 560px box.

Preview, 340px box.

Script, 340px box.

Conversation, 340px box.

Material & rights, 340px box.

Log & costs, 340px box.

Publication, 340px box.

Tabs between pages, with a second row

Links in a <nav>, the current page with aria-current="page". The second row stands quieter on a line inside the surface; a third level is a segmented button, never a tab row.

<nav class="gk-tab-nav gk-tab-nav-karte" aria-label="Areas">
    <a class="gk-tab-btn" href="/results" aria-current="page">…</a>
</nav>
<div class="gk-tab-flaeche">
    <nav class="gk-tab-nav gk-tab-nav-karte gk-tab-nav-secondary" aria-label="Views">…</nav>
    <div class="gk-segmented" role="group" aria-label="Period">…</div>
</div>

View toggle

One list, two drawings: a table and cards. The page renders both, each in a data-gk-view block inside a data-gk-view-scope; a .gk-segmented with data-gk-view-toggle chooses, and the choice is remembered in the browser (since 1.132.0). The toggle is rendered hidden and shown by the script; without it the default drawing stands.

NameState
CarlaActive
AntonDraft
<div class="gk-segmented" role="group" aria-label="View" data-gk-view-toggle="list" data-gk-view-default="table" hidden>
    <button type="button" class="gk-segmented-item" data-gk-set-view="table" aria-pressed="false">Table</button>
    <button type="button" class="gk-segmented-item" data-gk-set-view="cards" aria-pressed="false">Cards</button>
</div>
<div data-gk-view-scope="list">
    <div data-gk-view="table">…</div>
    <div data-gk-view="cards" hidden>…</div>
</div>

Nested tabs

A .gk-tabs inside a panel of another: a click on an outer tab leaves the inner choice alone (fixed in 1.101.0 — it used to clear every inner tab). Arrow keys move inside one row only.

Name, address, tax number.

Two contacts.

No notes yet.

Twelve invoices.

Tabs inside a window

The window is already the surface, so its tabs take the second-row shape and no .gk-tab-flaeche.

Company name and address.

IBAN and BIC.

The logo for invoices.

Light and dark side by side

Roles only: the edge is the outline mixed with 30% text colour (≥ 3:1 in every theme, light and dark).

Light mode.

Two details.

Dark mode.

Two details.

Variants: style × alignment × option seit 1.0

One row, three choices. The style is a class on the row (.gk-tab-nav-karte, -linie, -kapsel, -text), the alignment another (top is the default; -links, -rechts, -unten, -fest), and any number of options (-sm, -lg, -fluid, -icon-oben, -nur-icon, -neutral) join them. One script serves every form: role, selection, arrow keys by axis, Home and End. A row without any of these classes looks as it did before. Links between pages (<nav> with <a> and aria-current="page") take the same classes and keep their place: they are links, not a switch.

Builder: choose the shape, copy the markup

Six choices, a live preview, the markup it is made from and the same row as a GridKit\Tabs call. The preview and the listing are one string, so what you see is what you copy. Every choice is a class; try the arrow keys inside the preview.

The same row from PHP, with GridKit\Tabs (1.111.0):

Styles

The same three tabs in each style. Colours come from tokens on the row (--gk-tab-akzent for the stroke or fill, --gk-tab-akzent-text for the chosen word, --gk-tab-kante for the track): set them on the row itself to change one row. Light and dark are measured, not guessed — the chosen word is at least 4.5:1, the track and focus ring at least 3:1.

Card — .gk-tab-nav-karte with .gk-tab-flaeche on the panels, as before.

The overview.

Three details.

The history.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-karte" aria-label="Card style">
    <button class="gk-tab-btn gk-active" data-tab="s-karte-a">Overview</button>
    <button class="gk-tab-btn" data-tab="s-karte-b">Details<span class="gk-tab-count">3</span></button>
    <button class="gk-tab-btn" data-tab="s-karte-c">History</button>
  </div>
  <div class="gk-tab-panel gk-tab-flaeche gk-active" data-tab="s-karte-a"><p>The overview.</p></div>
  <div class="gk-tab-panel gk-tab-flaeche" data-tab="s-karte-b"><p>Three details.</p></div>
  <div class="gk-tab-panel gk-tab-flaeche" data-tab="s-karte-c"><p>The history.</p></div>
</div>
HTML;

Line — .gk-tab-nav-linie: words on a thin track, a 3px stroke under the chosen one.

The overview.

Three details.

The history.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-linie" aria-label="Line style">
    <button class="gk-tab-btn gk-active" data-tab="s-linie-a">Overview</button>
    <button class="gk-tab-btn" data-tab="s-linie-b">Details<span class="gk-tab-count">3</span></button>
    <button class="gk-tab-btn" data-tab="s-linie-c">History</button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="s-linie-a"><p>The overview.</p></div>
  <div class="gk-tab-panel" data-tab="s-linie-b"><p>Three details.</p></div>
  <div class="gk-tab-panel" data-tab="s-linie-c"><p>The history.</p></div>
</div>
HTML;

Pill — .gk-tab-nav-kapsel: the row lies on a quiet track, the chosen tab is filled.

The overview.

Three details.

The history.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-kapsel" aria-label="Pill style">
    <button class="gk-tab-btn gk-active" data-tab="s-kapsel-a">Overview</button>
    <button class="gk-tab-btn" data-tab="s-kapsel-b">Details<span class="gk-tab-count">3</span></button>
    <button class="gk-tab-btn" data-tab="s-kapsel-c">History</button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="s-kapsel-a"><p>The overview.</p></div>
  <div class="gk-tab-panel" data-tab="s-kapsel-b"><p>Three details.</p></div>
  <div class="gk-tab-panel" data-tab="s-kapsel-c"><p>The history.</p></div>
</div>
HTML;

Text — .gk-tab-nav-text: only words; the chosen one is bold with a thin line.

The overview.

Three details.

The history.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-text" aria-label="Text style">
    <button class="gk-tab-btn gk-active" data-tab="s-text-a">Overview</button>
    <button class="gk-tab-btn" data-tab="s-text-b">Details<span class="gk-tab-count">3</span></button>
    <button class="gk-tab-btn" data-tab="s-text-c">History</button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="s-text-a"><p>The overview.</p></div>
  <div class="gk-tab-panel" data-tab="s-text-b"><p>Three details.</p></div>
  <div class="gk-tab-panel" data-tab="s-text-c"><p>The history.</p></div>
</div>
HTML;

Links between pages take the same classes. The current page is aria-current="page"; a click leaves the page, so these tabs keep their place from one page to the next.

Code anzeigen
echo <<<'HTML'
<nav class="gk-tab-nav gk-tab-nav-linie" aria-label="Pages">
  <a class="gk-tab-btn" href="#tabs-stile" aria-current="page">Overview</a>
  <a class="gk-tab-btn" href="#tabs-stile">Results</a>
  <a class="gk-tab-btn" href="#tabs-stile">Settings</a>
</nav>
HTML;

Alignment

Top is the default and needs no class. A side row stands next to its panels — from 601px wide; on a phone it becomes the horizontal row, so nothing is squeezed. The arrow keys follow the axis: up and down in a side row, left and right in a horizontal one (aria-orientation says which). The width of the side column is --gk-tab-seitenbreite (14rem at most).

Left — .gk-tab-nav-links. The row and the panels sit in a .gk-tabs, the row as its direct child.

General settings.

Colours and fonts.

Who sees what.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-links" aria-label="Settings, left">
    <button class="gk-tab-btn gk-active" data-tab="a-links-a"><span class="material-icons gk-tab-icon" aria-hidden="true">tune</span><span>General</span></button>
    <button class="gk-tab-btn" data-tab="a-links-b"><span class="material-icons gk-tab-icon" aria-hidden="true">palette</span><span>Look</span></button>
    <button class="gk-tab-btn" data-tab="a-links-c"><span class="material-icons gk-tab-icon" aria-hidden="true">lock</span><span>Privacy</span></button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="a-links-a"><p>General settings.</p></div>
  <div class="gk-tab-panel" data-tab="a-links-b"><p>Colours and fonts.</p></div>
  <div class="gk-tab-panel" data-tab="a-links-c"><p>Who sees what.</p></div>
</div>
HTML;

Right — .gk-tab-nav-rechts, here with the card style: the stroke moves to the outer edge.

General settings.

Colours and fonts.

Who sees what.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-karte gk-tab-nav-rechts" aria-label="Settings, right">
    <button class="gk-tab-btn gk-active" data-tab="a-rechts-a">General</button>
    <button class="gk-tab-btn" data-tab="a-rechts-b">Look</button>
    <button class="gk-tab-btn" data-tab="a-rechts-c">Privacy</button>
  </div>
  <div class="gk-tab-panel gk-tab-flaeche gk-active" data-tab="a-rechts-a"><p>General settings.</p></div>
  <div class="gk-tab-panel gk-tab-flaeche" data-tab="a-rechts-b"><p>Colours and fonts.</p></div>
  <div class="gk-tab-panel gk-tab-flaeche" data-tab="a-rechts-c"><p>Who sees what.</p></div>
</div>
HTML;

Bottom — .gk-tab-nav-unten: the row comes after the panels in the markup, so the order of reading matches what you see.

The overview.

Three details.

The history.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-panel gk-active" data-tab="a-unten-a"><p>The overview.</p></div>
  <div class="gk-tab-panel" data-tab="a-unten-b"><p>Three details.</p></div>
  <div class="gk-tab-panel" data-tab="a-unten-c"><p>The history.</p></div>
  <div class="gk-tab-nav gk-tab-nav-kapsel gk-tab-nav-unten" aria-label="Sections, bottom">
    <button class="gk-tab-btn gk-active" data-tab="a-unten-a">Overview</button>
    <button class="gk-tab-btn" data-tab="a-unten-b">Details</button>
    <button class="gk-tab-btn" data-tab="a-unten-c">History</button>
  </div>
</div>
HTML;

Fixed bar — .gk-tab-nav-unten .gk-tab-nav-fest: sticks to the lower edge of its box, the symbol above the word, the tabs share the width, and the bar keeps clear of a phone's home bar (env(safe-area-inset-bottom)). For up to five tabs. Scroll inside the frame; the frame is only the demo's phone.

The bar below stays where it is while this text scrolls.

Home: the things you did last. A fixed bar suits the few places an app is made of, not a long list of sections.

Each place is a symbol above its word. The chosen one is marked by the stroke and by the colour, never by colour alone.

On a phone with a home bar, the bar's own padding lifts the tabs above it.

Search.

Inbox.

Code anzeigen
echo <<<'HTML'
<div class="demo-tabs-telefon">
  <div class="gk-tabs">
    <div class="gk-tab-panel gk-active" data-tab="a-fest-a">
      <p>The bar below stays where it is while this text scrolls.</p>
      <p>Home: the things you did last. A fixed bar suits the few places an app is made of, not a long list of sections.</p>
      <p>Each place is a symbol above its word. The chosen one is marked by the stroke and by the colour, never by colour alone.</p>
      <p>On a phone with a home bar, the bar's own padding lifts the tabs above it.</p>
    </div>
    <div class="gk-tab-panel" data-tab="a-fest-b"><p>Search.</p></div>
    <div class="gk-tab-panel" data-tab="a-fest-c"><p>Inbox.</p></div>
    <div class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-unten gk-tab-nav-fest" aria-label="Main places">
      <button class="gk-tab-btn gk-active" data-tab="a-fest-a"><span class="material-icons gk-tab-icon" aria-hidden="true">home</span><span>Home</span></button>
      <button class="gk-tab-btn" data-tab="a-fest-b"><span class="material-icons gk-tab-icon" aria-hidden="true">search</span><span>Search</span></button>
      <button class="gk-tab-btn" data-tab="a-fest-c"><span class="material-icons gk-tab-icon" aria-hidden="true">inbox</span><span>Inbox</span><span class="gk-tab-count">2</span></button>
    </div>
  </div>
</div>
HTML;

Options

Options join any style and any alignment. All of them read the same tokens, so a row stays in tune in light and dark, and on a phone every tab is at least a finger high (44px).

Size — .gk-tab-nav-sm and .gk-tab-nav-lg (the card style takes them from 601px up; on a phone every tab is a finger high).

Code anzeigen
echo <<<'HTML'
<nav class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-sm" aria-label="Small">
  <a class="gk-tab-btn" href="#tabs-optionen" aria-current="page">Small</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Compact</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Dense</a>
</nav>
<nav class="gk-tab-nav gk-tab-nav-linie" aria-label="Normal">
  <a class="gk-tab-btn" href="#tabs-optionen" aria-current="page">Normal</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Regular</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Plain</a>
</nav>
<nav class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-lg" aria-label="Large">
  <a class="gk-tab-btn" href="#tabs-optionen" aria-current="page">Large</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Roomy</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Big</a>
</nav>
HTML;

Full width — .gk-tab-nav-fluid: the tabs share the row equally.

Code anzeigen
echo <<<'HTML'
<nav class="gk-tab-nav gk-tab-nav-kapsel gk-tab-nav-fluid" aria-label="Period">
  <a class="gk-tab-btn" href="#tabs-optionen">Today</a>
  <a class="gk-tab-btn" href="#tabs-optionen" aria-current="page">7 days</a>
  <a class="gk-tab-btn" href="#tabs-optionen">30 days</a>
</nav>
HTML;

Symbol above the word — .gk-tab-nav-icon-oben. Symbol only — .gk-tab-nav-nur-icon: the word is hidden to the eye and stays for a screen reader; give every tab an aria-label and a title too, so the symbol is also named for the mouse.

The overview.

The details.

The history.

The overview.

The details.

The history.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-icon-oben" aria-label="Symbol above">
    <button class="gk-tab-btn gk-active" data-tab="o-icon-a"><span class="material-icons gk-tab-icon" aria-hidden="true">dashboard</span><span>Overview</span></button>
    <button class="gk-tab-btn" data-tab="o-icon-b"><span class="material-icons gk-tab-icon" aria-hidden="true">list_alt</span><span>Details</span></button>
    <button class="gk-tab-btn" data-tab="o-icon-c"><span class="material-icons gk-tab-icon" aria-hidden="true">history</span><span>History</span></button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="o-icon-a"><p>The overview.</p></div>
  <div class="gk-tab-panel" data-tab="o-icon-b"><p>The details.</p></div>
  <div class="gk-tab-panel" data-tab="o-icon-c"><p>The history.</p></div>
</div>
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-kapsel gk-tab-nav-nur-icon" aria-label="Symbol only">
    <button class="gk-tab-btn gk-active" data-tab="o-nur-a" aria-label="Overview" title="Overview"><span class="material-icons gk-tab-icon" aria-hidden="true">dashboard</span><span>Overview</span></button>
    <button class="gk-tab-btn" data-tab="o-nur-b" aria-label="Details" title="Details"><span class="material-icons gk-tab-icon" aria-hidden="true">list_alt</span><span>Details</span></button>
    <button class="gk-tab-btn" data-tab="o-nur-c" aria-label="History" title="History"><span class="material-icons gk-tab-icon" aria-hidden="true">history</span><span>History</span></button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="o-nur-a"><p>The overview.</p></div>
  <div class="gk-tab-panel" data-tab="o-nur-b"><p>The details.</p></div>
  <div class="gk-tab-panel" data-tab="o-nur-c"><p>The history.</p></div>
</div>
HTML;

Count and label — .gk-tab-count is a number of things behind the tab; .gk-tab-badge reports a deviation and .gk-tab-badge-error the red one (the word stays: colour alone says nothing).

Code anzeigen
echo <<<'HTML'
<nav class="gk-tab-nav gk-tab-nav-linie" aria-label="With count and label">
  <a class="gk-tab-btn" href="#tabs-optionen" aria-current="page">Inbox<span class="gk-tab-count">12</span></a>
  <a class="gk-tab-btn" href="#tabs-optionen">Drafts<span class="gk-tab-badge">Customised</span></a>
  <a class="gk-tab-btn" href="#tabs-optionen">Legal<span class="gk-tab-badge gk-tab-badge-error">Error</span></a>
</nav>
HTML;

Neutral — .gk-tab-nav-neutral: the chosen tab in the text colour instead of the main colour, for a page that already has a strong accent.

Code anzeigen
echo <<<'HTML'
<nav class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-neutral" aria-label="Neutral line">
  <a class="gk-tab-btn" href="#tabs-optionen" aria-current="page">Overview</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Results</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Settings</a>
</nav>
<nav class="gk-tab-nav gk-tab-nav-kapsel gk-tab-nav-neutral" aria-label="Neutral pill">
  <a class="gk-tab-btn" href="#tabs-optionen" aria-current="page">Overview</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Results</a>
  <a class="gk-tab-btn" href="#tabs-optionen">Settings</a>
</nav>
HTML;

Disabled — disabled on a button or aria-disabled="true": dimmed, no hand cursor, no hover tint, skipped by the arrow keys, and a click does nothing.

The overview. Press the right arrow: it jumps over the two dimmed tabs.

Reports.

Billing.

The settings.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-linie" aria-label="With a disabled tab">
    <button class="gk-tab-btn gk-active" data-tab="o-aus-a">Overview</button>
    <button class="gk-tab-btn" data-tab="o-aus-b" disabled>Reports</button>
    <button class="gk-tab-btn" data-tab="o-aus-c" aria-disabled="true">Billing</button>
    <button class="gk-tab-btn" data-tab="o-aus-d">Settings</button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="o-aus-a"><p>The overview. Press the right arrow: it jumps over the two dimmed tabs.</p></div>
  <div class="gk-tab-panel" data-tab="o-aus-b"><p>Reports.</p></div>
  <div class="gk-tab-panel" data-tab="o-aus-c"><p>Billing.</p></div>
  <div class="gk-tab-panel" data-tab="o-aus-d"><p>The settings.</p></div>
</div>
HTML;

Combinations

Rows inside rows. Each .gk-tabs answers only for its own tabs: an outer click leaves the inner choice alone, and the arrow keys stay inside one row. In every example the outer and the inner tabs use the same data-tab keys on purpose — they are never mixed up.

1 · Card outside, line inside — the page of an editor. The links above are a separate row of pages.

The sign-up text.

The thank-you text.

The mails.

Code anzeigen
echo <<<'HTML'
<nav class="gk-tab-nav gk-tab-nav-text" aria-label="Pages">
  <a class="gk-tab-btn" href="#tabs-kombinationen" aria-current="page">Editor</a>
  <a class="gk-tab-btn" href="#tabs-kombinationen">Statistics</a>
</nav>
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-karte" aria-label="Areas">
    <button class="gk-tab-btn gk-active" data-tab="a">Texts</button>
    <button class="gk-tab-btn" data-tab="b">Mails</button>
  </div>
  <div class="gk-tab-panel gk-tab-flaeche gk-active" data-tab="a">
    <div class="gk-tabs">
      <div class="gk-tab-nav gk-tab-nav-linie" aria-label="Texts">
        <button class="gk-tab-btn gk-active" data-tab="a">Sign-up</button>
        <button class="gk-tab-btn" data-tab="b">Thanks</button>
      </div>
      <div class="gk-tab-panel gk-active" data-tab="a"><p>The sign-up text.</p></div>
      <div class="gk-tab-panel" data-tab="b"><p>The thank-you text.</p></div>
    </div>
  </div>
  <div class="gk-tab-panel gk-tab-flaeche" data-tab="b"><p>The mails.</p></div>
</div>
HTML;

2 · Side row on the left, line row in its panel — a vertical row outside, a horizontal one inside.

Your profile.

Your password.

Where you are signed in.

The team.

Billing.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-links" aria-label="Areas">
    <button class="gk-tab-btn gk-active" data-tab="a">Account</button>
    <button class="gk-tab-btn" data-tab="b">Team</button>
    <button class="gk-tab-btn" data-tab="c">Billing</button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="a">
    <div class="gk-tabs">
      <div class="gk-tab-nav gk-tab-nav-linie" aria-label="Account">
        <button class="gk-tab-btn gk-active" data-tab="a">Profile</button>
        <button class="gk-tab-btn" data-tab="b">Password</button>
        <button class="gk-tab-btn" data-tab="c">Sessions</button>
      </div>
      <div class="gk-tab-panel gk-active" data-tab="a"><p>Your profile.</p></div>
      <div class="gk-tab-panel" data-tab="b"><p>Your password.</p></div>
      <div class="gk-tab-panel" data-tab="c"><p>Where you are signed in.</p></div>
    </div>
  </div>
  <div class="gk-tab-panel" data-tab="b"><p>The team.</p></div>
  <div class="gk-tab-panel" data-tab="c"><p>Billing.</p></div>
</div>
HTML;

3 · Bottom bar around, card row in the page — an app's places below, a Karteireiter in one of them (in the demo's phone frame, so the bar has an edge to stick to).

Today.

This week.

Search.

Code anzeigen
echo <<<'HTML'
<div class="demo-tabs-telefon">
  <div class="gk-tabs">
    <div class="gk-tab-panel gk-active" data-tab="a">
      <div class="gk-tabs">
        <div class="gk-tab-nav gk-tab-nav-karte" aria-label="Inside the home place">
          <button class="gk-tab-btn gk-active" data-tab="a">Today</button>
          <button class="gk-tab-btn" data-tab="b">Week</button>
        </div>
        <div class="gk-tab-panel gk-tab-flaeche gk-active" data-tab="a"><p>Today.</p></div>
        <div class="gk-tab-panel gk-tab-flaeche" data-tab="b"><p>This week.</p></div>
      </div>
    </div>
    <div class="gk-tab-panel" data-tab="b"><p>Search.</p></div>
    <div class="gk-tab-nav gk-tab-nav-linie gk-tab-nav-unten gk-tab-nav-fest" aria-label="Places">
      <button class="gk-tab-btn gk-active" data-tab="a"><span class="material-icons gk-tab-icon" aria-hidden="true">home</span><span>Home</span></button>
      <button class="gk-tab-btn" data-tab="b"><span class="material-icons gk-tab-icon" aria-hidden="true">search</span><span>Search</span></button>
    </div>
  </div>
</div>
HTML;

4 · Pill row over a card row — a switch of areas above, the sections of one area below.

Open offers.

Orders.

Invoices.

Support.

Code anzeigen
echo <<<'HTML'
<div class="gk-tabs">
  <div class="gk-tab-nav gk-tab-nav-kapsel" aria-label="Areas">
    <button class="gk-tab-btn gk-active" data-tab="a">Sales</button>
    <button class="gk-tab-btn" data-tab="b">Support</button>
  </div>
  <div class="gk-tab-panel gk-active" data-tab="a">
    <div class="gk-tabs">
      <div class="gk-tab-nav gk-tab-nav-karte" aria-label="Sales">
        <button class="gk-tab-btn gk-active" data-tab="a">Offers</button>
        <button class="gk-tab-btn" data-tab="b">Orders</button>
        <button class="gk-tab-btn" data-tab="c">Invoices</button>
      </div>
      <div class="gk-tab-panel gk-tab-flaeche gk-active" data-tab="a"><p>Open offers.</p></div>
      <div class="gk-tab-panel gk-tab-flaeche" data-tab="b"><p>Orders.</p></div>
      <div class="gk-tab-panel gk-tab-flaeche" data-tab="c"><p>Invoices.</p></div>
    </div>
  </div>
  <div class="gk-tab-panel" data-tab="b"><p>Support.</p></div>
</div>
HTML;

Navigation & Filter

Accordion seit 1.0

Collapsible content areas — individually or as a group.

GridKit is a lightweight PHP/CSS/JS framework for admin dashboards and internal tools. Zero dependencies, M3-inspired.
Table, Form, Modal, Cards, StatCards, Sidebar, Header, Tabs, Accordion, Breadcrumb, Toast, Confirm and more. All with Light & Dark Mode.
No. GridKit has no dependencies — one CSS file, one JS file, done. Just include and get started.
<div class="gk-accordion" data-gk-single>
    <div class="gk-accordion-item open">
        <button class="gk-accordion-trigger">
            <span>Question?</span>
            <span class="material-icons">expand_more</span>
        </button>
        <div class="gk-accordion-content">
            <div class="gk-accordion-body">Answer...</div>
        </div>
    </div>
</div>

// data-gk-single: only one item open at a time
// .open: item open by default

Avatar seit 0.9

Profile pictures with initials fallback, status dot and groups.

Sizes
XS
SM
MD
LG
XL
Status
MM
Group (stacked)
+3
.gk-avatar.gk-avatar-lg           // Sizes: xs, sm, md, lg, xl
.gk-avatar-status.online          // Status: online, away, busy, offline
.gk-avatar-group                  // Stacked group
.gk-avatar-square                 // Square instead of round

Breadcrumb seit 0.9

Path navigation for orientation in nested areas.

Page content here...

<nav class="gk-breadcrumb">
    <a href="#"><span class="material-icons">home</span></a>
    <span class="gk-breadcrumb-sep"><span class="material-icons">chevron_right</span></span>
    <a href="#">Products</a>
    <span class="gk-breadcrumb-sep">...</span>
    <span class="gk-breadcrumb-current">Current Page</span>
</nav>

Tabs — previous shape seit 1.0

The line shape every tab row keeps unless it orders the Karteireiter. The current shape, levels, nesting and the phone grid are under Tabs.

This is the overview — the first tab is active by default.

Detail information is displayed here.

Settings and configuration options.

<div class="gk-tabs">
    <div class="gk-tab-nav">
        <button class="gk-tab-btn gk-active" data-tab="tab-1">Tab 1</button>
        <button class="gk-tab-btn" data-tab="tab-2">Tab 2</button>
    </div>
    <div class="gk-tab-panel gk-active" data-tab="tab-1">Content 1</div>
    <div class="gk-tab-panel" data-tab="tab-2">Content 2</div>
</div>

When each tab is a page of its own: links in a <nav>, the current page marked with aria-current="page" (it looks like .gk-active). .gk-tab-nav-fill is the main row (44px; on a phone the symbol stands over the word), .gk-tab-nav-secondary a quieter row under it. Above them a status band: a message with steps, a short to-do list (a compact timeline) and a disclosure.

Proposed for approval
  1. Draft (done)
  2. Approval
  3. Live
  1. Choose where the sign-ups go.Open
  2. The legal notice has to be confirmed first.Open
  3. PublishAfterwards
Show 3 completed checks
  • Title and text are there.
  • The date lies ahead.
  • The picture is uploaded.
<nav class="gk-tab-nav gk-tab-nav-fill" aria-label="Areas">
    <a class="gk-tab-btn" href="/edit"><span class="material-icons gk-tab-icon" aria-hidden="true">edit</span><span>Edit</span></a>
    <a class="gk-tab-btn" href="/results" aria-current="page">…</a>
</nav>
<nav class="gk-tab-nav gk-tab-nav-secondary" aria-label="Views">…</nav>
<ol class="gk-steps"><li class="gk-steps-item gk-steps-done">Draft</li>
  <li class="gk-steps-item gk-steps-current" aria-current="step">Approval</li><li class="gk-steps-item">Live</li></ol>
<details class="gk-disclosure"><summary>Show 3 completed checks</summary>…</details>

Combinations

Combination examples showing the full potential of GridKit.

Tabs + Accordion (combined)

Tabs for main categories, accordion for details — a common pattern in admin UIs.

3 packages available: S (1,200 €), M (2,400 €), L (3,500 €). All incl. responsive design and CMS.
Managed hosting from 9.90 €/month. SSD, backups, SSL included. 99.9% uptime guarantee.
24 active customers, 3 open inquiries
Mustermann GmbH
Since 2024 · 12 projects
Tech Solutions AG
Since 2023 · 8 projects
Weber & Partner
Since 2025 · 3 projects
Notifications


Segment + Message + Table

Dashboard view with status message and data table in a segment.

Server-Status
All 3 servers are online — last check 2 minutes ago.
ServerStatusCPURAMUptime
Baerli (server8)Online12%4.2 GB47 days
Theo (server7)Online8%3.8 GB23 days
Waldi (server6)Online15%5.1 GB31 days

One pager for tables and lists seit 0.9

Since 1.118.0 the pager of Table::paginate() is the bar of Pagination: the count on the left, the page buttons on the right, first and last included — the same boxes, sizes and colours in light and dark and in every theme. Below, a table of twelve rows that pages itself, and the bar for a list you page yourself, with the same numbers. The table counts the rows it shows (“1–5 of 12”); Pagination, which is handed pages and not rows, counts its entries.

Invoices
Customer
RE-2026-001Customer 1125,50 €
RE-2026-002Customer 2251,00 €
RE-2026-003Customer 3376,50 €
RE-2026-004Customer 4502,00 €
RE-2026-005Customer 5627,50 €
Code anzeigen
$rows = [];
for ($i = 1; $i <= 12; $i++) {
    $rows[] = ['id' => $i, 'no' => sprintf('RE-2026-%03d', $i), 'customer' => "Customer $i", 'total' => $i * 125.5];
}
(new Table('demo-one-pager'))->setData($rows)
    ->column('no', 'Inv. No.', ['sortable' => true, 'nowrap' => true])
    ->column('customer', 'Customer')
    ->column('total', 'Amount', ['format' => 'currency', 'align' => 'right', 'sortable' => true])
    ->toolbar(false)
    ->caption('Invoices')
    ->paginate(5)
    ->render();
Code anzeigen
echo Pagination::build(['page' => 1, 'totalPages' => 3, 'total' => 12, 'baseUrl' => '#pager-match']);

FilterChips seit 0.9

$chips = new FilterChips('status-filter', 'status');
$chips->chip('', 'All', ['count' => 152])
    ->chip('active', 'Active', ['count' => 89, 'color' => 'green'])
    ->render();

Segmented button seit 1.99

One choice of a few that switches the view of a page — a period, overview or visitors. Joined; the chosen one is tinted and ticked. FilterChips::segmented($label) draws the same links in it.

(new FilterChips('period', 'days'))->current('7')->segmented('Period')
    ->chip('1', 'Today')->chip('7', '7 days')->chip('30', '30 days')->render();

YearFilter seit 0.9

$years = new YearFilter('year-nav', 'year');
$years->range(2022, 2026)->render();

TableHeader seit 1.10

One unified filter/search bar for all tables. Three fixed sections: Status row · Toolbar · Advanced (collapsible). Stops every page from looking different.

Filter zurücksetzenNew invoice
Date & amount range
––
TableHeader::make('exp')
    ->status(fn() => $statusChips->render())
    ->search('q', $q, 'Search…', ['live' => 'exp-live'])
    ->filter(fn() => $yearFilter->render())
    ->filter('<select class="gk-filter">…</select>')
    ->advanced(fn() => renderDateRange())
    ->reset('/faktura/expenses')
    ->action(Button::render('New expense', ['href' => '/faktura/expenses/new', 'icon' => 'add']))  // 1.134.0
    ->render();

Formatter seit 0.9

Built-in formatting for table columns: currency, percent, date, boolean, label, email.

CurrencyPercentDateBooleanLabelEmail
1.234,56 €20 %✓paid[email protected]
99,00 €10 %–pending[email protected]
5.500,00 €0 %✓cancelled
->column('amount', 'Amount', ['format' => 'currency'])    // €1,234.56  (follows the locale)
->column('tax', 'VAT', ['format' => 'percent'])           // 20 %
->column('date', 'Date', ['format' => 'date'])            // Feb 13, 2026  (follows the locale)
->column('active', 'Active', ['format' => 'boolean'])     // ✓ / –
->column('status', 'Status', ['format' => 'label'])       // Colored label
->column('email', 'E-Mail', ['format' => 'email'])        // mailto: Link

FilterChips: colour names and icons seit 0.9

A chip takes green, orange, blue and red or the role names success, danger, primary, neutral; 'icon' puts a symbol in front. A colour shows on the chip that is active, here the first.

Code anzeigen
(new FilterChips('demo-chip-roles', 'role_status'))
    ->current('ok')
    ->chip('ok', 'Done', ['color' => 'success', 'icon' => 'check_circle'])
    ->chip('stop', 'Failed', ['color' => 'danger', 'icon' => 'error'])
    ->chip('me', 'Mine', ['color' => 'primary', 'icon' => 'person'])
    ->chip('rest', 'Others', ['color' => 'neutral', 'icon' => 'group'])
    ->render();

Pagination, page size and a loading state seit 0.9

Pagination::build() is the pager for a list you page yourself, PageSize the rows-per-page choice that belongs next to it. Both keep the other query parameters ('params', preserve()). While something loads, gk-skeleton stands in for the text.

Code anzeigen
echo Pagination::build(['page' => 5, 'totalPages' => 12, 'baseUrl' => '#pager', 'total' => 238, 'label' => 'invoices']);
(new PageSize())->options([10, 25, 50, 100])->current(25)->baseUrl('#pager')->render();
Code anzeigen
echo '<div class="gk-flex gk-flex-col gk-gap-sm" aria-busy="true">';
echo '<div class="gk-skeleton" style="height:14px;width:60%"></div>';
echo '<div class="gk-skeleton" style="height:14px;width:90%"></div>';
echo '<div class="gk-skeleton" style="height:14px;width:40%"></div>';
echo '</div>';

Page progress — an answer to every click that leaves the page seit 0.9

Nothing to call: with gridkit.js on the page, a click on a link of the same site or a submitted form shows a thin bar at the top at once, dims the clicked element (gk-page-pending, aria-busy) and says “Loading page …” to a screen reader. A click a script takes (preventDefault), a new tab, a download, a jump within the page or data-gk-ohne-lade shows nothing. GK.pageProgress.start(el) and .done() are there for code that navigates itself.

Code anzeigen
echo '<div class="gk-flex gk-gap-sm">';
echo '<a class="gk-btn" href="?progress=1#page-progress">Load this page again</a>';
echo '<a class="gk-btn" href="?progress=2#page-progress" data-gk-ohne-lade>Without the bar</a>';
echo '<button type="button" class="gk-btn" data-demo-progress="start">Start the bar</button>';
echo '</div>';

Gallery seit 1.0

Two ways to show pictures. A gallery looks: tiles that open a viewer. An image picker chooses: the same tiles, but each one is a radio button, and the viewer can pick. Both use the same viewer, so it pages with the arrow keys, closes on Escape and gives the focus back.

Image picker seit 1.94 — six images

Tap a tile to pick it, or Tab into the group and use the arrow keys. The magnifier opens the viewer; Select this image in it picks the picture you are looking at. The status line, the form value and the event log below follow every change. One tile has a small origin chip ("AI"), one a remove button, one has no preview, one is disabled and says why. The last one's remove button is locked (since 1.133.0): it says why under the title, and a click explains instead of removing.

Header image

Gewählt: Fireplace at dusk

Own image
AI generated
Own image
stock-image.webp

Not released yet

Own image

Cannot be removed: used on the page "Home"

Own image
Code anzeigen
\GridKit\ImagePicker::render($pickerItems(6, 1, true), ['name' => 'cover', 'id' => 'demo-pk-six']);

Form value: img-1

Events appear here.

Thirty images — two rows, then "Show all 30"

The picked tile (21 here) stays visible even though it lies beyond the fold. Resize the window: the number of tiles in the two rows follows the width. On a phone two tiles fit in a row, and thirty images are about four tiles and a button instead of a screen-long list.

Pick one of thirty

Gewählt: Cabin door (2)

Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image
Own image

One image, and none

One image

Nichts gewählt

Own image
Nothing yet (the shell waits for GK.picker.add)

Nichts gewählt

Keyboard

Keys in the picker and in its viewer
WhereKeyWhat happens
PickerTabEnters the group once, on the picked tile; the next Tab reaches that tile's magnifier (and remove button), then the fold button — thirty tiles are not sixty tab stops.
Picker← → ↑ ↓Moves to the next tile and picks it (native radios); disabled tiles are skipped.
PickerEnter on the magnifierOpens the viewer on that picture.
Viewer← →Previous or next picture (all of them, folded ones included).
ViewerTabStays inside: close, previous, next, "Select this image", "Close".
ViewerEscCloses it; the focus goes back to the magnifier of the picture last shown — or to the radio, when one was picked from the viewer.

Events and script

Picking is the radio's own change event, so a form needs nothing new. A caption button fires gk:pickeraction and does nothing else — here the page asks "Really?" first (GK.confirm) and only then calls GK.picker.remove(). The library never deletes anything itself.

picker.addEventListener('gk:pickeraction', (e) => {
    // e.detail = { action: 'remove', value: 'img-3', item: <the tile>, picker: <the container> }
    GK.confirm('Remove this image?', { danger: true }).then((ok) => {
        if (ok) GK.picker.remove(e.detail.picker, e.detail.value);
    });
});

GK.picker.add(picker, { value: 'img-9', title: 'Fresh upload', thumb: '/t/9.webp', full: '/g/9.webp' },
              { select: true, focus: true });   // picks it as a click would — one change event

// The viewer is open to your own lists too:
GK.lightbox.show([{ src: '/g/1.webp', caption: 'Fireplace', meta: 'Own image' }], 0, openerButton);

Image grid with lazy loading, hover overlay and lightbox (arrow keys, Escape).

<div class="gk-gallery">
    <div class="gk-gallery-item" data-lightbox="full.jpg" data-caption="Caption" data-lazy>
        <img data-src="thumb.jpg" alt="">
        <div class="gk-gallery-overlay">
            <span class="gk-gallery-caption">Caption</span>
        </div>
    </div>
</div>

// Variants:
.gk-gallery-sm              // Smaller thumbnails (100px min)
.gk-gallery-lg              // Larger thumbnails (220px min)
.gk-gallery-masonry         // Pinterest layout (columns)
// Lightbox: arrow keys, Escape, click outside to close
// data-lazy: load images only when visible

Portrait video frame seit 1.96

A frame for a 9:16 video or picture — a short, a story, a phone screenshot. It keeps its shape, is never wider than its column and never taller than 75 % of the window, and shows the whole picture. gk-video-frame-safe draws the zones a platform covers with its own buttons (about the top tenth and the bottom fifth) as guide lines — they never catch a click, so the controls still work. Nothing to show yet, or it broke: gk-video-frame-busy and gk-video-frame-error reuse the empty state. No autoplay.

Version 2 · 3 s
Safe zones shown: top 10 %, bottom 20 %
The first frame of the video: a blue field with a pale disc
A picture shows in the same frame
Video is being made
This takes a minute or two. You can leave the page.
Version 3
No video
The image service did not answer. Try again, or change the topic.
Version 3 failed
Code anzeigen
echo <<<'HTML'
<div class="demo-frames">
  <figure class="gk-video-frame">
    <div class="gk-video-frame-media">
      <video controls playsinline preload="metadata" aria-label="Sample video, 3 seconds" src="media/sample-portrait.webm"></video>
    </div>
    <figcaption class="gk-video-frame-caption">Version 2 · 3 s</figcaption>
  </figure>
  <figure class="gk-video-frame gk-video-frame-safe">
    <div class="gk-video-frame-media">
      <video controls playsinline preload="metadata" aria-label="Sample video with the safe zones shown" src="media/sample-portrait.webm"></video>
    </div>
    <figcaption class="gk-video-frame-caption">Safe zones shown: top 10 %, bottom 20 %</figcaption>
  </figure>
  <figure class="gk-video-frame">
    <div class="gk-video-frame-media">
      <img src="media/sample-portrait.svg" alt="The first frame of the video: a blue field with a pale disc">
    </div>
    <figcaption class="gk-video-frame-caption">A picture shows in the same frame</figcaption>
  </figure>
  <figure class="gk-video-frame gk-video-frame-busy">
    <div class="gk-video-frame-media">
      <div class="gk-empty" role="status">
        <div class="gk-empty-inner">
          <span class="material-icons gk-empty-icon" aria-hidden="true">movie</span>
          <div class="gk-empty-title">Video is being made</div>
          <div class="gk-empty-hint">This takes a minute or two. You can leave the page.</div>
        </div>
      </div>
    </div>
    <figcaption class="gk-video-frame-caption">Version 3</figcaption>
  </figure>
  <figure class="gk-video-frame gk-video-frame-error">
    <div class="gk-video-frame-media">
      <div class="gk-empty">
        <div class="gk-empty-inner">
          <span class="material-icons gk-empty-icon" aria-hidden="true">error</span>
          <div class="gk-empty-title">No video</div>
          <div class="gk-empty-hint">The image service did not answer. Try again, or change the topic.</div>
        </div>
      </div>
    </div>
    <figcaption class="gk-video-frame-caption">Version 3 failed</figcaption>
  </figure>
</div>
HTML;

Landscape (1.131.0): gk-video-frame-landscape on the <figure> makes the same frame 16:9 — a recording, a film. It is as wide as its column until the 75 % limit of the window bites, then it keeps its shape; a portrait file in it is shown whole, not cut. Busy and failed work as in the 9:16 frame. One class on the figure, so a rule of your page with one class still wins.

The first frame of the recording: a blue field with a pale disc
A recording, 16:9
Video is being made
This takes a minute or two.
Version 3
Code anzeigen
echo <<<'HTML'
<div class="demo-frames">
  <figure class="gk-video-frame gk-video-frame-landscape">
    <div class="gk-video-frame-media">
      <img src="media/sample-landscape.svg" alt="The first frame of the recording: a blue field with a pale disc">
    </div>
    <figcaption class="gk-video-frame-caption">A recording, 16:9</figcaption>
  </figure>
  <figure class="gk-video-frame gk-video-frame-landscape gk-video-frame-busy">
    <div class="gk-video-frame-media">
      <div class="gk-empty" role="status">
        <div class="gk-empty-inner">
          <span class="material-icons gk-empty-icon" aria-hidden="true">movie</span>
          <div class="gk-empty-title">Video is being made</div>
          <div class="gk-empty-hint">This takes a minute or two.</div>
        </div>
      </div>
    </div>
    <figcaption class="gk-video-frame-caption">Version 3</figcaption>
  </figure>
</div>
HTML;

Search seit 1.24

System-wide quick search. GridKit provides the widget only — WHAT is searched is decided by your backend endpoint. Opens with Ctrl+K (Cmd+K on Mac) or any element carrying data-gk-search. Arrow keys select, Enter opens, Escape closes. On this page Ctrl+K belongs to the command palette (1.122.0), which reads the same JSON and searches the pages and commands as well; the button below still opens this search.

GK.search.init({
  url: '/demo/api/quicksearch.php',
  hotkey: 'ctrl+k',
  minLength: 0
});

// Server response. The German key names — gruppen / titel / treffer /
// untertitel / betrag — are still read as a fallback, but this is the shape:
{ "groups": [
    { "title": "Transactions",
      "items": [
        { "title": "Hetzner",
          "subtitle": "Jul 7, 2026",
          "amount": "€64.80",
          "url": "/transactions/2",
          "icon": "account_balance" } ] } ] }

Feedback & Dialogs

Toast seit 0.9

Toast notifications for success, error and info messages. Disappear after 3 seconds.

GK.toast.success('Successfully saved!');
GK.toast.error('Error while saving!');
GK.toast.warning('Warning: Limit reached!');
GK.toast.info('3 new entries');

Announcement after a save seit 1.93

A toast is for the corner; this line says "Saved." where the person is working, and a screen reader reads it. The region is on the page from the start and never hidden — empty, it draws no box. GK.announce() changes only its words, and the same words twice are read twice.

Code anzeigen
echo <<<'HTML'
<div class="demo-announce-row">
  <button type="button" class="gk-btn gk-btn-filled gk-btn-primary" data-demo-announce="Saved." data-tone="success">Save</button>
  <button type="button" class="gk-btn gk-btn-outlined gk-btn-danger" data-demo-announce="Could not save — the connection dropped." data-tone="error">Fail</button>
  <button type="button" class="gk-btn gk-btn-text gk-btn-neutral" data-demo-announce="">Clear</button>
</div>
<div class="gk-message gk-message-compact gk-announce" id="demo-announce" role="status" aria-live="polite" aria-atomic="true"></div>
<script>
document.addEventListener('click', function (e) {
  var b = e.target.closest('[data-demo-announce]');
  if (b) GK.announce('demo-announce', b.getAttribute('data-demo-announce'), b.getAttribute('data-tone'));
});
</script>
HTML;

Timeline seit 1.96

A log of steps, one under the other: what ran, in which order, how each step ended. A real ordered list, so the order is the information; each state has its own symbol and a word beside the title, never a colour alone. Small chips carry cost or provider, a failed step shows its message as a block. The ring of the running step turns, and stands still when the person asked for less motion. Light and dark follow from the roles; long addresses break.

A run in progress

  1. Write the script Done · 4.2 s
    Claude$0.03

    Three scenes, 38 words, ends with a question.

  2. Record the voice Done · 11 s
    Text to speech$0.11
  3. Make the pictures Running · 8 s so far

    Picture 2 of 3.

  4. Assemble the video Waiting
  5. Check the safe zones Waiting

A run that broke

  1. Write the script Done · 3.9 s
    Claude$0.03
  2. Make the pictures Failed · 31 s
    Image service

    The image service did not answer after 3 tries (https://example.org/api/v1/images/generate?scene=2&attempt=3, timeout after 30 s).

  3. Assemble the video Skipped

    Needs the pictures.

  4. Check the safe zones Skipped
Code anzeigen
echo <<<'HTML'
<div class="demo-timelines">
  <div>
    <h4>A run in progress</h4>
    <ol class="gk-timeline" role="list" aria-label="Steps of the run in progress">
      <li class="gk-timeline-step gk-timeline-ok">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Write the script</span>
            <span class="gk-timeline-state">Done</span>
            <span class="gk-timeline-time"><time datetime="2026-10-17T09:12:03">09:12:03</time> · 4.2 s</span>
          </div>
          <div class="gk-timeline-chips"><span class="gk-label gk-label-gray">Claude</span><span class="gk-label gk-label-gray">$0.03</span></div>
          <p class="gk-timeline-detail">Three scenes, 38 words, ends with a question.</p>
        </div>
      </li>
      <li class="gk-timeline-step gk-timeline-ok">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Record the voice</span>
            <span class="gk-timeline-state">Done</span>
            <span class="gk-timeline-time"><time datetime="2026-10-17T09:12:08">09:12:08</time> · 11 s</span>
          </div>
          <div class="gk-timeline-chips"><span class="gk-label gk-label-gray">Text to speech</span><span class="gk-label gk-label-gray">$0.11</span></div>
        </div>
      </li>
      <li class="gk-timeline-step gk-timeline-running" aria-current="step">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Make the pictures</span>
            <span class="gk-timeline-state">Running</span>
            <span class="gk-timeline-time"><time datetime="2026-10-17T09:12:19">09:12:19</time> · 8 s so far</span>
          </div>
          <p class="gk-timeline-detail">Picture 2 of 3.</p>
        </div>
      </li>
      <li class="gk-timeline-step gk-timeline-waiting">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Assemble the video</span>
            <span class="gk-timeline-state">Waiting</span>
          </div>
        </div>
      </li>
      <li class="gk-timeline-step gk-timeline-waiting">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Check the safe zones</span>
            <span class="gk-timeline-state">Waiting</span>
          </div>
        </div>
      </li>
    </ol>
  </div>
  <div>
    <h4>A run that broke</h4>
    <ol class="gk-timeline" role="list" aria-label="Steps of the run that broke">
      <li class="gk-timeline-step gk-timeline-ok">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Write the script</span>
            <span class="gk-timeline-state">Done</span>
            <span class="gk-timeline-time"><time datetime="2026-10-17T10:40:11">10:40:11</time> · 3.9 s</span>
          </div>
          <div class="gk-timeline-chips"><span class="gk-label gk-label-gray">Claude</span><span class="gk-label gk-label-gray">$0.03</span></div>
        </div>
      </li>
      <li class="gk-timeline-step gk-timeline-failed">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Make the pictures</span>
            <span class="gk-timeline-state">Failed</span>
            <span class="gk-timeline-time"><time datetime="2026-10-17T10:40:15">10:40:15</time> · 31 s</span>
          </div>
          <div class="gk-timeline-chips"><span class="gk-label gk-label-gray">Image service</span></div>
          <p class="gk-timeline-error">The image service did not answer after 3 tries (https://example.org/api/v1/images/generate?scene=2&amp;attempt=3, timeout after 30 s).</p>
        </div>
      </li>
      <li class="gk-timeline-step gk-timeline-skipped">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Assemble the video</span>
            <span class="gk-timeline-state">Skipped</span>
          </div>
          <p class="gk-timeline-detail">Needs the pictures.</p>
        </div>
      </li>
      <li class="gk-timeline-step gk-timeline-skipped">
        <span class="gk-timeline-marker" aria-hidden="true"></span>
        <div class="gk-timeline-body">
          <div class="gk-timeline-head">
            <span class="gk-timeline-title">Check the safe zones</span>
            <span class="gk-timeline-state">Skipped</span>
          </div>
        </div>
      </li>
    </ol>
  </div>
</div>
HTML;

Confirm seit 0.9

Confirm dialogs as clean modals. Promise-based, with danger mode for destructive actions.

GK.confirm('Send invoice?', {
    title: 'Send Invoice', confirmText: 'Send'
}).then(ok => { if (ok) GK.toast.success('Sent!'); });

GK.confirm('Really delete?', {
    title: 'Delete', confirmText: 'Delete', danger: true
}).then(ok => { if (ok) { /* ... */ } });

Modal seit 0.9

Modals in four sizes. Loaded via AJAX, backdrop click and ESC close them.

Nesting: Modal with form

A modal loads a form via AJAX – the most common use case.

Nesting: Modal with table + sub-modal

A large modal shows a customer list. Clicking "Edit" opens a second modal with the form.

GK.modal.open('Title', 'form/edit.php', {id: 42}, 'small');
GK.modal.open('Title', 'form/edit.php', {id: 42}, 'medium');
GK.modal.open('Title', 'form/edit.php', {id: 42}, 'large');
GK.modal.open('Title', 'form/edit.php', {id: 42}, 'full');

$table->button('edit', ['icon' => 'edit', 'modal' => 'edit_form'])
    ->modal('edit_form', 'Edit', 'form/edit.php', ['size' => 'large']);

UI Components

Buttons seit 0.9

Variants

Colors – Filled

Colors – Outlined

Colors – Tonal

Colors – Text

Icon-Only

Sizes

States

Icon Position & Special

As Link

Button Group

 

Shapes

FAB (Floating Action Button) seit 0.9

use GridKit\Button;
echo Button::render('Save', ['variant' => 'filled', 'color' => 'primary', 'icon' => 'save']);
echo Button::icon('edit', ['variant' => 'filled', 'color' => 'primary']);
echo Button::fab('add');
echo Button::fab('edit', ['extended' => true, 'label' => 'Edit']);

Labels seit 0.9

Colored labels for status display — also usable standalone, not only in tables.

Active Draft Error Archived Info
<span class="gk-label gk-label-green">Active</span>
<span class="gk-label gk-label-orange">Draft</span>
<span class="gk-label gk-label-red">Error</span>
<span class="gk-label gk-label-gray">Archived</span>
<span class="gk-label gk-label-blue">Info</span>

Tooltip seit 0.9

Tooltips appear automatically on buttons with a title attribute. Hover over the buttons:

// Tooltip via title attribute (CSS-only, no JS)
Button::icon('edit', ['title' => 'Edit']);
<button class="gk-btn" title="Tooltip-Text">...</button>

Empty State seit 0.9

Placeholder for empty tables or lists.

NameE-MailStatus
No entries found
<div class="gk-empty">No entries found</div>

Header seit 0.9

Invoices

Minimal (title + user with initials only)

Dashboard

$header = new Header();
echo $header->title('Invoices')
    ->breadcrumb(['Dashboard' => '/', 'Invoices'])
    ->search('Search...', 'q')
    ->action(Button::render('New', ['icon' => 'add', 'size' => 'sm']))
    ->user('Martin Huber', ['avatar' => '...', 'menu' => [...]])
    ->sticky()->render();

Ortszeile seit 1.100

"You are here": the dashboard and the module as links, the steps between, the page last and without a link. Only the page's title is shortened. Put it in a sticky() header — it wraps on a phone. Resize the window to see it.

On the dashboard itself

Dashboard

On the start page of a module

Billing

Deep in a module

Invoice INV-2026-001

A very long title

Quarterly statement

One row, for a header of fixed height (einzeilig)

Quarterly statement

The menu button with its word, for a first-time visitor

Billing

echo (new Header())
    ->sidebarToggle(true, ['label' => true, 'controls' => 'main-nav'])   // "Menü" beside the symbol
    ->ortszeile([
        'dashboard' => ['label' => 'Dashboard', 'href' => '/', 'icon' => 'home'],   // the defaults
        'modul'     => ['label' => 'Billing', 'href' => '/faktura', 'icon' => 'receipt_long'],
        'stufen'    => ['Invoices' => '/faktura/rechnungen'],
        'aktuell'   => 'Invoice INV-2026-001',   // the page: no link, aria-current="page"
    ])
    ->sticky()->render();

echo Layout::skipLink('#main');                   // first in <body>; <main id="main" tabindex="-1">
(new Sidebar('main'))->elementId('main-nav')       // the button's aria-controls
    ->brand('Panel', 'dashboard', 'v1', '/')       // the brand as a link
    ->mobileClose()                                // a brand-less sidebar keeps its close button
    ->render();

Sidebar seit 0.9

Responsive sidebar navigation with groups, icons, badges and mobile toggle. Visible live on this page.

$sidebar = new Sidebar('main');
$sidebar->brand('My Project', 'dashboard', 'v0.7.0')
    ->group('Modules')
    ->item('Dashboard', '/dashboard', 'analytics', ['active' => true])
    ->item('Invoices', '/invoices', 'receipt_long', ['badge' => 3])
    ->render();

GK.sidebar.toggle(); GK.sidebar.open(); GK.sidebar.close();

Themes seit 0.9

M3-compliant theme system with 6 themes and Dark/Light Mode.

Layout Mode

Theme Selection

Live Preview

Card Title

Surface-container background with on-surface text colors.

Color Roles

Primary Secondary Tertiary Error
Primary Container Secondary Container Tertiary Container
Surface Container Highest
Theme::set('ocean', 'dark');
echo Theme::bodyTag('gk-root');
echo Theme::switcher();
GK.theme.set('forest'); GK.theme.toggleMode(); GK.theme.restore();
GK.theme.setMode('auto');   // 'light' | 'dark' | 'auto' — auto follows the system (1.114.0)

Action group seit 1.16

ActionGroup::html() returns a row of small buttons in one go; render() prints it. An item with 'showIf' => false is left out, 'pill' rounds it, and an icon-only item needs 'title' for its name.

Code anzeigen
echo ActionGroup::html([
    ['icon' => 'edit', 'title' => 'Edit'],
    ['icon' => 'content_copy', 'title' => 'Duplicate'],
    ['label' => 'Archive', 'icon' => 'archive', 'variant' => 'tonal', 'color' => 'warning'],
    ['icon' => 'delete', 'title' => 'Delete', 'color' => 'danger', 'showIf' => false],
    ['label' => 'Send', 'icon' => 'send', 'variant' => 'filled', 'color' => 'primary', 'pill' => true],
]);

Button: size xs, icon on the right, full width, data and aria attributes

Code anzeigen
echo '<div class="gk-flex gk-gap-md gk-items-center" style="flex-wrap:wrap">';
echo Button::render('Extra small', ['variant' => 'outlined', 'size' => 'xs']);
echo Button::render('Next', ['icon' => 'arrow_forward', 'iconPosition' => 'right', 'variant' => 'filled', 'color' => 'primary']);
echo Button::render('Page 3', ['variant' => 'tonal', 'data' => ['row' => 3], 'attrs' => ['aria-current' => 'page']]);
echo '</div>';
echo '<div class="gk-mt-2">' . Button::render('Full width', ['variant' => 'outlined', 'fullWidth' => true]) . '</div>';

Utility classes seit 0.9

Every utility class on a small sample, generated from css/blocks.json, so a new class shows up here without anyone writing it twice. Spacing and size classes act on the sample's box, colours and type on its text.

gk-active
Aa
gk-bg-danger-soft
Aa
gk-bg-muted
Aa
gk-bg-primary-soft
Aa
gk-bg-success-soft
Aa
gk-bg-surface
Aa
gk-bg-warning-soft
Aa
gk-block
Aa
gk-break-word
Aa
gk-clickable
Aa
gk-code
Aa
gk-disabled
Aa
gk-flex
Aa
gk-flex-1
Aa
gk-flex-between
Aa
gk-flex-center
Aa
gk-flex-col
Aa
gk-flex-wrap
Aa
gk-font-mono
Aa
gk-fs-2xl
Aa
gk-fs-base
Aa
gk-fs-lg
Aa
gk-fs-md
Aa
gk-fs-sm
Aa
gk-fs-xl
Aa
gk-fs-xs
Aa
gk-fw-bold
Aa
gk-fw-medium
Aa
gk-fw-normal
Aa
gk-fw-semibold
Aa
gk-gap-2xl
Aa
gk-gap-lg
Aa
gk-gap-md
Aa
gk-gap-sm
Aa
gk-gap-xl
Aa
gk-gap-xs
Aa
gk-grid
Aa
gk-grid-2
Aa
gk-grid-4
Aa
gk-h-auto
Aa
gk-h-full
Aa
gk-hidden
Aa
gk-hide-mobile
Aa
gk-inline
Aa
gk-inline-block
Aa
gk-inline-flex
Aa
gk-items-baseline
Aa
gk-items-center
Aa
gk-items-end
Aa
gk-items-start
Aa
gk-justify-between
Aa
gk-justify-center
Aa
gk-justify-end
Aa
gk-justify-start
Aa
gk-m-0
Aa
gk-m-1
Aa
gk-m-2
Aa
gk-m-3
Aa
gk-m-4
Aa
gk-m-5
Aa
gk-m-6
Aa
gk-mb-0
Aa
gk-mb-1
Aa
gk-mb-2
Aa
gk-mb-3
Aa
gk-mb-4
Aa
gk-mb-5
Aa
gk-mb-6
Aa
gk-ml-0
Aa
gk-ml-1
Aa
gk-ml-2
Aa
gk-ml-3
Aa
gk-ml-4
Aa
gk-ml-auto
Aa
gk-mr-0
Aa
gk-mr-1
Aa
gk-mr-2
Aa
gk-mr-3
Aa
gk-mr-4
Aa
gk-mr-auto
Aa
gk-mt-0
Aa
gk-mt-1
Aa
gk-mt-2
Aa
gk-mt-3
Aa
gk-mt-4
Aa
gk-mt-5
Aa
gk-mt-6
Aa
gk-mx-auto
Aa
gk-no-decoration
Aa
gk-not-clickable
Aa
gk-nowrap
Aa
gk-overflow-x-auto
Aa
gk-overflow-y-auto
Aa
gk-p-0
Aa
gk-p-1
Aa
gk-p-2
Aa
gk-p-3
Aa
gk-p-4
Aa
gk-p-5
Aa
gk-p-6
Aa
gk-px-0
Aa
gk-px-1
Aa
gk-px-2
Aa
gk-px-3
Aa
gk-px-4
Aa
gk-px-5
Aa
gk-px-6
Aa
gk-py-0
Aa
gk-py-1
Aa
gk-py-2
Aa
gk-py-3
Aa
gk-py-4
Aa
gk-py-5
Aa
gk-py-6
Aa
gk-rounded-full
Aa
gk-rounded-lg
Aa
gk-rounded-md
Aa
gk-rounded-none
Aa
gk-rounded-sm
Aa
gk-rounded-xl
Aa
gk-show-mobile
Aa
gk-spacer
Aa
gk-spacer-lg
Aa
gk-spacer-md
Aa
gk-spacer-sm
Aa
gk-spacer-xl
Aa
gk-sr-only
Aa
gk-text-center
Aa
gk-text-danger
Aa
gk-text-left
Aa
gk-text-muted
Aa
gk-text-on-surface
Aa
gk-text-primary
Aa
gk-text-right
Aa
gk-text-success
Aa
gk-text-warning
Aa
gk-truncate
Aa
gk-w-auto
Aa
gk-w-full
Aa

Examples

A whole application, not a mock-up

Everything below this box is a gallery — it shows what exists. If you would rather see what it is for, examples/invoices/ is a working invoice manager: create, edit, delete, with search, filter, sort and paging answered by the server. About 300 lines, no database.

Open the example application

Dashboard Demo

Invoices152
Revenue 2026127.840,00 €
Open18.320,00 €
Overdue4.280,00 €
AmountDateStatus
RE-2026-001Mustermann GmbH2.400,00 €paid
RE-2026-002Technik AG5.800,00 €pending
RE-2026-003Design Studio1.200,00 €overdue
RE-2026-004Web Solutions3.600,00 €paid
RE-2026-005Media House950,00 €pending

Skeleton — Starting point for new projects

skeleton.php is the ready-made scaffolding for a new GridKit project. Just copy, adjust title + navigation, fill in sections — done.

Quick start:
cp /path/to/gridkit/skeleton.php my-project/index.php

Anatomy of a GridKit Page

Every page follows this structure — from skeleton.php to production.

Config
SIDEBAR
Header
Content
Footer · JS
Configuration
Theme::set('indigo') · Layout::bodyTag('gk-root')
Sidebar
->brand() · ->group() · ->item(label, url, icon)
Header
->title() · ->fixed() · ->user(name, opts)
Content
<main class="gk-main"> · Tables, Forms, Cards…
Footer
<script src="gridkit.js">

Auth — Login Protection

Auth protects pages with session-based login. Passwords are stored as bcrypt hashes.

Auth::protect(); // Protect page Auth::login($user, $pass); // Login attempt Auth::logout('login.php'); // Clear session Auth::check(); // Logged in? Auth::user(); // Username Auth::hashPassword('abc'); // bcrypt hash Auth::renderLogin([...]); // Login page

Open the login page live demo:

Open Login Demo

Credentials: demo / demo

Tooltip seit 0.9

One engine for every tooltip: it places the bubble on the side you ask for, flips it when there is no room, shifts it along the edge to stay inside the window (and inside a box that scrolls) and keeps the arrow on its trigger. Hover opens it after a short delay, keyboard focus at once, a tap on touch; Escape, blur, scrolling away and the pointer leaving close it. A screen reader hears the text as the trigger's description. Without the script the CSS-only tooltip is what it always was.

Placement: flip, shift, auto seit 0.9

Each trigger in the box below asks for a side it has no room on, at the edge of a box that scrolls: the bubble flips to the other side or slides along the edge, and the arrow still points at the word. Scroll the box — the bubble follows, and closes when its trigger leaves the visible part. auto takes above or below, whichever has more room.

top → flipsleft → flipsright → flipstop, shiftedautofurther down
Code anzeigen
$spot = static fn (string $where, string $label, string $text, string $pos): string =>
    '<span class="demo-tt-spot" style="' . $where . '"' . Tooltip::attrs($text, ['pos' => $pos]) . '>' . $label . '</span>';
echo '<div class="demo-tt-box"><div class="demo-tt-inner">'
   . $spot('top:6px;left:40%', 'top → flips', 'Asked for top — no room, so below', 'top')
   . $spot('top:64px;left:6px', 'left → flips', 'Asked for left — no room, so right', 'left')
   . $spot('top:64px;right:6px', 'right → flips', 'Asked for right, at the right edge — so left', 'right')
   . $spot('top:112px;right:6px', 'top, shifted', 'A long text at the right edge: shifted left, the arrow stays on the word', 'top')
   . $spot('top:160px;left:40%', 'auto', 'auto: above or below, whichever has more room', 'auto')
   . $spot('top:380px;left:30%', 'further down', 'Scroll the box: this one follows its trigger', 'bottom')
   . '</div></div>';

Tones, keyboard hint, width, delay seit 0.9

Six tones, each at 4.5:1 or more in light and dark mode, under every theme. kbd adds a key after the text, max narrows the bubble, delay sets the wait on hover (0 opens at once).

neutralinfosuccesswarningdangerlight
max 160delay 0delay 1000
Code anzeigen
echo '<div class="demo-tt-row">';
foreach (['neutral', 'info', 'success', 'warning', 'danger', 'light'] as $tone) {
    echo '<span class="demo-tt-chip"' . Tooltip::attrs(ucfirst($tone) . ' tone', ['tone' => $tone]) . '>' . $tone . '</span>';
}
echo '</div><div class="demo-tt-row">';
echo Button::render('Save', ['icon' => 'save', 'tooltip' => ['text' => 'Saves the draft', 'kbd' => 'Ctrl+S']]);
echo '<span class="demo-tt-chip"' . Tooltip::attrs('A long explanation that would run wide is kept to 160 pixels and wraps', ['max' => 160]) . '>max 160</span>';
echo '<span class="demo-tt-chip"' . Tooltip::attrs('Opens at once', ['delay' => 0]) . '>delay 0</span>';
echo '<span class="demo-tt-chip"' . Tooltip::attrs('Took its time', ['delay' => 1000]) . '>delay 1000</span>';
echo '</div>';

Toggletip and help icon seit 0.9

A toggletip opens on a click, Enter or Space — not on hover — and stays open, so it can hold a link or a button. Its text is read out; the focus stays on the trigger, and Tab walks into its links. Escape, a click outside or a second click close it. Tooltip::help() is the ready-made "?" (24px, 44px to a finger), named after what it explains.

VAT IBAN
Code anzeigen
echo '<div class="demo-tt-row">';
echo '<span>VAT ' . Tooltip::help('Reduced rate of 10 % for food and books.', ['label' => 'VAT']) . '</span>';
echo '<span>IBAN ' . Tooltip::help('#demo-iban-help', ['label' => 'IBAN', 'icon' => 'info']) . '</span>';
echo '<button type="button" class="gk-btn gk-btn-outlined gk-btn-neutral"'
   . Tooltip::toggletip('Counted from the invoice date, not from delivery.', ['tone' => 'info', 'pos' => 'bottom']) . '>Why 14 days?</button>';
echo '</div>';
echo '<div id="demo-iban-help" hidden>On your bank card and statement. <a href="#tooltip">Where to find it</a></div>';

On components: Button, Table, Form seit 0.9

'tooltip' on a button and on a table's row button replaces the browser's title — never both, and a description, not the name. On a table column it is a help icon beside the label (the sort button still sorts); 'help' on a form field puts one beside the label. All of it survives a sort of a setData() table.

Customers with tooltips
Aktionen
Mustermann GmbH1.450,00 €
Weber & Partner890,50 €
Code anzeigen
echo '<p>' . Button::icon('delete', ['color' => 'danger', 'tooltip' => ['text' => 'Deletes the invoice for good', 'tone' => 'danger']]) . '</p>';
(new Table('demo-tooltip-table'))
    ->setData([
        ['id' => 1, 'customer' => 'Mustermann GmbH', 'net' => 1450.00],
        ['id' => 2, 'customer' => 'Weber & Partner', 'net' => 890.50],
    ])
    ->column('customer', 'Customer', ['sortable' => true, 'tooltip' => 'As on the contract'])
    ->column('net', 'Net', ['format' => 'currency', 'align' => 'right', 'sortable' => true,
                            'tooltip' => ['text' => 'Before VAT', 'tone' => 'info']])
    ->button('edit', ['icon' => 'edit', 'tooltip' => 'Edit this customer'])
    ->caption('Customers with tooltips')
    ->render();
(new Form('demo-tooltip-form'))
    ->field('iban', 'IBAN', 'text', ['help' => 'On your bank card.'])
    ->field('terms', 'I accept the terms', 'checkbox', ['help' => 'They fit on one page.'])
    ->render();

Title, plain, rich

Any title gets the same bubble (GK.tip; opt out with data-gk-tip-off). data-gk-tooltip is the plain form by hand; data-gk-tooltip-rich shows an element with HTML in it, and the pointer can move into it.

title title, two lines opt-out plain wrap rich
GridKit Tooltip

Real HTML: formatting, and a link the pointer can reach.

Code anzeigen
echo <<<'HTML'
<div class="demo-tt-row">
  <span class="demo-tt-chip" title="Upgraded automatically — just use title">title</span>
  <span class="demo-tt-chip" title="First line&#10;Second line (\n breaks)">title, two lines</span>
  <span data-gk-tip-off><span class="demo-tt-chip" title="This one is the browser's own">opt-out</span></span>
  <span class="demo-tt-chip" data-gk-tooltip="Plain, by hand" data-gk-tooltip-pos="bottom">plain</span>
  <span class="demo-tt-chip" data-gk-tooltip="Several lines when the text is long enough to need them" data-gk-tooltip-wrap>wrap</span>
  <span class="demo-tt-chip" data-gk-tooltip-rich="#richTip1">rich</span>
</div>
<div id="richTip1"><strong>GridKit Tooltip</strong>
  <p style="margin:6px 0 4px">Real HTML: formatting, and <a href="#tooltip">a link</a> the pointer can reach.</p>
</div>
HTML;

Permissions seit 1.115

PermissionMatrix puts roles in columns and permissions in rows, grouped by module. It is a plain form first: every cell posts perm[role][permission] as 0 or 1, and read() on the server gives it back as role → permission → true/false. With the script: Support and Editor inherit Guest (ticked "via Guest", changed in Guest's column), Admin is locked, ticking "Publish pages" ticks what it needs and unticking "View pages" unticks what needs it. Tick a whole row, column or group; filter; fold a module; changed cells keep a dot until saved. One tab stop — the arrow keys move between cells, Space toggles. On a phone it shows one role at a time.

Roles and rights, saved with the form

Roles and rights
BerechtigungAdminOwner of the installationFest20 von 20AccountingInvoices and payments7 von 20EditorPages and newslettersErbt von Guest7 von 20SupportAnswers customersErbt von Guest6 von 20GuestReads, changes nothing3 von 20
Invoices5
View invoices
Create and edit invoicesBraucht: View invoices
Send invoices to customersBraucht: View invoices
Cancel invoices RiskantWrites a credit note; the invoice stays on record.Braucht: Create and edit invoices
Delete invoices RiskantInvoices have to be kept for seven years.Braucht: Create and edit invoices
Customers3
View customers
Edit customer dataBraucht: View customers
Export the customer list RiskantPersonal data leaves the system as a CSV file.Braucht: View customers
Newsletter4
View campaigns and lists
Write campaignsBraucht: View campaigns and lists
Send to subscribers RiskantBraucht: Write campaigns
Manage recipient listsBraucht: View campaigns and lists
CMS pages4
View pages and drafts
Edit pagesBraucht: View pages and drafts
Publish pagesBraucht: Edit pages
Upload images and filesBraucht: View pages and drafts
Users & rights4
View users
Create and edit users RiskantBraucht: View users
Change roles and rights RiskantBraucht: Create and edit users
Sign in as another user RiskantBraucht: View users
  • Erteilt
  • über …Von der übergeordneten Rolle geerbt — dort ändern
  • Feste Rolle — hat immer alle Rechte
  • Riskant Riskantes Recht — mit Bedacht erteilen
  • Braucht: … Ankreuzen kreuzt an, was es braucht; wird das abgewählt, wird es mit abgewählt
Code anzeigen
$rights = static fn (array $grants): PermissionMatrix => (new PermissionMatrix('rights'))
    ->caption('Roles and rights')
    ->role('admin', 'Admin', ['locked' => true, 'color' => 'red', 'description' => 'Owner of the installation'])
    ->role('accounting', 'Accounting', ['color' => 'green', 'description' => 'Invoices and payments'])
    ->role('editor', 'Editor', ['parent' => 'guest', 'color' => 'blue', 'description' => 'Pages and newsletters'])
    ->role('support', 'Support', ['parent' => 'guest', 'color' => 'orange', 'description' => 'Answers customers'])
    ->role('guest', 'Guest', ['color' => 'gray', 'description' => 'Reads, changes nothing'])
    ->group('invoices', 'Invoices')
    ->permission('invoices.view', 'View invoices')
    ->permission('invoices.edit', 'Create and edit invoices', ['requires' => 'invoices.view'])
    ->permission('invoices.send', 'Send invoices to customers', ['requires' => 'invoices.view'])
    ->permission('invoices.cancel', 'Cancel invoices', ['requires' => 'invoices.edit', 'danger' => true,
        'description' => 'Writes a credit note; the invoice stays on record.'])
    ->permission('invoices.delete', 'Delete invoices', ['requires' => 'invoices.edit', 'danger' => true,
        'description' => 'Invoices have to be kept for seven years.'])
    ->group('customers', 'Customers')
    ->permission('customers.view', 'View customers')
    ->permission('customers.edit', 'Edit customer data', ['requires' => 'customers.view'])
    ->permission('customers.export', 'Export the customer list', ['requires' => 'customers.view', 'danger' => true,
        'description' => 'Personal data leaves the system as a CSV file.'])
    ->group('newsletter', 'Newsletter')
    ->permission('newsletter.view', 'View campaigns and lists')
    ->permission('newsletter.write', 'Write campaigns', ['requires' => 'newsletter.view'])
    ->permission('newsletter.send', 'Send to subscribers', ['requires' => 'newsletter.write', 'danger' => true])
    ->permission('newsletter.lists', 'Manage recipient lists', ['requires' => 'newsletter.view'])
    ->group('cms', 'CMS pages')
    ->permission('cms.view', 'View pages and drafts')
    ->permission('cms.edit', 'Edit pages', ['requires' => 'cms.view'])
    ->permission('cms.publish', 'Publish pages', ['requires' => 'cms.edit'])
    ->permission('cms.media', 'Upload images and files', ['requires' => 'cms.view'])
    ->group('users', 'Users & rights', ['collapsed' => true])
    ->permission('users.view', 'View users')
    ->permission('users.edit', 'Create and edit users', ['requires' => 'users.view', 'danger' => true])
    ->permission('users.roles', 'Change roles and rights', ['requires' => 'users.edit', 'danger' => true])
    ->permission('users.impersonate', 'Sign in as another user', ['requires' => 'users.view', 'danger' => true])
    ->grants($grants);

$stored = [                                   // what your database holds
    'accounting' => ['invoices.view', 'invoices.edit', 'invoices.send', 'invoices.cancel',
                     'customers.view', 'customers.edit', 'customers.export'],
    'editor'     => ['cms.edit', 'cms.publish', 'cms.media', 'newsletter.write'],
    'support'    => ['customers.edit', 'invoices.view', 'invoices.send'],
    'guest'      => ['customers.view', 'newsletter.view', 'cms.view'],
];

if (isset($_POST['perm'])) {
    // role => permission => bool for every posted cell; what a ticked right needs is added.
    foreach ($rights($stored)->read($_POST['perm']) as $role => $cells) {
        $stored[$role] = array_keys(array_filter($cells));   // … write it to your database here
    }
    $saved = [];
    foreach ($stored as $role => $list) $saved[] = $role . ': ' . (implode(', ', $list) ?: '—');
    echo '<p class="gk-message gk-message-success" role="status" style="overflow-wrap:anywhere">Read back and saved — '
        . htmlspecialchars(implode(' · ', $saved), ENT_QUOTES) . '</p>';
}

echo '<form method="post" action="#permissions">';
$rights($stored)->render();
echo '<div class="demo-btn-row" style="margin-top:12px">'
    . Button::render('Save rights', ['type' => 'submit', 'icon' => 'check'])
    . '</div></form>';

Every change fires gk:permchange — the last one: nothing yet.

On the server

// The form posts every cell: a hidden "0", and the checkbox's "1" when it is ticked.
//   perm[editor][cms.publish] = 1      perm[editor][cms.media] = 0      (Admin, locked: nothing)
// Build the matrix as for the page, then:
$map = $matrix->read($_POST['perm'] ?? []);     // ['editor' => ['cms.publish' => true, 'cms.media' => false, …], …]

// Without the definition at hand — only roles and keys you allow, only 0/1/true/false:
$map = PermissionMatrix::fromPost($_POST['perm'] ?? [], ['editor', 'guest'], ['cms.view', 'cms.edit']);

foreach ($map as $role => $cells) {
    foreach ($cells as $permission => $granted) {
        $granted ? $db->grant($role, $permission) : $db->revoke($role, $permission);
    }
}

Saved as you go

saveUrl() posts each change as JSON — {"matrix":"pages","changes":{"author":{"cms.publish":true}}} — and expects {"ok":true}. This demo's endpoint refuses to grant "Delete pages": the box goes back and a toast says why. Author inherits Contributor; the matrix is height('260px'), so its head stays in view while it scrolls.

Page rights
BerechtigungEditor3 von 4AuthorErbt von Contributor1 von 4Contributor1 von 4
CMS pages4
View pages
Edit pagesBraucht: View pages
Publish pagesBraucht: Edit pages
Delete pages RiskantBraucht: Edit pages
  • Erteilt
  • über …Von der übergeordneten Rolle geerbt — dort ändern
  • Riskant Riskantes Recht — mit Bedacht erteilen
  • Braucht: … Ankreuzen kreuzt an, was es braucht; wird das abgewählt, wird es mit abgewählt
Code anzeigen
(new PermissionMatrix('pages'))
    ->caption('Page rights')
    ->role('editor', 'Editor')
    ->role('author', 'Author', ['parent' => 'contributor'])
    ->role('contributor', 'Contributor')
    ->group('cms', 'CMS pages')
    ->permission('cms.view', 'View pages')
    ->permission('cms.edit', 'Edit pages', ['requires' => 'cms.view'])
    ->permission('cms.publish', 'Publish pages', ['requires' => 'cms.edit'])
    ->permission('cms.delete', 'Delete pages', ['requires' => 'cms.edit', 'danger' => true])
    ->grants(['editor' => ['cms.view', 'cms.edit', 'cms.publish'], 'contributor' => ['cms.view']])
    ->saveUrl('api/permissions.php')               // + ['headers' => ['X-CSRF-Token' => $token]]
    ->height('260px')
    ->render();

Read only

readonly() shows who may do what and posts nothing. Filter and folding stay; the cells can still be reached with the arrow keys and say what they are.

Rights of the support team
BerechtigungSupportErbt von Guest2 von 2Guest1 von 2
Customers2
View customers
Edit customer dataBraucht: View customers
  • Erteilt
  • über …Von der übergeordneten Rolle geerbt — dort ändern
  • Braucht: … Ankreuzen kreuzt an, was es braucht; wird das abgewählt, wird es mit abgewählt
Code anzeigen
(new PermissionMatrix('rights-view'))
    ->caption('Rights of the support team')
    ->role('support', 'Support', ['parent' => 'guest'])
    ->role('guest', 'Guest')
    ->group('customers', 'Customers')
    ->permission('customers.view', 'View customers')
    ->permission('customers.edit', 'Edit customer data', ['requires' => 'customers.view'])
    ->grants(['guest' => ['customers.view'], 'support' => ['customers.edit']])
    ->readonly()
    ->render();

Tree seit 1.116

Page trees, categories, folders. GridKit\Tree writes a nested list that works without any script — a link is followed, a ticked box is posted. js/tree.js makes it a tree view: the arrow keys, Home and End, *, type-ahead, open and closed remembered per tree, a filter, children loaded when a node is first opened, and moving by drag and drop or by keyboard, saved to a URL and given back when the save fails.

A page tree: links, one page selected, moving, lazy branches

Tab into the tree: ↑ ↓ walk, → opens or goes in, ← closes or goes up, a letter jumps, Enter follows the link, Space selects. Tab from a page reaches its buttons and its handle: Space lifts the page, the arrows move it (→ into the page above, ← out of its parent), Space puts it down, Esc cancels — or drag the handle. Every move is posted to api/tree-move.php, which refuses one on purpose: nothing takes Home's place at the top, so the page goes back and a toast says why. Blog loads its years and posts from api/tree-children.php; Archive fails on purpose; Legal is disabled and takes no pages.

Code anzeigen
$pages = [
    ['id' => 'home', 'parent_id' => null, 'title' => 'Home', 'icon' => 'home', 'draggable' => false],
    ['id' => 'about', 'parent_id' => null, 'title' => 'About us', 'icon' => 'folder'],
    ['id' => 'team', 'parent_id' => 'about', 'title' => 'Team', 'icon' => 'description'],
    ['id' => 'history', 'parent_id' => 'about', 'title' => 'History', 'icon' => 'description', 'muted' => 'unpublished'],
    ['id' => 'services', 'parent_id' => null, 'title' => 'Services', 'icon' => 'folder', 'expanded' => true],
    ['id' => 'web', 'parent_id' => 'services', 'title' => 'Web design', 'icon' => 'description', 'badge' => ['text' => 'New', 'color' => 'green']],
    ['id' => 'hosting', 'parent_id' => 'services', 'title' => 'Hosting', 'icon' => 'description'],
    ['id' => 'seo', 'parent_id' => 'services', 'title' => 'Search engine optimisation for small and medium-sized businesses', 'icon' => 'description'],
    ['id' => 'blog', 'parent_id' => null, 'title' => 'Blog', 'icon' => 'folder', 'children' => 'lazy', 'count' => 5],
    ['id' => 'archive', 'parent_id' => null, 'title' => 'Archive', 'icon' => 'inventory_2', 'children' => 'lazy'],
    ['id' => 'contact', 'parent_id' => null, 'title' => 'Contact', 'icon' => 'description'],
    ['id' => 'legal', 'parent_id' => null, 'title' => 'Legal', 'icon' => 'gavel', 'disabled' => true, 'badge' => 'Locked'],
    ['id' => 'imprint', 'parent_id' => 'legal', 'title' => 'Imprint', 'icon' => 'description'],
    ['id' => 'privacy', 'parent_id' => 'legal', 'title' => 'Privacy', 'icon' => 'description'],
];
foreach ($pages as &$page) $page['href'] = '#tree-page-' . $page['id'];
unset($page);

(new Tree('demo-pages'))
    ->label('Pages')
    ->nodes($pages)
    ->select('single')->name('page')->selected(['hosting'])
    ->expandTo('team')
    ->searchable()
    ->lazyUrl('api/tree-children.php')
    ->moveUrl('api/tree-move.php', ['headers' => ['X-CSRF-Token' => 'demo-token']])
    ->actions(fn (array $n): array => [
        ['icon' => 'edit', 'title' => 'Edit', 'href' => '#tree-edit-' . $n['id']],
        ['icon' => 'add', 'title' => 'Add a page below', 'href' => '#tree-add-' . $n['id']],
    ])
    ->render();
Events appear here.
The two endpoints: api/tree-children.php and api/tree-move.php
<?php
/**
 * The lazy branches of the demo's page tree (GridKit\Tree::lazyUrl(), 1.116.0).
 *
 * js/tree.js asks GET tree-children.php?parent=<id> the first time a node with
 * 'children' => 'lazy' is opened, and puts the <li> of the answer into the node.
 * This file is that answer: the rows of one parent, written by renderBranch() on
 * a tree configured as on the page — same id, selection, name and buttons — so the
 * children look and post like their neighbours. A real endpoint reads the rows from
 * its database; nothing else changes.
 */

declare(strict_types=1);

require_once __DIR__ . '/../../autoload.php';

use GridKit\{Lang, Tree};

$lang = $_GET['lang'] ?? $_COOKIE['gk_lang'] ?? 'en';
Lang::set(in_array($lang, ['en', 'de'], true) ? $lang : 'en');

$parent = is_string($_GET['parent'] ?? null) ? $_GET['parent'] : '';

// A moment of latency, so the demo shows the ring that turns in the chevron.
usleep(450000);

// One branch fails on purpose: the node closes again, its row says so and offers "Try again".
if ($parent === 'archive') {
    http_response_code(503);
    header('Content-Type: text/plain; charset=utf-8');
    echo 'The archive server is asleep (on purpose, in this demo).';
    exit;
}

$rows = [
    'blog' => [
        ['id' => 'blog-2026', 'title' => '2026', 'icon' => 'folder', 'children' => 'lazy', 'count' => 3],
        ['id' => 'blog-2025', 'title' => '2025', 'icon' => 'folder', 'children' => 'lazy', 'count' => 2],
    ],
    'blog-2026' => [
        ['id' => 'post-spring', 'title' => 'Spring sale: 20% on all hosting plans', 'icon' => 'article'],
        ['id' => 'post-office', 'title' => 'Our new office in Graz', 'icon' => 'article'],
        ['id' => 'post-green', 'title' => 'Hosting moves to green power — what changes for you and your websites', 'icon' => 'article', 'muted' => 'draft'],
    ],
    'blog-2025' => [
        ['id' => 'post-ten', 'title' => 'Ten years of web design', 'icon' => 'article'],
        ['id' => 'post-seo', 'title' => 'Five SEO myths', 'icon' => 'article'],
    ],
][$parent] ?? [];

foreach ($rows as &$row) {
    $row['parent_id'] = $parent;
    $row['href'] = '#tree-page-' . $row['id'];
}
unset($row);

header('Content-Type: text/html; charset=utf-8');
(new Tree('demo-pages'))
    ->select('single')->name('page')
    ->actions(static fn (array $n): array => [
        ['icon' => 'edit', 'title' => 'Edit', 'href' => '#tree-edit-' . $n['id']],
        ['icon' => 'add', 'title' => 'Add a page below', 'href' => '#tree-add-' . $n['id']],
    ])
    ->nodes($rows)
    ->renderBranch($parent);
<?php
/**
 * The move endpoint of the demo's page tree (GridKit\Tree::moveUrl(), 1.116.0).
 *
 * js/tree.js posts every move as JSON {"id", "parent", "index"} — parent null for the
 * top level, index counted from 0 among the new siblings — with the headers given to
 * moveUrl(). A 2xx is saved unless the JSON says {"ok": false}; anything else puts the
 * node back, and "message" is what the person reads.
 *
 * The demo stores nothing (a reload shows the tree as it was) and refuses one move on
 * purpose, so the way back can be seen: nothing may take the place of Home at the top.
 */

declare(strict_types=1);

header('Content-Type: application/json; charset=utf-8');

$answer = static function (int $status, array $body): never {
    http_response_code($status);
    echo json_encode($body, JSON_UNESCAPED_UNICODE);
    exit;
};

if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
    $answer(405, ['ok' => false, 'message' => 'Moves are posted.']);
}
// The token the page gave moveUrl() in 'headers'. A real application compares it with the session's.
if (($_SERVER['HTTP_X_CSRF_TOKEN'] ?? '') !== 'demo-token') {
    $answer(403, ['ok' => false, 'message' => 'The page is out of date. Reload it and try again.']);
}

$move = json_decode((string) file_get_contents('php://input'), true);
$id = is_array($move) && is_scalar($move['id'] ?? null) ? (string) $move['id'] : '';
$parent = is_array($move) && array_key_exists('parent', $move) ? $move['parent'] : false;
$index = is_array($move) ? filter_var($move['index'] ?? null, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]]) : false;
if ($id === '' || $index === false || !($parent === null || is_string($parent))) {
    $answer(400, ['ok' => false, 'message' => 'The move could not be read.']);
}

if ($parent === null && $index === 0 && $id !== 'home') {
    $answer(409, ['ok' => false, 'message' => 'Home stays at the top — the page went back to its place.']);
}

usleep(250000);
$answer(200, ['ok' => true]);

Categories: several, with tri-state parents, in a form

With select('multi') every node has a box. A ticked parent ticks its branch (but not a disabled node in it); a parent with some of its children ticked is mixed. The form posts categories[]=id for every ticked node — with or without the script. Vinyl starts selected.

    • 214
    • 38
    • Rare editionsSold out
    • 120
    • 64
    • (hidden in the shop)9

Code anzeigen
echo '<form id="demo-tree-form" action="#tree" method="post">';
(new Tree('demo-cats'))
    ->label('Categories')
    ->select('multi')->name('categories')->selected(['books', 'vinyl'])
    ->searchable()
    ->nodes([
        ['id' => 'books', 'title' => 'Books', 'children' => [
            ['id' => 'novels', 'title' => 'Novels', 'count' => 214],
            ['id' => 'poetry', 'title' => 'Poetry', 'count' => 38],
            ['id' => 'rare', 'title' => 'Rare editions', 'disabled' => true, 'badge' => ['text' => 'Sold out', 'color' => 'red']],
        ]],
        ['id' => 'music', 'title' => 'Music', 'expanded' => true, 'children' => [
            ['id' => 'cds', 'title' => 'CDs', 'count' => 120],
            ['id' => 'vinyl', 'title' => 'Vinyl', 'count' => 64],
            ['id' => 'tapes', 'title' => 'Tapes', 'count' => 9, 'muted' => 'hidden in the shop'],
        ]],
        ['id' => 'games', 'title' => 'Games', 'children' => [
            ['id' => 'board', 'title' => 'Board games'],
            ['id' => 'puzzles', 'title' => 'Puzzles'],
        ]],
    ])
    ->render();
echo '<p><button type="submit" class="gk-btn gk-btn-filled gk-btn-primary">Save categories</button></p></form>';

Folders: moved without a URL — the page decides

movable() without moveUrl(): the tree fires the cancelable gk:treemove and the page saves (or not) on its own. This page refuses to put anything into Trash by dragging. The chain under Projects is ten levels deep: the indent stops after eight (five on a phone) and a small number shows the level.

  • Inbox12
    • Clients
    • Offers
  • Projects
    • Website relaunch
      • Design
        • Drafts
          • Round 2
            • Mobile
              • Header
                • Logo
                  • Variants
                    • Final
  • Trash
Code anzeigen
(new Tree('demo-folders'))
    ->label('Folders')
    ->movable()
    ->toolbar(false)
    ->node('inbox', 'Inbox', null, ['icon' => 'inbox', 'count' => 12, 'expanded' => true])
    ->node('clients', 'Clients', 'inbox', ['icon' => 'folder'])
    ->node('offers', 'Offers', 'inbox', ['icon' => 'folder'])
    ->node('projects', 'Projects', null, ['icon' => 'folder'])
    ->node('relaunch', 'Website relaunch', 'projects', ['icon' => 'folder'])
    ->node('design', 'Design', 'relaunch', ['icon' => 'folder'])
    ->node('drafts', 'Drafts', 'design', ['icon' => 'folder'])
    ->node('round2', 'Round 2', 'drafts', ['icon' => 'folder'])
    ->node('mobile', 'Mobile', 'round2', ['icon' => 'folder'])
    ->node('header', 'Header', 'mobile', ['icon' => 'folder'])
    ->node('logo', 'Logo', 'header', ['icon' => 'folder'])
    ->node('variants', 'Variants', 'logo', ['icon' => 'folder'])
    ->node('final', 'Final', 'variants', ['icon' => 'image'])
    ->node('trash', 'Trash', null, ['icon' => 'delete', 'draggable' => false])
    ->expandTo('final')
    ->render();

Line items seit 1.117

The lines of an invoice, an offer or an order: GridKit\LineItems. Every field posts name[i][field] in the order on the screen; the totals — subtotal, discount, shipping, one VAT line per rate, the total — follow every keystroke, and LineItems::totals() computes the very same figures in PHP, to the cent: integers all the way, no float. Lines are added (the button, or Enter in the last field), duplicated, deleted with Undo, and put in order by the handle — mouse, finger or Space and the arrow keys. Narrower than 56rem, every line is a card.

An Austrian invoice

VAT 20 % and 10 %, a discount on one line, 3 % off everything, shipping, euros with a decimal comma. Type 1234,5, 1.234,50 or 1 234,50 — it is read the same, and written back as the page writes it.

  1. Betrag2.280,00 €
  2. Betrag238,80 €
  3. Betrag103,50 €
Zwischensumme (netto)
2.622,30 €
-78,67 €
4,90 €
Summe netto
2.548,53 €
USt. 20 %
489,63 €
USt. 10 %
10,04 €
Gesamtbetrag
3.048,20 €

Code anzeigen
(new LineItems('invoice'))
    ->invoiceColumns()          // description, qty, unit, unit price, discount %, VAT, amount
    ->locale('de')              // numbers with a decimal comma
    ->currency('EUR')
    ->vatRates([20, 10, 13, 0])
    ->discount(3)               // 3 % off everything, with its own field
    ->shipping('4.90')          // shipping, under the highest rate of the lines
    ->limits(1, 30)
    ->items([
        ['id' => 41, 'description' => "Website relaunch\nDesign, templates, three rounds of changes",
         'qty' => 1, 'unit' => 'flat', 'price' => '2400', 'discount' => 5, 'vat' => 20],
        ['id' => 42, 'description' => 'Web hosting, annual', 'qty' => 12, 'unit' => 'month', 'price' => 19.9, 'vat' => 20],
        ['id' => 43, 'description' => 'Handbook (print)', 'qty' => 3, 'unit' => 'pcs', 'price' => '34.50', 'vat' => 10],
    ])
    ->render();

What the page hears — gk:lineitemschange, its detail.totals:

Change a figure above.

The same invoice on the server

What the editor above posts as it was first drawn, read back with parse(): the lines in machine form, the messages keyed like the POST, and the totals — computed here, never taken from the browser. They are the figures under the lines above.

{
    "net": "2548.53",
    "vat": [
        {
            "rate": "20",
            "base": "2448.14",
            "amount": "489.63"
        },
        {
            "rate": "10",
            "base": "100.39",
            "amount": "10.04"
        }
    ],
    "gross": "3048.20",
    "errors": []
}
Code anzeigen
$lines = (new LineItems('invoice'))->invoiceColumns()->locale('de')->vatRates([20, 10, 13, 0])
    ->discount(0)->shipping(0);
$in = $lines->parse([
    'invoice' => [
        ['id' => '41', 'description' => "Website relaunch\nDesign, templates, three rounds of changes",
         'qty' => '1', 'unit' => 'flat', 'price' => '2.400,00', 'discount' => '5', 'vat' => '20'],
        ['id' => '42', 'description' => 'Web hosting, annual', 'qty' => '12', 'unit' => 'month',
         'price' => '19,90', 'discount' => '', 'vat' => '20'],
        ['id' => '43', 'description' => 'Handbook (print)', 'qty' => '3', 'unit' => 'pcs',
         'price' => '34,50', 'discount' => '', 'vat' => '10'],
    ],
    'invoice_discount' => '3',
    'invoice_shipping' => '4,90',
]);
$t = $in['totals'];
echo '<pre class="demo-log">' . htmlspecialchars(json_encode([
    'net' => $t['net'], 'vat' => $t['vat'], 'gross' => $t['gross'], 'errors' => $in['errors'],
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)) . '</pre>';

Sent: read-only

The same invoice once it has gone out: the same columns and grid, the figures as text — no field, no button, no handle, nothing that posts.

  1. BeschreibungWebsite relaunchDesign, templates, three rounds of changes
    Menge1
    Einheitpauschal
    Einzelpreis2.400,00 €
    Rabatt %5
    USt.20 %
    Betrag2.280,00 €
  2. BeschreibungWeb hosting, annual
    Menge12
    EinheitMonat
    Einzelpreis19,90 €
    Rabatt %
    USt.20 %
    Betrag238,80 €
  3. BeschreibungHandbook (print)
    Menge3
    EinheitStk.
    Einzelpreis34,50 €
    Rabatt %
    USt.10 %
    Betrag103,50 €
Zwischensumme (netto)
2.622,30 €
Rabatt 3 %
-78,67 €
Versand
4,90 €
Summe netto
2.548,53 €
USt. 20 %
489,63 €
USt. 10 %
10,04 €
Gesamtbetrag
3.048,20 €
Code anzeigen
(new LineItems('sent'))->invoiceColumns()->locale('de')->vatRates([20, 10])->discount(3)->shipping('4.90')
    ->items([
        ['description' => "Website relaunch\nDesign, templates, three rounds of changes",
         'qty' => 1, 'unit' => 'flat', 'price' => '2400', 'discount' => 5, 'vat' => 20],
        ['description' => 'Web hosting, annual', 'qty' => 12, 'unit' => 'month', 'price' => 19.9, 'vat' => 20],
        ['description' => 'Handbook (print)', 'qty' => 3, 'unit' => 'pcs', 'price' => '34.50', 'vat' => 10],
    ])
    ->readonly()
    ->render();

An article search, in a Form

A column of type lookup asks api/articles.php as you type (try "hand" or "hosting"); picking an article fills description, unit, price and VAT. The editor is a field of a Form here — 'lineitems', named by its label; an AJAX answer {"errors": {"order[1][qty]": "…"}} lands under that very cell. Gross prices this time.

  1. Article
    Amount0,00 €
Zwischensumme (brutto)
0,00 €
Summe netto
0,00 €
Gesamtbetrag
0,00 €

Code anzeigen
$lines = (new LineItems('order'))
    ->column('article', 'Article', ['type' => 'lookup', 'url' => 'api/articles.php', 'minChars' => 1,
        'subtextField' => 'number', 'display' => 'article_name',
        'fill' => ['description' => 'name', 'unit' => 'unit', 'price' => 'price', 'vat' => 'vat']])
    ->column('description', 'Description', ['type' => 'text', 'required' => true])
    ->column('qty', 'Qty', ['type' => 'number', 'required' => true, 'default' => '1'])
    ->column('unit', 'Unit', ['type' => 'select'])
    ->column('price', '', ['type' => 'money', 'required' => true])
    ->column('vat', 'VAT', ['type' => 'select'])
    ->column('total', 'Amount', ['type' => 'computed'])
    ->pricesNet(false)
    ->vatRates([20, 10])
    ->limits(1);
(new Form('order_form'))
    ->field('customer', 'Customer', 'text', ['width' => 8])
    ->field('order', 'Order lines', 'lineitems', ['lines' => $lines])
    ->render();

Import seit 1.119

Recipients, customers, articles from a CSV file: GridKit\Import. The fields are defined in PHP; the columns of the file are matched to them by name and alias (case, umlauts and spaces do not count), and every cell is checked by its field's type — e-mail, number and amount in German or English notation, a date as 31.12.2026, 2026-12-31 or 31/12/2026, yes or no, one of a list — as well as required fields and values that must be unique in the file. The separator, the quotation mark, the header row and the encoding (UTF-8, or Windows-1252 as German Excel writes it) are found by themselves. Without script it is a form in three steps; js/import.js reads the file in the browser, so the preview is there the moment a file is chosen, dropped or pasted, and follows every change of the mapping. Either way the server reads and checks the file again before it hands over a row.

Customers from a CSV file

Choose or drop a file, paste its text — or take the sample: kunden.csv, as German Excel saves it (semicolons, Windows-1252, a decimal comma, a note with a line break in it) with five mistakes in it. Change a column's field and the check follows. Import posts the file and the mapping to api/import.php, which reads and checks it once more and shows what it would store — this demo stores nothing.

  1. Datei
  2. Spalten und Prüfung
  3. Import
Bis 512 KB und 2.000 Zeilen. Getrennt durch ; , Tabulator oder |, in UTF-8 oder Windows-1252 (Excel).
Oder den Text einfügen
Code anzeigen
demoImporter()                      // the fields: demo/_import.php, below
    ->action('api/import.php')      // the steps after the first are answered there
    ->render();
Events appear here.
The importer (demo/_import.php) and its endpoint (api/import.php)
<?php
/**
 * The importer of the demo (GridKit\Import, 1.119.0), in one place: sections/import.php draws
 * its first step (and a second one the server draws on its own), api/import.php answers the
 * steps after it. Both build it here, so the server checks with the very fields the page shows.
 *
 * A public site: small files only, and storage(false) — nothing an anonymous visitor uploads is
 * kept on this server; the file travels in the form between the steps and is read and checked
 * again on every one of them.
 */

declare(strict_types=1);

use GridKit\Import;

function demoImporter(string $name = 'customers'): Import
{
    return (new Import($name))
        ->label('Import customers')
        ->field('customer_no', 'Customer no.', ['required' => true, 'unique' => true, 'aliases' => ['Kundennummer', 'Kd-Nr', 'Number']])
        ->field('first_name', 'First name', ['aliases' => ['Vorname', 'Given name']])
        ->field('last_name', 'Last name', ['required' => true, 'aliases' => ['Nachname', 'Surname']])
        ->field('email', 'E-mail', ['type' => 'email', 'required' => true, 'unique' => true, 'aliases' => ['E-Mail', 'Mail', 'E-Mail-Adresse']])
        ->field('country', 'Country', ['type' => 'select', 'options' => ['AT' => 'Austria', 'DE' => 'Germany', 'CH' => 'Switzerland'], 'aliases' => ['Land']])
        ->field('birthday', 'Birthday', ['type' => 'date', 'aliases' => ['Geburtsdatum', 'Date of birth']])
        ->field('revenue', 'Revenue', ['type' => 'money', 'aliases' => ['Umsatz']])
        ->field('newsletter', 'Newsletter', ['type' => 'bool'])
        ->locale('de')                 // German Excel writes 1.234,50 — and 1.500 means fifteen hundred
        ->limits(2000, 512 * 1024)     // a public demo takes small files
        ->storage(false);              // and keeps none of them: the file travels in the form
}
<?php
/**
 * The steps after the first of the demo's importer (GridKit\Import, 1.119.0).
 *
 * Without script the page posts the file here and this page shows step two — the mapping and the
 * preview — which posts to itself until the person imports or cancels. With script the browser has
 * shown step two already, and the form posts the file and the mapping here once. Either way this
 * page reads the file and checks every row again: no row is taken from the browser.
 *
 * A real page checks its CSRF token before handle() and stores $import->result()['rows'] when
 * step() says 'done'. The demo stores nothing and keeps nothing (storage(false) in _import.php):
 * it shows what it would store.
 */

declare(strict_types=1);

require_once __DIR__ . '/../../autoload.php';
require_once __DIR__ . '/../_import.php';

use GridKit\{Lang, Layout, Table};

$lang = $_GET['lang'] ?? $_COOKIE['gk_lang'] ?? 'en';
Lang::set(in_array($lang, ['en', 'de'], true) ? $lang : 'en');

$name = isset($_POST['customers-server']) ? 'customers-server' : 'customers';
$import = demoImporter($name)->action('import.php');
if (($_POST['sample'] ?? '') === '1') {
    $import->fromString((string) file_get_contents(__DIR__ . '/../media/kunden.csv'), 'kunden.csv');
} else {
    $import->handle();
}
$e = static fn (string $s): string => htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
?>
<!DOCTYPE html>
<html lang="<?= $e(Lang::locale()) ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="robots" content="noindex">
    <title>Import customers — GridKit Demo</title>
    <link rel="stylesheet" href="<?= Layout::asset('../../css/gridkit.css') ?>">
    <link rel="stylesheet" href="<?= Layout::asset('../../css/themes.css') ?>">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <style>body { margin: 0; background: var(--gk-surface-container); } main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
        .demo-card { background: var(--gk-surface); border: 1px solid var(--gk-outline-variant); border-radius: 12px; padding: 20px; }
        h1 { font-size: 22px; margin: 8px 0 16px; } h2 { font-size: 17px; margin: 28px 0 8px; }</style>
    <?= Lang::jsConfig() ?>
</head>
<?= Layout::bodyTag('gk-root') ?>
<main>
    <p><a href="../#import">← Back to the demo</a></p>
    <h1>Import customers</h1>
    <div class="demo-card">
        <?php $import->render(); ?>
    </div>
    <?php if ($import->step() === 'done'):
        $r = $import->result();
        $rows = [];
        foreach ($r['rows'] as $row => $values) {
            $line = ['row' => $row];
            foreach ($values as $key => $value) {
                $line[$key] = is_bool($value) ? ($value ? 'yes' : 'no') : (string) ($value ?? '');
            }
            $rows[] = $line;
        }
        ?>
        <h2>What the server would store</h2>
        <p>The rows of <code>$import->result()['rows']</code>, read and checked here again. Nothing is stored in this demo.</p>
        <?php
        $table = (new Table('imported'))->setData($rows)->caption('Imported rows')->column('row', 'Row', ['format' => 'number']);
        foreach (['customer_no' => 'Customer no.', 'first_name' => 'First name', 'last_name' => 'Last name', 'email' => 'E-mail',
                  'country' => 'Country', 'birthday' => 'Birthday', 'revenue' => 'Revenue', 'newsletter' => 'Newsletter'] as $key => $label) {
            if (in_array($key, $r['mapping'], true)) $table->column($key, $label);
        }
        $table->paginate(25)->render();
        ?>
    <?php endif; ?>
</main>
<script src="<?= Layout::asset('../../js/gridkit.js') ?>"></script>
<script src="<?= Layout::asset('../../js/import.js') ?>" defer></script>
</body>
</html>

Step two, drawn by the server

The sample read on the server with fromString(): what a browser without JavaScript gets after the upload — how the file was read, a field for every column (Notiz matches none and is ignored), the summary, the first rows with every error under its cell in words, the list of every row that will be left out, and the choice: import the valid rows, check again, or cancel. With storage(false) the file travels in the form, so js/import.js takes this one over too and checks every change at once.

  1. Datei (erledigt)
  2. Spalten und Prüfung
  3. Import

kunden.csv · 2 KB · 20 Zeilen

Wie die Datei gelesen wird
Welches Feld füllt jede Spalte?
z. B. K-1001, K-1002
z. B. Anna, Jürgen
z. B. Müller, Weiß
z. B. [email protected], [email protected]
z. B. AT, DE
z. B. 12.03.1985, 01.07.1979
z. B. 1.234,50, 980
z. B. ja, nein
z. B. Rückruf; bitte vormitta…, Stammkundin
20 Zeilen, 5 mit Fehlern.
Vorschau der ersten 8 Zeilen
ZeilePrüfungKundennummer→ Customer no.Vorname→ First nameNachname→ Last nameE-Mail→ E-mailLand→ CountryGeburtsdatum→ BirthdayUmsatz→ RevenueNewsletter→ NewsletterNotizignoriert
2OKK-1001AnnaMüller[email protected]AT12.03.19851.234,50ja
3OKK-1002JürgenWeiß[email protected]DE01.07.1979980neinRückruf; bitte vormittags Tel. nur Mo–Fr
4OKK-1003ZoëBrandstätter[email protected]AT7.11.199212.500,00x
5OKK-1004LukasÖsterreicher[email protected]at1988-05-230,99ja
6OKK-1005MarieSchäfer[email protected]Germany30.09.19752.310neinStammkundin
7OKK-1006NoahGruber[email protected]CH14/02/2001455,201
81 FehlerK-1007MaxHubermax.huber@Keine gültige E-Mail-Adresse.AT03.04.1990120,00ja
91 FehlerK-1008SophieWagner[email protected]AT31.02.1990Bitte ein Datum wie 31.12.2026 oder 2026-12-31 eingeben.75,5nein

Zeilen mit Fehlern (5)

  • Zeile 8 · E-mail: Keine gültige E-Mail-Adresse. max.huber@
  • Zeile 9 · Birthday: Bitte ein Datum wie 31.12.2026 oder 2026-12-31 eingeben. 31.02.1990
  • Zeile 10 · Customer no.: Schon in Zeile 3. K-1002
  • Zeile 11 · Last name: Last name ist ein Pflichtfeld.
  • Zeile 15 · Country: Nicht in der Liste: Austria, Germany, Switzerland. Atlantis
Zeilen mit Fehlern werden ausgelassen.
Code anzeigen
demoImporter('customers-server')
    ->action('api/import.php')
    ->preview(8)
    ->fromString((string) file_get_contents(__DIR__ . '/../media/kunden.csv'), 'kunden.csv')
    ->render();

What the page stores: result()

The rows that passed, keyed by their row in the sheet (the header is row 1), typed — amounts as exact strings, dates as Y-m-d, yes and no as booleans, a country as its code — and the messages of the rows that did not.

{
    "total": 20,
    "valid": 15,
    "invalid": 5,
    "rows": {
        "2": {
            "customer_no": "K-1001",
            "first_name": "Anna",
            "last_name": "Müller",
            "email": "[email protected]",
            "country": "AT",
            "birthday": "1985-03-12",
            "revenue": "1234.50",
            "newsletter": true
        },
        "3": {
            "customer_no": "K-1002",
            "first_name": "Jürgen",
            "last_name": "Weiß",
            "email": "[email protected]",
            "country": "DE",
            "birthday": "1979-07-01",
            "revenue": "980.00",
            "newsletter": false
        }
    },
    "errors": {
        "8": {
            "email": "Keine gültige E-Mail-Adresse."
        },
        "9": {
            "birthday": "Bitte ein Datum wie 31.12.2026 oder 2026-12-31 eingeben."
        },
        "10": {
            "customer_no": "Schon in Zeile 3."
        },
        "11": {
            "last_name": "Last name ist ein Pflichtfeld."
        },
        "15": {
            "country": "Nicht in der Liste: Austria, Germany, Switzerland."
        }
    },
    "meta": {
        "encoding": "Windows-1252",
        "delimiter": ";",
        "lineEnding": "CRLF",
        "header": true
    }
}
Code anzeigen
$r = demoImporter()->fromString((string) file_get_contents(__DIR__ . '/../media/kunden.csv'), 'kunden.csv')->result();
echo '<pre class="demo-log">' . htmlspecialchars((string) json_encode([
    'total' => $r['total'], 'valid' => $r['valid'], 'invalid' => $r['invalid'],
    'rows' => array_slice($r['rows'], 0, 2, true),
    'errors' => $r['errors'],
    'meta' => array_intersect_key($r['meta'], array_flip(['encoding', 'delimiter', 'lineEnding', 'header'])),
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE), ENT_QUOTES, 'UTF-8') . '</pre>';

Dates seit 1.120

Two components for time: GridKit\DateRange, a period picker for reports and invoice lists, and GridKit\Calendar, a month view for appointments, deadlines and campaigns. Both work without any script — a select and two date fields that are sent, a table of links. js/calendar.js fills the dates when a preset is chosen, writes the period in words, and makes the month a grid for the keyboard.

A period in a filter bar

In the bar of a TableHeader: choose a preset and the list is asked for it at once; type a date and the select says Custom, then Apply. The page reads the same period with current() (or DateRange::fromRequest()) — checked, in order, within min() and max(), "today" in the page's time zone — and filters its invoices by it.

3. Nov. – 2. Dez. 2026
Filter zurücksetzen
{"from":"2026-11-03","to":"2026-12-02","preset":"last-30-days","invoices":5,"total":"971.00"}
Code anzeigen
$range = (new DateRange('period'))
    ->presets(['today', 'last-7-days', 'last-30-days', 'this-month', 'last-month', 'this-quarter', 'this-year'])
    ->default('last-30-days')
    ->filter()                       // its own GET form and Apply; a preset is sent at once
    ->baseUrl('#dates-filter')
    ->preserve(['lang']);
$period = $range->current();     // ['from' => 'Y-m-d', 'to' => 'Y-m-d', 'preset' => 'last-30-days']

TableHeader::make('invoices')
    ->filter(fn () => $range->render())
    ->reset('?#dates-filter')
    ->render();

$found = array_filter($invoices, fn (array $i): bool => $i['date'] >= $period['from'] && $i['date'] <= $period['to']);
echo '<pre class="demo-log">' . htmlspecialchars(json_encode($period + [
    'invoices' => count($found),
    'total'    => number_format(array_sum(array_column($found, 'amount')), 2, '.', ''),
])) . '</pre>';

In a Form: the field type daterange

The field's options are the picker's; its label names the group, its message line describes it. The form below is sent with GET to this page and shows what it read.

1.–30. Nov. 2026
{"from":"2026-11-01","to":"2026-11-30","preset":"last-month"}
Code anzeigen
$read = DateRange::fromRequest('report', 'last-month', ['max' => date('Y-m-d')]);

(new Form('report-form'))
    ->method('get')
    ->action('#dates-form')
    ->hidden('lang', $lang)
    ->row()
        ->field('report', 'Period', 'daterange', ['width' => 10, 'default' => 'last-month',
            'presets' => ['last-7-days', 'last-30-days', 'this-month', 'last-month', 'last-quarter', 'last-year'],
            'max' => date('Y-m-d'), 'required' => true])
        ->field('group', 'Grouped by', 'select', ['width' => 6, 'native' => true,
            'options' => ['day' => 'Day', 'week' => 'Week', 'month' => 'Month']])
    ->endRow()
    ->values($_GET)
    ->submit('Show report')
    ->render();

echo '<pre class="demo-log">' . htmlspecialchars(json_encode($read)) . '</pre>';

A month of appointments

Click into the month, then ← → ↑ ↓ walk the days, Home and End go to the ends of the week, PgUp and PgDn to the month before and after (the page loads it, the day keeps the focus), Enter chooses the day, Tab reaches its events. A bar runs across the days of the fair and the campaign; a busy day shows three and +3 more, which opens the whole day. Narrower than 600px — on a phone — the month is an agenda.

Choose a day or an event.
Code anzeigen
(new Calendar('appointments'))
    ->label('Appointments')
    ->weekNumbers()
    ->baseUrl('?#dates-calendar')
    ->preserve(['lang'])
    ->dayUrl('#dates-calendar&day={date}')
    ->event($dDay(0) . ' 09:30', 'Team meeting', ['href' => '#dates-calendar', 'color' => 'blue'])
    ->event($dDay(0) . ' 14:00', 'Call with Acme <Ltd>', ['color' => 'green', 'id' => 'call-7'])
    ->event($dDay(2), 'Invoice run', ['color' => 'red', 'allDay' => true])
    ->event(['start' => $dDay(3), 'end' => $dDay(6)], 'Trade fair Vienna', ['color' => 'orange', 'href' => '#dates-calendar'])
    ->event(['start' => $dDay(4), 'end' => $dDay(13)], 'Winter campaign', ['href' => '#dates-calendar'])
    ->event(['start' => $dDay(3), 'end' => $dDay(4)], 'Booth set-up', ['color' => 'gray'])
    ->events([
        ['date' => $dDay(8) . ' 08:00', 'title' => 'Breakfast with the board', 'color' => 'green'],
        ['date' => $dDay(8) . ' 10:00', 'title' => 'Release 1.120', 'color' => 'blue'],
        ['date' => $dDay(8) . ' 11:30', 'title' => 'Dentist'],
        ['date' => $dDay(8) . ' 15:00', 'title' => 'Review of the quarter', 'color' => 'orange'],
        ['date' => $dDay(8) . ' 17:00', 'title' => 'Yoga', 'color' => 'gray'],
        ['date' => $dDay(-3), 'title' => 'Tax deadline', 'color' => 'red'],
        ['date' => $dDay(-9) . ' 16:00', 'title' => 'Workshop: accessible forms'],
        ['date' => $dDay(17), 'title' => 'Offsite', 'color' => 'blue'],
    ])
    ->render();

The same month in a side column: the agenda

The calendar is a size container: in a column narrower than 600px it shows the days that hold something, one under the other — what a phone shows. Weeks start on Monday here, as in German.

Kalender
MontagDienstagMittwochDonnerstagFreitagSamstagSonntag

In diesem Monat ist nichts eingetragen.

Code anzeigen
(new Calendar('agenda'))
    ->weekStart('monday')
    ->baseUrl('?#dates-agenda')
    ->preserve(['lang'])
    ->event($dDay(0) . ' 09:30', 'Team meeting', ['href' => '#dates-agenda', 'color' => 'blue'])
    ->event(['start' => $dDay(3), 'end' => $dDay(6)], 'Trade fair Vienna', ['color' => 'orange'])
    ->event($dDay(8) . ' 10:00', 'Release 1.120', ['color' => 'blue'])
    ->render();

Charts seit 1.121

Revenue per month, open rates, the sources of a site's visits: GridKit\Chart draws line, area, bar and donut charts and sparklines as inline SVG on the server — no library, nothing to wait for. The axis steps by 1, 2 and 5, bars start at zero, numbers are written in the chart's language (1.234,50 €, €1,234.50). Every chart has a summary in words for a screen reader, a legend that names its series and its data as a table. js/chart.js draws it again at the width of its box, shows the values on hover and on the keys (Tab into a chart, then ← →, Home, End, Enter), and switches a series off from its legend.

Bars: two years side by side

Revenue per month
Revenue per monthBalkendiagramm, 12 Kategorien von Jan bis Dec. 2025: von 8.200,00 € bis 16.900,00 €, niedrigster Wert 7.900,00 € (Feb), höchster 16.900,00 € (Dec). 2026: von 9.100,00 € bis 12.200,00 €, niedrigster Wert 8.800,00 € (Feb), höchster 13.800,00 € (Jul).0 €5 Tsd. €10 Tsd. €15 Tsd. €20 Tsd. €JanFebMarAprMayJunJulAugSepOctNovDec
  • 2025
  • 2026
  • Plan
Als Tabelle anzeigen
Revenue per month
Kategorie20252026Plan
Jan8.200,00 €9.100,00 €9.000,00 €
Feb7.900,00 €8.800,00 €9.000,00 €
Mar9.400,00 €10.900,00 €9.500,00 €
Apr10.100,00 €11.600,00 €10.000,00 €
May9.800,00 €12.100,00 €10.500,00 €
Jun11.200,00 €12.900,00 €11.000,00 €
Jul12.500,00 €13.800,00 €11.500,00 €
Aug11.900,00 €13.100,00 €12.000,00 €
Sep10.400,00 €12.200,00 €12.500,00 €
Oct12.800,00 €—13.000,00 €
Nov14.100,00 €—13.500,00 €
Dec16.900,00 €—14.000,00 €
Code anzeigen
(new Chart('demo-revenue'))
    ->type('bar')
    ->title('Revenue per month')
    ->labels(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])
    ->series('2025', [8200, 7900, 9400, 10100, 9800, 11200, 12500, 11900, 10400, 12800, 14100, 16900])
    ->series('2026', [9100, 8800, 10900, 11600, 12100, 12900, 13800, 13100, 12200, null, null, null])
    ->series('Plan', [9000, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 13500, 14000],
        ['hidden' => true])   // starts switched off; the legend switches it on
    ->format('money', ['currency' => 'EUR', 'locale' => 'de'])
    ->height(280)
    ->render();

What the page hears — gk:chartselect (click a bar, or Enter on the keys) and gk:charttoggle (the legend):

Click a bar or a name in the legend.

Lines: open rates, with dashes and point shapes

Newsletter open rate
Newsletter open rateLiniendiagramm, 8 Kategorien von W1 bis W8. Customers: von 41.2% bis 48.9%, niedrigster Wert 39.8% (W3), höchster 48.9% (W8). Trial users: von 28.4% bis 36.5%, niedrigster Wert 28.4% (W1), höchster 37.1% (W7). Partners: von 52% bis 57.4%, niedrigster Wert 49.5% (W2), höchster 57.4% (W8).20%30%40%50%60%W1W2W3W4W5W6W7W8
  • Customers
  • Trial users
  • Partners
Als Tabelle anzeigen
Newsletter open rate
KategorieCustomersTrial usersPartners
W141.2%28.4%52%
W243.5%30.1%49.5%
W339.8%33.6%51.3%
W444.1%31.2%—
W546.3%35.8%54.2%
W645%34.4%55.8%
W747.2%37.1%53.9%
W848.9%36.5%57.4%
Code anzeigen
(new Chart('demo-open-rates'))
    ->type('line')
    ->title('Newsletter open rate')
    ->labels(['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8'])
    ->series('Customers', [41.2, 43.5, 39.8, 44.1, 46.3, 45.0, 47.2, 48.9])
    ->series('Trial users', [28.4, 30.1, 33.6, 31.2, 35.8, 34.4, 37.1, 36.5])
    ->series('Partners', [52.0, 49.5, 51.3, null, 54.2, 55.8, 53.9, 57.4])
    ->format('percent', ['locale' => 'en'])
    ->zero(false)             // the axis starts near the data
    ->markers()               // a point shape per series
    ->dashes()                // a dash pattern per series
    ->render();

Stacked areas: visits by channel

Visits by channel
Visits by channelGestapeltes Flächendiagramm, 7 Kategorien von Mon bis Sun. Search: von 1,820 bis 860, niedrigster Wert 860 (Sun), höchster 2,010 (Wed). Direct: von 640 bis 380, niedrigster Wert 380 (Sun), höchster 720 (Thu). Social: von 310 bis 580, niedrigster Wert 290 (Tue), höchster 620 (Sat). Höchste Summe 3,050 (Wed).01,0002,0003,0004,000MonTueWedThuFriSatSun
  • Search
  • Direct
  • Social
Als Tabelle anzeigen
Visits by channel
KategorieSearchDirectSocialGesamt
Mon1,8206403102,770
Tue1,9407002902,930
Wed2,0106903503,050
Thu1,8907204203,030
Fri1,7606805102,950
Sat9804106202,010
Sun8603805801,820
Code anzeigen
(new Chart('demo-visits'))
    ->type('area')
    ->stacked()
    ->title('Visits by channel')
    ->labels(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'])
    ->series('Search', [1820, 1940, 2010, 1890, 1760, 980, 860])
    ->series('Direct', [640, 700, 690, 720, 680, 410, 380])
    ->series('Social', [310, 290, 350, 420, 510, 620, 580])
    ->format('number', ['locale' => 'en'])
    ->height(240)
    ->render();

Horizontal bars: long names, negative values

Change in visits since last month
Change in visits since last monthBalkendiagramm, 5 Kategorien von /pricing bis /docs/getting-started. Change: von 18.5% bis 9%, niedrigster Wert -12% (/contact), höchster 42% (/blog/how-we-cut-our-invoice-processing-time-in-half).-20%0%20%40%60%/pricing/blog/how-we-cut-our-in…/blog/how-we-cut-our-invoice-processing-time-in-half/features/reports/contact/docs/getting-started
Als Tabelle anzeigen
Change in visits since last month
KategorieChange
/pricing18.5%
/blog/how-we-cut-our-invoice-processing-time-in-half42%
/features/reports-7.5%
/contact-12%
/docs/getting-started9%
Code anzeigen
(new Chart('demo-pages'))
    ->type('bar')
    ->horizontal()
    ->title('Change in visits since last month')
    ->labels(['/pricing', '/blog/how-we-cut-our-invoice-processing-time-in-half', '/features/reports',
              '/contact', '/docs/getting-started'])
    ->series('Change', [18.5, 42.0, -7.5, -12.0, 9.0])
    ->format('percent', ['locale' => 'en'])
    ->height(240)
    ->render();

Donut: parts of a whole

Where the orders came from
Where the orders came fromRingdiagramm, gesamt 3.125: Online shop 1.240 (39,7 %); Marketplace 860 (27,5 %); Phone 410 (13,1 %); Retail partners 380 (12,2 %); Trade fairs 150 (4,8 %); Sonstige 85 (2,7 %).3.125Gesamt
  • Online shop1.240 · 39,7 %
  • Marketplace860 · 27,5 %
  • Phone410 · 13,1 %
  • Retail partners380 · 12,2 %
  • Trade fairs150 · 4,8 %
  • Sonstige85 · 2,7 %
Als Tabelle anzeigen
Where the orders came from
KategorieOrdersAnteil
Online shop1.24039,7 %
Marketplace86027,5 %
Phone41013,1 %
Retail partners38012,2 %
Trade fairs1504,8 %
E-mail601,9 %
Other250,8 %
Gesamt3.125100 %
Code anzeigen
(new Chart('demo-sources'))
    ->type('donut')
    ->title('Where the orders came from')
    ->labels(['Online shop', 'Marketplace', 'Phone', 'Retail partners', 'Trade fairs', 'E-mail', 'Other'])
    ->series('Orders', [1240, 860, 410, 380, 150, 60, 25])   // from the sixth part on: "Other"
    ->format('number', ['locale' => 'de'])
    ->height(220)
    ->render();

Sparklines: in a card and in a table cell

Revenue16.900,00 €+12%Revenue: 12 Werte von 8.200,00 € bis 16.900,00 €, niedrigster 7.900,00 €, höchster 16.900,00 €.
Open rate48,9 %Open rate: 8 Werte von 41,2 % bis 48,9 %, niedrigster 39,8 %, höchster 48,9 %.
ProductSalesLast 7 weeks
Starter412Starter: 7 Werte von 30 bis 44, niedrigster 30, höchster 44.
Business268Business: 7 Werte von 22 bis 26, niedrigster 21, höchster 27.
Enterprise57Enterprise: 7 Werte von 9 bis 5, niedrigster 5, höchster 9.
Code anzeigen
(new StatCards('demo-chart-stats'))
    ->card('Revenue', 16900, ['format' => 'currency', 'icon' => 'euro', 'trend' => '+12%',
        'sparkline' => [8200, 7900, 9400, 10100, 9800, 11200, 12500, 11900, 10400, 12800, 14100, 16900]])
    ->card('Open rate', 48.9, ['format' => 'percent', 'icon' => 'mail',
        'sparkline' => ['values' => [41.2, 43.5, 39.8, 44.1, 46.3, 45.0, 47.2, 48.9], 'color' => 3, 'area' => true]])
    ->render();

(new Table('demo-chart-table'))
    ->setData([
        ['product' => 'Starter', 'sales' => 412, 'trend' => Chart::sparkline([30, 32, 35, 33, 38, 41, 44], ['label' => 'Starter'])],
        ['product' => 'Business', 'sales' => 268, 'trend' => Chart::sparkline([22, 21, 25, 24, 23, 27, 26], ['label' => 'Business', 'color' => 2])],
        ['product' => 'Enterprise', 'sales' => 57, 'trend' => Chart::sparkline([9, 8, 8, 7, 6, 7, 5], ['label' => 'Enterprise', 'color' => 4])],
    ])
    ->column('product', 'Product')
    ->column('sales', 'Sales', ['format' => 'number'])
    ->column('trend', 'Last 7 weeks', ['format' => 'html'])
    ->render();

When the data is thin

No values at all, a single point, nothing but zeros (bars and a donut), and values below zero: each still draws a chart that says what it holds, and never an empty frame.

Sign-ups
Sign-upsKeine DatenKeine Daten
Als Tabelle anzeigen
Sign-ups
KategorieSign-ups
Jan—
Feb—
Mar—
Code anzeigen
(new Chart('demo-empty'))->type('line')->title('Sign-ups')
    ->labels(['Jan', 'Feb', 'Mar'])->series('Sign-ups', [null, null, null])
    ->height(160)->render();
First month
First monthLiniendiagramm, eine Kategorie: Nov. Orders: von 37 bis 37, niedrigster Wert 37 (Nov), höchster 37 (Nov).02040Nov
Als Tabelle anzeigen
First month
KategorieOrders
Nov37
Code anzeigen
(new Chart('demo-one'))->type('line')->title('First month')
    ->labels(['Nov'])->series('Orders', [37])
    ->height(160)->render();
Refunds
RefundsBalkendiagramm, 4 Kategorien von Q1 bis Q4. Refunds: von $0.00 bis $0.00, niedrigster Wert $0.00 (Q1), höchster $0.00 (Q1).$0$0.5$1Q1Q2Q3Q4
Als Tabelle anzeigen
Refunds
KategorieRefunds
Q1$0.00
Q2$0.00
Q3$0.00
Q4$0.00
Code anzeigen
(new Chart('demo-zero'))->type('bar')->title('Refunds')
    ->labels(['Q1', 'Q2', 'Q3', 'Q4'])->series('Refunds', [0, 0, 0, 0])
    ->format('money', ['locale' => 'en', 'currency' => 'USD'])
    ->height(160)->render();
Returns by reason
Returns by reasonRingdiagramm, gesamt 0: Damaged 0 (—); Wrong size 0 (—); Changed mind 0 (—).0Gesamt
  • Damaged0 · —
  • Wrong size0 · —
  • Changed mind0 · —
Als Tabelle anzeigen
Returns by reason
KategorieReturnsAnteil
Damaged0—
Wrong size0—
Changed mind0—
Gesamt0—
Code anzeigen
(new Chart('demo-nothing'))->type('donut')->title('Returns by reason')
    ->labels(['Damaged', 'Wrong size', 'Changed mind'])->series('Returns', [0, 0, 0])
    ->height(140)->render();
Cash flow
Cash flowGestapeltes Balkendiagramm, 4 Kategorien von Q1 bis Q4. In: von 5.200,00 € bis 7.300,00 €, niedrigster Wert 4.800,00 € (Q3), höchster 7.300,00 € (Q4). Out: von -4.100,00 € bis -5.200,00 €, niedrigster Wert -6.900,00 € (Q2), höchster -3.900,00 € (Q3). Höchste Summe 2.100,00 € (Q4).-10 Tsd. €0 €10 Tsd. €Q1Q2Q3Q4
  • In
  • Out
Als Tabelle anzeigen
Cash flow
KategorieInOutGesamt
Q15.200,00 €-4.100,00 €1.100,00 €
Q26.100,00 €-6.900,00 €-800,00 €
Q34.800,00 €-3.900,00 €900,00 €
Q47.300,00 €-5.200,00 €2.100,00 €
Code anzeigen
(new Chart('demo-negative'))->type('bar')->stacked()->title('Cash flow')
    ->labels(['Q1', 'Q2', 'Q3', 'Q4'])
    ->series('In', [5200, 6100, 4800, 7300])
    ->series('Out', [-4100, -6900, -3900, -5200])
    ->format('money', ['locale' => 'de'])
    ->height(160)->render();

Command palette seit 1.122

Type a few letters, jump to a page, a customer, an invoice, or run a command. GridKit\CommandPalette writes a closed dialog; js/command-palette.js opens it with Ctrl+K (⌘+K on a Mac), /, the search button in the header or GK.palette.open(). On this page it knows every section of the sidebar, every heading of the demo, a few commands and the demo's customers and invoices, fetched as you type.

Try it

Type tre for the tree, dark for dark mode, mueller or muller for Müller & Söhne, inv 02 for invoices. The best match comes first: a name that starts with what you typed, then a word that does, then a word that holds it, then its letters in order. ↑ ↓, Home, End, Page Up and Page Down move, Enter opens, Ctrl+Enter opens a link in a new tab, Esc closes and gives the focus back. What you chose comes first next time. slow shows the server thinking, fail a server that failed.

Events appear here.
// The page's palette, built before the header (demo/index.php):
$palette = new CommandPalette('demo');
$palette->item('Toggle dark mode', '', ['icon' => 'dark_mode', 'action' => 'demo-dark', 'keywords' => ['night', 'light', 'theme']])
    ->item('Show a toast', '', ['icon' => 'notifications', 'action' => 'demo-toast', 'keywords' => 'message']);
foreach (['indigo' => 'Indigo', 'ocean' => 'Ocean', 'forest' => 'Forest', 'rose' => 'Rose', 'amber' => 'Amber', 'slate' => 'Slate'] as $key => $name) {
    $palette->item("Theme: $name", '', ['icon' => 'palette', 'group' => 'Themes', 'action' => "demo-theme:$key", 'keywords' => 'colour color']);
}
$palette->item($lang === 'en' ? 'Show the demo in German' : 'Show the demo in English', '?lang=' . ($lang === 'en' ? 'de' : 'en'),
        ['icon' => 'translate', 'group' => 'Links', 'keywords' => ['language', 'deutsch', 'english']])
    ->item('GitHub repository', 'https://github.com/mmollay/gridkit', ['icon' => 'code', 'group' => 'Links', 'hint' => 'github.com/mmollay/gridkit'])
    ->item('The agent skill', '../GRIDKIT_SKILL.md', ['icon' => 'smart_toy', 'group' => 'Links', 'hint' => 'GRIDKIT_SKILL.md', 'keywords' => 'docs documentation'])
    ->item('GridKit home page', '../', ['icon' => 'home', 'group' => 'Links'])
    ->search('api/palette.php', ['minLength' => 2])
    ->slash();
return $palette;

// In the header:
->action($palette->trigger())

// Once, anywhere in <body>:
$palette->render();

Records from the server

search('api/palette.php'): after two letters and a quarter of a second of quiet the palette asks GET api/palette.php?q=… — on the page's own origin, never another — and drops an answer a newer question has overtaken. The answer is the shape GK.search reads, so an endpoint written for it works unchanged. Every label is put in as text.

The endpoint: api/palette.php
<?php
/**
 * Records for the demo's command palette (1.122.0): GET api/palette.php?q=… — customers and invoices.
 *
 * Stateless: the records are written here, nothing is stored. The answer is the shape GK.search reads,
 * which CommandPalette::search() reads too:
 *
 *   { "groups": [ { "title": "Customers", "items": [ { "title", "subtitle", "url", "icon", "amount" } ] } ] }
 *
 * The query arrives as it was typed. It is folded the way the palette folds it — case, accents, and the
 * German umlauts both ways — so "muller", "mueller" and "Müller" find the same customer. Two words on
 * purpose: "fail" answers 500 (the palette says so and offers to ask again), "slow" waits a second
 * and a half (the palette says it is searching; typing on drops the late answer).
 */

declare(strict_types=1);

header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: no-store');

/** Lower case, accents off, ß → ss; with $german the umlauts become ae, oe, ue. No mbstring needed. */
function paletteFold(string $s, bool $german): string
{
    $map = ['ß' => 'ss', 'ẞ' => 'ss', 'æ' => 'ae', 'Æ' => 'ae', 'œ' => 'oe', 'Œ' => 'oe', 'ø' => 'o', 'Ø' => 'o',
        'á' => 'a', 'à' => 'a', 'â' => 'a', 'å' => 'a', 'é' => 'e', 'è' => 'e', 'ê' => 'e', 'ë' => 'e', 'í' => 'i',
        'ì' => 'i', 'î' => 'i', 'ï' => 'i', 'ó' => 'o', 'ò' => 'o', 'ô' => 'o', 'ú' => 'u', 'ù' => 'u', 'û' => 'u',
        'ç' => 'c', 'ñ' => 'n', 'Á' => 'a', 'É' => 'e', 'Í' => 'i', 'Ó' => 'o', 'Ú' => 'u', 'Ç' => 'c', 'Ñ' => 'n'];
    $map += $german
        ? ['ä' => 'ae', 'ö' => 'oe', 'ü' => 'ue', 'Ä' => 'ae', 'Ö' => 'oe', 'Ü' => 'ue']
        : ['ä' => 'a', 'ö' => 'o', 'ü' => 'u', 'Ä' => 'a', 'Ö' => 'o', 'Ü' => 'u'];
    return strtolower(strtr($s, $map));
}

$q = $_GET['q'] ?? '';
$q = is_string($q) ? trim((string) preg_replace('/\s+/u', ' ', $q)) : '';
if (strlen($q) > 100) $q = substr($q, 0, 100);

if (paletteFold($q, false) === 'fail') {
    http_response_code(500);
    echo json_encode(['error' => 'The demo fails on purpose for "fail".']);
    return;
}
if (paletteFold($q, false) === 'slow') usleep(1500000);

$records = [
    'Customers' => [
        ['title' => 'Ecklund & Partner', 'subtitle' => 'Vienna · Customer no. 1042', 'url' => '#palette&record=c1042', 'icon' => 'business'],
        ['title' => 'Müller & Söhne GmbH', 'subtitle' => 'Graz · Customer no. 1050', 'url' => '#palette&record=c1050', 'icon' => 'business'],
        ['title' => 'Bäckerei Groß', 'subtitle' => 'Linz · Customer no. 1061', 'url' => '#palette&record=c1061', 'icon' => 'storefront'],
        ['title' => 'Nordlicht Media', 'subtitle' => 'Salzburg · Customer no. 1088', 'url' => '#palette&record=c1088', 'icon' => 'business'],
        ['title' => 'Café Central KG', 'subtitle' => 'Vienna · Customer no. 1093', 'url' => '#palette&record=c1093', 'icon' => 'local_cafe'],
        ['title' => 'Ørsted Wind Services', 'subtitle' => 'Innsbruck · Customer no. 1120', 'url' => '#palette&record=c1120', 'icon' => 'business'],
    ],
    'Invoices' => [
        ['title' => 'INV-2026-0184', 'subtitle' => 'Ecklund & Partner · Mar 12, 2026', 'amount' => '€1,240.00', 'url' => '#palette&record=i184', 'icon' => 'receipt_long'],
        ['title' => 'INV-2026-0201', 'subtitle' => 'Nordlicht Media · Mar 28, 2026', 'amount' => '€890.50', 'url' => '#palette&record=i201', 'icon' => 'receipt_long'],
        ['title' => 'INV-2026-0207', 'subtitle' => 'Müller & Söhne GmbH · Apr 2, 2026', 'amount' => '€4,312.80', 'url' => '#palette&record=i207', 'icon' => 'receipt_long'],
        ['title' => 'INV-2026-0215', 'subtitle' => 'Bäckerei Groß · Apr 9, 2026', 'amount' => '€96.00', 'url' => '#palette&record=i215', 'icon' => 'receipt_long'],
    ],
];

$groups = [];
if ($q !== '') {
    $needles = array_unique([paletteFold($q, false), paletteFold($q, true)]);
    foreach ($records as $title => $items) {
        $found = array_values(array_filter($items, static function (array $r) use ($needles): bool {
            $text = $r['title'] . ' ' . $r['subtitle'];
            foreach ([paletteFold($text, false), paletteFold($text, true)] as $hay) {
                foreach ($needles as $n) {
                    if (str_contains($hay, $n)) return true;
                }
            }
            return false;
        }));
        if ($found) $groups[] = ['title' => $title, 'items' => $found];
    }
}

echo json_encode(['groups' => $groups], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);

Entries from a script

The headings of this demo are registered by the script below with GK.palette.register(), asked again each time the palette opens; choosing one fires gk:paletteaction, and the page scrolls to it. The commands of the page answer the same event.

The script of this page
document.addEventListener('DOMContentLoaded', function () {
    // Every heading of the demo, under the name of its section.
    GK.palette.register({
        group: 'Demo headings',
        items: function () {
            return Array.prototype.map.call(document.querySelectorAll('.demo-section h3'), function (h) {
                var section = h.closest('.demo-section').getAttribute('data-section');
                var link = document.querySelector('.gk-sidebar a[href="#' + section + '"] .gk-sidebar-label');
                return { label: h.textContent, hint: link ? link.textContent : section, icon: 'short_text',
                         action: 'demo-heading', heading: h, section: section };
            }).filter(function (e) { return e.label.trim() !== ''; });
        }
    });

    document.addEventListener('gk:paletteaction', function (e) {
        var action = e.detail.action;
        if (action === 'demo-heading') {
            var h = e.detail.item.data.heading;
            if (location.hash.split('&')[0] !== '#' + e.detail.item.data.section) location.hash = '#' + e.detail.item.data.section;
            setTimeout(function () {
                window.scrollTo({ top: h.getBoundingClientRect().top + window.scrollY - 80 });
                h.setAttribute('tabindex', '-1');
                h.focus({ preventScroll: true });
            }, 30);
        } else if (action === 'demo-dark') {
            GK.theme.toggleMode();
        } else if (action.indexOf('demo-theme:') === 0) {
            GK.theme.set(action.slice(11));
        } else if (action === 'demo-toast') {
            GK.toast.success('Hello from the command palette.');
        }
    });

    // What the page hears, in the log above.
    var log = document.getElementById('demo-palette-log');
    var lines = [];
    ['gk:paletteopen', 'gk:paletteselect', 'gk:paletteaction'].forEach(function (name) {
        document.addEventListener(name, function (e) {
            var d = e.detail, what = d.source || (d.item ? d.item.label + (d.newTab ? ' (new tab)' : '') : '');
            if (d.action) what += ' → ' + d.action;
            lines.unshift(name + '  ' + what);
            log.textContent = lines.slice(0, 6).join('\n');
        });
    });
    document.getElementById('demo-palette-inv').addEventListener('click', function () { GK.palette.open('inv'); });
});

What a screen reader and a phone get

A modal dialog that keeps the focus — Tab goes round inside it — and gives it back when it closes; the field is a combobox, the list a listbox in groups named by their headings, and the entry you are on is aria-activedescendant. Once the list has settled, a live region says how many results there are, or that there are none, or that the server failed. On a phone the palette covers the screen and nothing scrolls sideways; the trigger is its symbol. Without script the trigger is hidden — or, with fallback('/search'), a plain link to a search page.

Filter builder seit 1.123

Conditions a person combines freely: Status is any of Open, Overdue AND Amount > 500, or a group of OR conditions inside. GridKit\FilterBuilder writes a plain form that works without script — nested fieldsets, submit buttons that add, duplicate and remove; js/filter-builder.js makes the same form instant and sends the state as compact JSON in one parameter (?f=["and",…]). The page reads it with FilterBuilder::fromRequest() or ->tree(), checked against the fields, and queries with FilterBuilder::toSql() (placeholders only) or filters rows in memory with FilterBuilder::matches().

Invoices, filtered

Filter

Gezeigt: Status ist eines von Open, Overdue UND Amount > 500,00

10 of 24 invoices

InvoiceCustomerStatusAmountDueTagsReminded
INV-2026-0182Café Crèmeoverdue755,00 €reverse—
INV-2026-0184Nordlicht Mediaopen1.428,50 €—
INV-2026-0186Ecklund & Partneroverdue2.102,00 €vip—
INV-2026-0190Nordlicht Mediaoverdue1.050,50 €—
INV-2026-0192Ecklund & Partneropen1.724,00 €vip, reverse—
INV-2026-0194Café Crèmeoverdue2.399,00 €—
INV-2026-0196Nordlicht Mediaopen672,50 €—
INV-2026-0198Ecklund & Partneroverdue1.346,00 €vip—
INV-2026-0200Café Crèmeopen2.021,00 €—
INV-2026-0204Ecklund & Partneropen968,00 €vip—

The same filter as SQL

FilterBuilder::toSql($tree, $fields, $columnMap): column names only from the page's map (or the field key), every value a placeholder. Text is compared with LIKE ? ESCAPE '!', a date column may hold times, a multiselect is the page's own callable — here a tag table.

WHERE (status IN (?, ?) AND i.total > ?)

params: ["open","overdue",500]
$fb = (new FilterBuilder('f'))
    ->field('status', 'Status', ['type' => 'select', 'options' => $statuses])
    ->field('amount', 'Amount', ['type' => 'money'])
    ->field('customer', 'Customer')
    ->field('due', 'Due', ['type' => 'date'])
    ->field('tags', 'Tags', ['type' => 'multiselect', 'options' => $tags])
    ->field('reminded', 'Reminded', ['type' => 'bool'])
    ->views($savedViews)          // the page stores them
    ->localViews();               // and this browser too

$tree = $fb->tree();              // checked: unknown fields, operators, values left out
['sql' => $where, 'params' => $params] = FilterBuilder::toSql($tree, $fb, ['amount' => 'i.total', 'tags' => $tagCallable]);
// or, in memory:
$rows = array_filter($rows, fn ($r) => FilterBuilder::matches($tree, $r, $fb));
$fb->render();

A mistake, a group, the limit

What comes back from Apply with a value missing: the condition stays in the form, is marked and said in words — not by the red alone — and is not applied. A group joins its conditions the other way (OR inside AND); maxRows(3) is reached, so “Condition”, “Group” and duplicate are disabled and the limit is said.

Filter
  1. Bitte beide Werte eingeben.

  2. Gruppe 2
Höchstens 3 Bedingungen.

1 Bedingung ist unvollständig und nicht angewendet.

Gezeigt: (Status ist Open ODER Customer enthält „eck“)

Nothing yet, views kept in this browser

No conditions: every row is shown, and the builder says so. localViews() keeps a saved view in localStorage when the page has no saveUrl(); each one comes with a button that removes it.

People filter

Keine Bedingungen: alle Zeilen werden gezeigt. Unten eine hinzufügen.

Gezeigt: alle Zeilen, keine Bedingungen

Events and the API

Apply fires gk:filterchange (cancelable — a page can filter live instead of loading), Save view gk:filtersave; here the views are kept in this browser. GK.filterBuilder.get('f'), set(), reset(), json() and summary() reach it from a script.

Events appear here.

Kanban seit 1.124

Columns with cards for tasks, orders, campaigns and support tickets. GridKit\Kanban writes a labelled region of columns — a heading, a count and a list of cards — that works without any script: every card is in view, and a card that may move has a small Move form that posts. js/kanban.js adds dragging with the mouse or a finger, moving with the keyboard, counts and limits that follow every move, and a save to a URL that gives the card back when the server says no.

Support tickets: saved to a URL, limits that refuse

Drag a card by its handle (or, with a mouse, by the card itself) into another column; held at the edge, the board scrolls. With the keyboard: Tab to a handle, Space lifts the card, ↑ ↓ move it in its column, ← → to the next column, Home and End to the ends, Space puts it down, Esc cancels — every step is spoken. In progress takes three cards (wipLimits('block')): a fourth is refused. Every move is posted to api/kanban-move.php, which refuses one on purpose: Refund for order 1043 cannot go to Done, so it goes back and a toast says why. Password policy is locked ('draggable' => false).

New

3 Karten

Not looked at yet

  • Since this morning nobody can print; the queue shows 14 jobs.

    • Hardware
    • Office
    3Zugewiesen an Anna Huber
    Verschieben: Printer on floor 2 offline
    • Purchase
    Zugewiesen an Ben Ortner
    Verschieben: New laptop for Jonas
  • Verschieben: VPN drops every hour
Karte hinzufügen zu New

In progress

3 Karten, Limit 3
  • Zugewiesen an Clara Wimmer
    Verschieben: Refund for order 1043
    • Mail
    Verschieben: Mail signature for the sales team
  • 7Zugewiesen an Ben Ortner
    Verschieben: Backup restore test
Karte hinzufügen zu In progress

Review

1 Karte, Limit 4
Karte hinzufügen zu Review

Done

1 Karte
  • Zugewiesen an Anna Huber
    Verschieben: Wi-Fi in the meeting room
Karte hinzufügen zu Done
Code anzeigen
$tickets = [
    ['id' => 'T-101', 'subject' => 'Printer on floor 2 offline', 'status' => 'new', 'priority' => ['High', 'red'],
     'body' => 'Since this morning nobody can print; the queue shows 14 jobs.', 'owner' => 'Anna Huber',
     'due' => date('Y-m-d', strtotime('-2 days')), 'tags' => ['Hardware', ['Office', 'blue']], 'comments' => 3],
    ['id' => 'T-102', 'subject' => 'New laptop for Jonas', 'status' => 'new', 'owner' => 'Ben Ortner',
     'due' => date('Y-m-d'), 'tags' => ['Purchase']],
    ['id' => 'T-103', 'subject' => 'VPN drops every hour', 'status' => 'new', 'priority' => 'Normal',
     'due' => date('Y-m-d', strtotime('+9 days'))],
    ['id' => 'T-104', 'subject' => 'Refund for order 1043', 'status' => 'doing', 'priority' => ['Billing', 'orange'], 'owner' => 'Clara Wimmer'],
    ['id' => 'T-105', 'subject' => 'Mail signature for the sales team', 'status' => 'doing', 'tags' => [['Mail', 'green']]],
    ['id' => 'T-106', 'subject' => 'Backup restore test', 'status' => 'doing', 'owner' => 'Ben Ortner', 'comments' => 7],
    ['id' => 'T-107', 'subject' => 'Password policy', 'status' => 'review', 'priority' => 'Locked', 'locked' => true,
     'body' => 'Waits for the auditor; it stays where it is.'],
    ['id' => 'T-108', 'subject' => 'Wi-Fi in the meeting room', 'status' => 'done', 'owner' => 'Anna Huber'],
];
foreach ($tickets as &$t) {
    $t['href'] = '#kanban-ticket-' . $t['id'];
    $t['draggable'] = empty($t['locked']);
}
unset($t);

(new Kanban('demo-tickets'))
    ->label('Support tickets')
    ->column('new', 'New', ['color' => 'blue', 'description' => 'Not looked at yet'])
    ->column('doing', 'In progress', ['color' => 'orange', 'limit' => 3])
    ->column('review', 'Review', ['limit' => 4])
    ->column('done', 'Done', ['color' => 'green'])
    ->cards($tickets, ['title' => 'subject', 'column' => 'status', 'text' => 'body', 'badge' => 'priority',
        'assignee' => 'owner', 'labels' => 'tags', 'count' => 'comments'])
    ->moveUrl('api/kanban-move.php', ['headers' => ['X-CSRF-Token' => 'demo-token'], 'fields' => ['_token' => 'demo-token']])
    ->wipLimits('block')
    ->addUrl('#kanban-new-{column}')
    ->render();
Events appear here.
The endpoint: api/kanban-move.php
<?php
/**
 * The move endpoint of the demo's ticket board (GridKit\Kanban::moveUrl(), 1.124.0).
 *
 * js/kanban.js posts every move as JSON {"id", "column", "index"} — index counted from 0 among the
 * cards of the new column — with the headers given to moveUrl(). Without the script the card's
 * "Move to" form posts id and column (and the hidden fields of moveUrl()) as a plain form.
 * Kanban::readMove() reads either. A 2xx is saved unless the JSON says {"ok": false}; anything else
 * puts the card back, and "message" is what the person reads.
 *
 * The demo stores nothing (a reload shows the board as it was) and refuses one move on purpose, so
 * the way back can be seen: a refund ticket is closed by accounting, never from the board.
 */

declare(strict_types=1);

require __DIR__ . '/../../autoload.php';

use GridKit\Kanban;

$move = Kanban::readMove();
$form = $move !== null ? $move['form'] : !str_contains(strtolower((string) ($_SERVER['CONTENT_TYPE'] ?? '')), 'json');

// After a form, back to the page (the board shows what the server holds); after JSON, JSON.
$answer = static function (int $status, array $body) use ($form): never {
    if ($form) {
        $back = (string) ($_SERVER['HTTP_REFERER'] ?? '../index.php');
        $back = preg_replace('/[?#].*$/', '', $back) . '?kanban=' . ($body['ok'] ? 'saved' : 'refused') . '#kanban';
        header('Location: ' . $back, true, 303);
        exit;
    }
    http_response_code($status);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($body, JSON_UNESCAPED_UNICODE);
    exit;
};

if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
    $answer(405, ['ok' => false, 'message' => 'Moves are posted.']);
}
// The token the page gave moveUrl(): in a header from the script, in a hidden field from the form.
// A real application compares it with the session's.
$token = $form ? (string) ($_POST['_token'] ?? '') : (string) ($_SERVER['HTTP_X_CSRF_TOKEN'] ?? '');
if ($token !== 'demo-token') {
    $answer(403, ['ok' => false, 'message' => 'The page is out of date. Reload it and try again.']);
}
if ($move === null) {
    $answer(400, ['ok' => false, 'message' => 'The move could not be read.']);
}
$columns = ['new', 'doing', 'review', 'done'];
if (!in_array($move['column'], $columns, true)) {
    $answer(422, ['ok' => false, 'message' => 'The board has no such column.']);
}
// The server checks the limits too: the page can be old, or another person faster.
// (A real board counts the column in its database; the demo trusts the page.)

if ($move['id'] === 'T-104' && $move['column'] === 'done') {
    $answer(409, ['ok' => false, 'message' => 'A refund is closed by accounting, not on the board — the ticket went back.']);
}

usleep(250000);
$answer(200, ['ok' => true]);

Campaigns: compact, moved without a URL, a limit that warns

movable() without moveUrl(): the board fires the cancelable gk:kanbanmove and the page decides. compact() leaves a card's text out and sets the cards closer. Live has a limit of one and the default 'warn': it holds two campaigns and says it is over its limit — move one on, and the mark goes. This page refuses to end a campaign that has not run — try Black Friday to Ended.

Ideas

1 Karte
  • Spring newsletter
    • Mail

Planned

2 Karten
  • Black Friday
    • Shop
  • Christmas vouchers
    • Shop

Live

2 Karten, Limit 1Über dem Limit
  • Autumn sale
    Zugewiesen an Clara Wimmer
  • Loyalty points
    • App

Paused

0 Karten

    No campaigns

    Ended

    1 Karte
    • Summer sale
    Code anzeigen
    (new Kanban('demo-campaigns'))
        ->label('Campaigns')
        ->compact()
        ->movable()
        ->column('idea', 'Ideas')
        ->column('planned', 'Planned', ['color' => 'blue'])
        ->column('live', 'Live', ['color' => 'green', 'limit' => 1])
        ->column('paused', 'Paused', ['color' => 'red'])
        ->column('ended', 'Ended', ['color' => 'gray'])
        ->card('c-spring', 'Spring newsletter', 'idea', ['labels' => ['Mail']])
        ->card('c-bf', 'Black Friday', 'planned', ['due' => date('Y') . '-11-27', 'labels' => [['Shop', 'orange']]])
        ->card('c-xmas', 'Christmas vouchers', 'planned', ['labels' => ['Shop']])
        ->card('c-autumn', 'Autumn sale', 'live', ['assignee' => 'Clara Wimmer'])
        ->card('c-loyalty', 'Loyalty points', 'live', ['labels' => [['App', 'blue']]])
        ->card('c-summer', 'Summer sale', 'ended')
        ->empty('No campaigns')
        ->render();

    Heatmap seit 1.137 Neu in 1.137

    Rows × columns, the colour is the value: when posts get the most views, which pages are read on which days. GridKit\Heatmap writes a real table — a header cell per row and column, every cell spoken in words by its title and aria-label — so the colour is never the only way to read a figure. Five steps are mixed from the design tokens (light, dark and the six themes follow). It is markup and CSS only: no script.

    Views in the first 24 hours, by weekday and hour

    Most hours hold nothing, so they are hatched and read "No data". A cell with 'weak' => true keeps its number but is dotted and left out of the scale — two posts say little, and one lucky post would flatten everything else. counts() writes the number of observations under the figure. Narrower than the table, it scrolls inside its own frame (Tab reaches the frame, arrow keys scroll it); the row headers stay.

    Median views in the first 24 hours after posting, by weekday and hour
    060708091011121314151617181920212223
    Mon––––––410n = 6–––––520n = 5–––––
    Tue––––––380n = 4–––––610n = 6–––––
    Wed––––––450n = 5–––––480n = 3–––––
    Thu––––––330n = 4–––––700n = 5–––––
    Fri––––––290n = 3–––––560n = 4–––––
    Sat––––––240n = 2–––––880n = 1–––––
    Sun–––150n = 1––180n = 3–––––350n = 4–––––
    Skala: 180700 viewsZu wenig DatenKeine Daten
    Code anzeigen
    $days = ['mon' => 'Mon', 'tue' => 'Tue', 'wed' => 'Wed', 'thu' => 'Thu', 'fri' => 'Fri', 'sat' => 'Sat', 'sun' => 'Sun'];
    $hours = [];
    for ($h = 6; $h <= 23; $h++) $hours[sprintf('%02d', $h)] = sprintf('%02d', $h);
    
    // [weekday, hour, median of the views, posts behind it]
    $posts = [
        ['mon', '12', 410, 6], ['mon', '18', 520, 5], ['tue', '12', 380, 4], ['tue', '18', 610, 6],
        ['wed', '12', 450, 5], ['wed', '18', 480, 3], ['thu', '12', 330, 4], ['thu', '18', 700, 5],
        ['fri', '12', 290, 3], ['fri', '18', 560, 4], ['sat', '12', 240, 2], ['sat', '18', 880, 1],
        ['sun', '09', 150, 1], ['sun', '12', 180, 3], ['sun', '18', 350, 4],
    ];
    
    $map = (new Heatmap('demo-times'))
        ->label('Median views in the first 24 hours after posting, by weekday and hour')
        ->rows($days)
        ->cols($hours)
        ->unit('views')
        ->counts();
    foreach ($posts as [$day, $hour, $median, $n]) {
        $map->cell($day, $hour, $median, ['count' => $n, 'weak' => $n < 3]);
    }
    $map->render();

    Every cell filled, a fixed scale, decimals

    scale(0, 10) fixes the ends so two heatmaps read alike; values beyond them take the end steps. decimals(1) sets the places, and title lets a cell say it its own way.

    Average time on page in minutes, by page and week
    W1W2W3W4W5W6
    Home0,05,30,55,81,06,3
    Pricing3,70,06,42,79,15,4
    Docs7,44,812,49,77,14,5
    Blog1,09,68,16,65,13,6
    Contact4,74,33,93,53,12,7
    Skala: 0,010,0 min
    Code anzeigen
    $pages = ['Home', 'Pricing', 'Docs', 'Blog', 'Contact'];
    $weeks = ['W1', 'W2', 'W3', 'W4', 'W5', 'W6'];
    $map = (new Heatmap('demo-pages'))
        ->label('Average time on page in minutes, by page and week')
        ->rows($pages)
        ->cols($weeks)
        ->unit('min')
        ->scale(0, 10)
        ->decimals(1);
    foreach ($pages as $r => $page) {
        foreach ($weeks as $c => $week) {
            if ($page === 'Docs' && $week === 'W3') continue;   // set below with its own words
            $minutes = (($r * 37 + $c * 53 + $r * $c * 11) % 101) / 10;
            $map->cell($page, $week, $minutes);
        }
    }
    $map->cell('Docs', 'W3', 12.4, ['title' => 'Docs, W3: 12.4 min — a conference link sent readers here']);
    $map->render();

    File manager seit 1.125

    A media library and a drawer for receipts. GridKit\FileManager draws folders, a breadcrumb, thumbnails or a list, a search, a filter by type, the order, the selection with its actions and a details panel — from rows the page hands it; it never reads a directory and never deletes or moves a file itself: it posts to the page's URLs. js/file-manager.js uploads many files at once with a progress bar each, takes files dropped on the manager and pictures pasted with Ctrl+V, and puts what the server took into the listing without a reload. On the server, FileManager::receive() checks every upload by what it holds, not by what the browser says.

    A media library: folders, upload, actions

    Choose, drop or paste files: each one is checked here first (type, size, at most ten at once), then sent — three at the same time — to api/files.php, which checks it again with receive() and stores nothing: a picture comes back as a data URL so it can be shown. Try a file larger than 5 MB, a .docx, or a text file renamed to .png. Click a name for the details (on a phone they cover the screen); tick files for Move and Delete — Framework contract cannot be deleted, so a refusal can be seen. Keys in the listing: ← → ↑ ↓, Home, End, Space ticks, Shift+arrow ticks a range, Ctrl+A all, Enter opens the details, Delete deletes, Esc lets go.

    Neuer Ordner
    Dateien hierher ziehen, ein Bild einfügen, oderBilder, PDF, CSV und TXT, bis 5 MB je Datei, 10 Dateien auf einmal.
    0 ausgewählt

    8 Dateien · 3 Ordner

    Code anzeigen
    $folders = [
        ['id' => 'receipts', 'name' => 'Receipts', 'parent' => null, 'count' => 2],
        ['id' => 'receipts-2026', 'name' => '2026', 'parent' => 'receipts', 'count' => 4],
        ['id' => 'receipts-2025', 'name' => '2025', 'parent' => 'receipts', 'count' => 1],
        ['id' => 'marketing', 'name' => 'Marketing', 'parent' => null, 'count' => 2],
        ['id' => 'photos', 'name' => 'Photos', 'parent' => null, 'count' => 3],
    ];
    (new FileManager('demo-media'))
        ->label('Media')
        ->folders($folders)
        ->files(demoFiles(), ['name' => 'filename', 'size' => 'bytes', 'mime' => 'type', 'modified' => 'changed', 'thumbUrl' => 'thumb'])
        ->param('media')->anchor('files')            // ?media[folder]=photos#files — links that work without script
        ->fromQuery()                                // folder, view, sort, type, search, details from the request
        ->uploadUrl('api/files.php')
        ->accept(['image/*', 'application/pdf', 'text/csv', '.csv', '.txt'])
        ->maxSize('5M')->maxFiles(10)
        ->actions(['delete' => 'api/files.php', 'move' => 'api/files.php', 'rename' => 'api/files.php',
                   'folder' => 'api/files.php', 'download' => true])
        ->csrf('demo-token')
        ->render();
    Events appear here.

    Pick one receipt: a list, single selection

    select('single') and view('list'), newest first, no upload and no actions: a drawer to choose a receipt from for a booking. The choice posts ids[] with a form, and the page hears gk:filesselect.

    1 ausgewählt

    5 Dateien

    Code anzeigen
    $receipts = array_values(array_filter(demoFiles(), fn (array $f): bool => str_starts_with((string) $f['folder'], 'receipts')));
    (new FileManager('demo-receipts'))
        ->label('Receipts')
        ->files($receipts, ['name' => 'filename', 'size' => 'bytes', 'mime' => 'type', 'modified' => 'changed', 'thumbUrl' => 'thumb'])
        ->param('receipts')->anchor('files')
        ->select('single')->selected(['f-r2'])
        ->view('list')->sort('date', 'desc')
        ->render();

    The server side: receive()

    What arrives in $_FILES is the visitor's: the name, the type and the size are claims. FileManager::receive(), given the manager's rules() and a directory to store in, takes only a file PHP received in this request, reads its real size and its type from its content, wants the name's extension to fit that type, refuses names with .php anywhere in them, PHP code in any file, page markup in a picture, an SVG with script, and a picture so large in pixels that opening it would eat the server's memory — and stores what passes under a random name of its own, outside the web root unless told otherwise. This demo's endpoint is below; it moves nothing.

    The endpoint: api/files.php
    <?php
    /**
     * The endpoint of the demo's file manager (GridKit\FileManager, 1.125.0). It STORES NOTHING: this is a
     * public site, and an endpoint that keeps what it is handed is a file drop for the whole internet.
     *
     *   GET  ?picture=<n>   one of the demo's sample pictures, drawn here (an SVG without script, served with a
     *                       Content-Security-Policy that would stop one anyway)
     *   POST files[]        an upload: checked by FileManager::receive() with the manager's rules() — the type by
     *                       its content, the name, the size, the dimensions — and answered as js/file-manager.js
     *                       expects: {"ok":true,"file":{…}} or {"ok":false,"message":"…"}. A picture comes back
     *                       as a data: URL so the listing can show it; nothing is moved anywhere, and PHP removes
     *                       its temporary file when this request ends.
     *   POST action=…       delete, move, rename, folder: answered as if done, and nothing is changed.
     *
     * Without the script the forms post here as plain forms, and the answer is a short page that says what the
     * server would have done, with a link back.
     */
    
    declare(strict_types=1);
    
    require_once __DIR__ . '/../../autoload.php';
    
    use GridKit\{FileManager, Lang};
    
    $lang = $_GET['lang'] ?? $_COOKIE['gk_lang'] ?? 'en';
    Lang::set(in_array($lang, ['en', 'de'], true) ? $lang : 'en');
    
    // ── A sample picture ────────────────────────────────────────────────────────
    if (isset($_GET['picture'])) {
        $n = max(0, min(99, (int) $_GET['picture']));
        $hue = ($n * 47) % 360;
        $hue2 = ($hue + 38) % 360;
        header('Content-Type: image/svg+xml; charset=utf-8');
        header("Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox");
        header('X-Content-Type-Options: nosniff');
        header('Cache-Control: public, max-age=86400');
        printf('<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="800" viewBox="0 0 1200 800">'
            . '<defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="hsl(%d 58%% 66%%)"/>'
            . '<stop offset="1" stop-color="hsl(%d 54%% 40%%)"/></linearGradient></defs>'
            . '<rect width="1200" height="800" fill="url(#g)"/><circle cx="860" cy="230" r="170" fill="#fff" opacity=".18"/>'
            . '<path d="M0 640 L300 420 L520 600 L760 380 L1200 700 L1200 800 L0 800Z" fill="#000" opacity=".16"/></svg>', $hue, $hue2);
        exit;
    }
    
    $ajax = ($_SERVER['HTTP_X_REQUESTED_WITH'] ?? '') === 'XMLHttpRequest';
    $e = static fn (string $s): string => htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
    
    /** The answer: JSON for the script, a short page for a plain form. */
    $answer = static function (int $status, array $body) use ($ajax, $e): never {
        http_response_code($status);
        header('Cache-Control: no-store');
        if ($ajax) {
            header('Content-Type: application/json; charset=utf-8');
            echo json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_SUBSTITUTE);
            exit;
        }
        header('Content-Type: text/html; charset=utf-8');
        $lines = $body['lines'] ?? [(string) ($body['message'] ?? '')];
        echo '<!DOCTYPE html><html lang="' . $e(Lang::locale()) . '"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">'
            . '<meta name="robots" content="noindex"><title>File manager — GridKit Demo</title>'
            . '<style>body{font:15px/1.5 system-ui,sans-serif;max-width:720px;margin:32px auto;padding:0 16px}li{margin:4px 0}</style></head><body>'
            . '<p><a href="../#files">← Back to the demo</a></p><h1>' . $e($body['ok'] ?? false ? 'Checked' : 'Not taken') . '</h1><ul>';
        foreach ($lines as $line) echo '<li>' . $e((string) $line) . '</li>';
        echo '</ul><p>The demo stores nothing. In your application this is where the file is moved (out of the web root) and recorded.</p></body></html>';
        exit;
    };
    
    if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
        $answer(405, ['ok' => false, 'message' => 'This address takes uploads and actions as POST.']);
    }
    // Larger than post_max_size: PHP dropped the whole request, the token too.
    if ($_POST === [] && $_FILES === [] && (int) ($_SERVER['CONTENT_LENGTH'] ?? 0) > 0) {
        $answer(413, ['ok' => false, 'message' => 'The upload is larger than this server takes.']);
    }
    // The token the page gave csrf(). A real application compares it with the one in its session (hash_equals).
    if (!hash_equals('demo-token', (string) ($_POST['_token'] ?? $_SERVER['HTTP_X_CSRF_TOKEN'] ?? ''))) {
        $answer(403, ['ok' => false, 'message' => 'The page is out of date. Reload it and try again.']);
    }
    
    // ── An upload ───────────────────────────────────────────────────────────────
    if (isset($_FILES['files'])) {
        // The same rules the browser was told: the manager of the page, built the same way.
        $rules = ['accept' => ['image/*', 'application/pdf', 'text/csv', '.csv', '.txt'], 'maxSize' => 5 * 1024 * 1024, 'maxFiles' => 10];
        $results = FileManager::receive($_FILES['files'], $rules);   // no target directory: nothing is moved anywhere
        if ($results === []) {
            $answer(400, ['ok' => false, 'message' => Lang::t('files.err_no_file')]);
        }
        if (!$ajax) {
            $answer(200, ['ok' => true, 'lines' => array_map(static fn (array $r): string => (string) $r['message'], $results)]);
        }
        $r = $results[0];
        if (!$r['ok']) {
            $answer(422, ['ok' => false, 'message' => $r['message']]);
        }
        $file = [
            'id'       => 'up-' . substr((string) $r['sha256'], 0, 12),
            'name'     => $r['name'],
            'size'     => $r['size'],
            'mime'     => $r['mime'],
            'modified' => time(),
            'folder'   => is_string($_POST['folder'] ?? null) && $_POST['folder'] !== '' ? $_POST['folder'] : null,
            'width'    => $r['width'],
            'height'   => $r['height'],
        ];
        // A small raster picture travels back as a data: URL, so the listing shows it — nothing is kept here.
        if (in_array($r['mime'], ['image/png', 'image/jpeg', 'image/gif', 'image/webp'], true) && $r['size'] <= 400 * 1024) {
            $file['url'] = 'data:' . $r['mime'] . ';base64,' . base64_encode((string) file_get_contents((string) $r['tmp']));
        }
        $answer(200, ['ok' => true, 'file' => $file]);
    }
    
    // ── An action ───────────────────────────────────────────────────────────────
    $action = is_string($_POST['action'] ?? null) ? $_POST['action'] : '';
    $ids = array_values(array_filter((array) ($_POST['ids'] ?? []), 'is_string'));
    $name = is_string($_POST['name'] ?? null) ? trim($_POST['name']) : '';
    switch ($action) {
        case 'delete':
        case 'move':
            if ($ids === []) $answer(400, ['ok' => false, 'message' => Lang::t('files.none_selected')]);
            if ($action === 'delete' && in_array('f-contract', $ids, true)) {
                // Refused on purpose, so the way a refusal looks can be seen.
                $answer(409, ['ok' => false, 'message' => 'The contract is kept for ten years and cannot be deleted. Nothing was deleted.']);
            }
            $answer(200, ['ok' => true, 'lines' => [count($ids) . ' files would be ' . ($action === 'delete' ? 'deleted.' : 'moved.')]]);
        case 'rename':
            if (count($ids) !== 1 || $name === '' || mb_strlen($name) > 255 || preg_match('~[/\\\\\x00-\x1f]~', $name)) {
                $answer(422, ['ok' => false, 'message' => 'That name cannot be used.']);
            }
            $answer(200, ['ok' => true, 'file' => ['id' => $ids[0], 'name' => $name], 'lines' => ["Renamed to $name."]]);
        case 'folder':
            if ($name === '' || mb_strlen($name) > 120 || preg_match('~[/\\\\\x00-\x1f]~', $name)) {
                $answer(422, ['ok' => false, 'message' => 'That name cannot be used for a folder.']);
            }
            $answer(200, ['ok' => true, 'folder' => ['id' => 'new-' . bin2hex(random_bytes(4)), 'name' => $name], 'lines' => ["Folder $name would be created."]]);
        case 'download':
            $answer(200, ['ok' => true, 'lines' => [count($ids) . ' files would be sent as a ZIP archive.']]);
    }
    $answer(400, ['ok' => false, 'message' => 'Unknown action.']);
    

    Changelog

    Neu & geändert nach Komponente

    Jede Komponente, die in den letzten Versionen dazukam oder sich geändert hat — die neueste zuerst.

    KomponenteWasVersionIn der Demo
    HeatmapNeu1.137.0Heatmap
    Loading statesUpdate1.135.0Navigation
    TableHeaderUpdate1.134.0Navigation
    Image pickerUpdate1.133.0Gallery
    1.138.0]2026-12-02
    > Built as 1.136.0 on the branch `tabelle/sortierung-merken`; numbered 1.138.0 once the Heatmap (1.137.0) had reached main. A table now remembers how you sorted it. Click a header, leave the page, come back tomorrow: the same column in the same direction is there again. One helper, `GK.sortMemory`, serves all four kinds of sortable table; what is kept is the column and the direction — never the search, never a filter. Added · **`GK.sortMemory`** — one helper for every kind of sortable table: a static `setData()` table (the browser sorts), a server-driven table (`rows()`, `gk_sort` / `gk_dir`), a live table and a `SortLink` list (the address sorts). It is on by itself, no call and no option needed. · What is kept: `{"col": …, "dir": "asc|desc"}` under the key `gk-sort:<path>:<table>`, per user (the same namespace as the theme, `window.GK_THEME_SCOPE`), per page and per table. A click on a header writes it. Without a scope the memory is per browser. · A live table and a `SortLink` list have no id of their own; they are told apart by their sort parameter (`link:sort`, `link:b_sort`, …), so two lists on one page do not share a sort. · **Restoring:** a page that arrives without a sort in its address gets the kept one — a static table sorts itself while it is built; a server-driven table asks once for the kept sort (`reload`, no page load); a live table and a `SortLink` list load the same address with the sort once (`location.replace`, so the Back button does not return to the unsorted page). The address always wins: a sort in it is shown and the kept one stays as it was. A column the table no longer has is dropped from the memory. · **No endless redirect:** the redirect is made once. A server that answers `?sort=` with a redirect that drops the parameter is noticed (one note per page in `sessionStorage`, 10 s) and left alone. `GK.navigate` (the sidebar's page change) restores the lists of the new page too — with a second load: the page is fetched and swapped in first, then `location.replace` loads the same address again with the sort. A server-driven table does not (its rows are one request). · **Switch off for one table:** `data-gk-sort-merken="aus"` on the table, its container or any ancestor — nothing is read, nothing is written there. · A locked or full `localStorage` (a private window, blocked site data) costs nothing: every access sits in a `try`, the table works as before. Added (after the review of this version) · **The way back (third click):** a click on a header that shows "descending" leads back to the table's own order and forgets the kept sort — ascending, descending, off. A static table sorts itself unsorted; a server-driven table asks with an empty `gk_sort` (`gk_sort=` in the address). `SortLink` does the same when the address carries the sort of that column and the column is descending: the link is `?…&sort=` — an empty sort and no direction. A list that is sorted only by its own default (nothing in the address) keeps the old toggle: there is nothing to go back from. · **An empty sort marker always wins:** an address with `sort=` (or `gk_sort=`, or the list's own parameter, empty) is shown in the default order and forgets the kept sort, like a click on the way back. · **"Reset filters" is not undone:** a page that is the answer of a redirect from the same page — that carried a sort of its own — to an address without it (the Panel's invoice list: `…?sort=amount&dir=desc` → `…?year=2026`) shows the server's order and forgets the kept sort, instead of putting the sort straight back (`_dropped`). No code on the server's side is needed. It reads the referrer: a page that sends none (`Referrer-Policy: no-referrer`) cannot be told, there the sort comes back as before. A redirect from another page (a save, then the list) restores as before. · **A message is not lost:** a page that shows a message — `.gk-toast`, `[data-gk-flash]`, `[role="alert"]`, with text — is not loaded again for the sort (a "saved" toast after a form). The decision is made after the `DOMContentLoaded` handlers of the page, because a toast is written by a script of the page after `GK.init`; after a `GK.navigate` swap it is made at once. The sort in the address is then not put back on that page; the kept sort stays and comes back on the next visit. Server-driven tables are not affected (they ask for rows, the page stays). Fixed (after the review of this version) · **No circle without `sessionStorage`:** a throwing `sessionStorage` used to mean "go anyway" — a server that drops the sort would then be asked again and again. Now no restore by `location.replace` happens without it (fail safe). Static and server-driven tables need no `sessionStorage` and still restore. · **Two server-driven tables on one page:** a refresh of the first table asked with the sort the second one had left in the address (`gk_sort` is one parameter for the page, `gk_table` names the table it came from). A table that asks without a sort of its own while the address carries another table's sort now sends the one it shows; on load an address sort of another table is not this table's. Still shared on the server: `Table` reads `gk_sort`, `gk_dir`, `gk_page` and `gk_search` for every table of a page — a first full load of an address from the second table's click shows both tables in that order until each restores its own kept sort; a table without one stays as the address gave it. Changed · `SortLink` writes `data-gk-sort-param` and `data-gk-dir-param` on the link — only when the parameter names are not the usual `sort` and `dir`. The standard markup is unchanged. The script needs the names to tell the lists of one page apart. · A static table no longer reads or writes its old key `gk-sort-<id>`; the sorts saved under it are not carried over (one-off: a table starts unsorted once). · Unchanged: `aria-sort`, paging, search, the column toggle and the Back button (`_gkBack`). Tests · `tests/sortierung-merken.test.php` (14 checks: one helper, key with user, page and table, only column and direction, `try` everywhere, unknown column dropped, switch-off, the address wins, capture listener, all kinds go through the helper, SortLink markup, version, changelog, skill, demo). · `ci/browser-sortierung-merken.js` with `ci/browser-sortierung-merken-fixture.php` (Playwright, 89 checks): per kind sort → reload → another page → sidebar → `aria-sort`; the address wins in a second tab; a second user sees nothing; an unknown column is dropped; a throwing `localStorage` and `sessionStorage`; the loop server; the switch-off; all four kinds on one page with at most two loads and only column and direction stored; no script errors. · After the review: `tests/sortierung-merken.test.php` (eight further tests, red before the change) and `ci/browser-sortierung-merken.js` (155 checks in all): the way back for every kind, the empty marker, the reset redirect and the redirect from another page, the message (direct and after a `GK.navigate`), no `sessionStorage`, two server-driven tables. Demo · Table, "Sort memory": says what is kept and how to switch it off; sort the table there, reload the page.
    1.137.0]2026-12-02
    `GridKit\Heatmap` is rows × columns with the colour as the value — weekdays by hours, pages by days — a real table with five steps taken from the design tokens, every cell spoken in words, and cells with no data or too little data marked as such. The SSI Panel's send calendar for videos is the first to use it ("When does it run best?"); every other system can too. Added · **`GridKit\Heatmap`** (`src/Heatmap.php`, `new Heatmap($id)`, `render()` prints, `html()` returns). `->rows($rows)` and `->cols($cols)` (a list of labels, or `key => label`), `->cell($row, $col, $value, $opts)` (a number, a numeric string, or `null` for no data), `->unit()`, `->label()`, `->scale($min, $max)`, `->decimals()`, `->counts()`, `->legend()`. Cell options: `title` (the words the cell speaks), `count` (observations behind the value), `weak` (too few to trust). Misuse — a row or column that was never declared, a value that is no number, an unknown option, a duplicate — is an `E_USER_WARNING` and the heatmap still renders. · **A real table**: `<caption>`, a `<th scope="col">` per column and a `<th scope="row">` per row; every cell carries its words in `title` and `aria-label` ("Monday, 12:00: 480 views, n = 7"), and its figure is written in the cell, so the colour is never the only way to read a value. No script: markup and CSS. · **Five steps** (`gk-heat-s1` … `gk-heat-s5`) mixed from `--gk-primary` and `--gk-surface` (`--gk-heat-1` … `-5`, each with its text colour `--gk-heat-on-1` … `-5`), so light, `[data-gk-mode="dark"]`, `.gk-dark` and the six themes follow; the scale runs from the smallest to the largest value of the cells that are not weak (or `scale()`). A cell with **no data** is hatched with a dash and says "No data"; a **weak** cell keeps its number on a neutral ground in a dotted frame, says "Too little data" and is left out of the scale. The legend shows the ramp with both ends in figures and names only the kinds of cell the grid holds. · **Narrow screens**: the table scrolls inside `.gk-heat-scroll`, a named region with a tab stop; the row headers stay in place (`position: sticky`); the page never scrolls sideways. Forced colours get a frame instead of a fill. · Numbers follow the page's language (`1.234,5` in German); `heatmap.*` words in `lang/en.php` and `lang/de.php`. · 20 classes in block "Heatmap" of `css/blocks.json`: `gk-heat`, `gk-heat-scroll`, `gk-heat-grid`, `gk-heat-colhead`, `gk-heat-rowhead`, `gk-heat-cell`, `gk-heat-s1`, `gk-heat-s2`, `gk-heat-s3`, `gk-heat-s4`, `gk-heat-s5`, `gk-heat-empty`, `gk-heat-weak`, `gk-heat-value`, `gk-heat-count`, `gk-heat-legend`, `gk-heat-key`, `gk-heat-ramp`, `gk-heat-swatch`, `gk-heat-end`; demo section "Heatmap" (two grids: weekday × hour with gaps and weak cells, and a fixed scale); a "Heatmap" section in `GRIDKIT_SKILL.md`; `tests/heatmap.test.php`; `ci/browser-heatmap.js` (contrast of every step in 21 looks, the scroll at 390px) with its fixture. · README, landing page and the counting tests say thirty components.
    1.135.1]2026-12-01
    In the SSI Panel video list the like rate stood as "15,6" on one line and "%" on the next. The column is right-aligned but renders HTML, and only `number` and `currency` columns got `gk-nowrap` from their format — every other right-aligned cell wrapped wherever the column ran out of room. Fixed · **Table:** a right-aligned column (`align => 'right'`) gives its cells `gk-nowrap`, in `Table::renderCell` and in the browser's rebuild alike — a right-aligned cell holds a figure (a number with its unit, an amount, a duration), and a figure on two lines reads as two values. `'nowrap' => false` lets such a column wrap. The header still wraps. Deliberately not a CSS rule on `td.gk-text-right`: hand-written tables in the SSI Panel use that class for running text (an invoice footer, a monitoring table) and would have run off the side at 390 px (review). Test: `render/a right-aligned cell keeps a figure with its unit`; the recorded `table/column-options` markup gains the class on its right-aligned column.
    1.135.0]2026-11-30
    A click on a link in the SSI Panel gave no sign at all until the next page arrived — on a slow page (1 s and more on the server) it looked as if nothing had happened, and people clicked again. GridKit had a bar once (removed in 1.5.6, "a bar that never ends") and the panel removed its own copy in July for the same reason: it started on every submit, also on forms a page sends itself. This one starts only where the browser really leaves the page, and it is always reset. Added · **`GK.pageProgress`** — switches itself on, no call needed. A click on a link to the same origin, or the submit of a form, shows a 3px bar at the top at once (brand colour, `--gk-primary`; dark mode follows). The clicked link or button gets `aria-busy="true"` and `.gk-page-pending` (dimmed, progress cursor); the main area (`[data-gk-content]`, else `main`) gets `aria-busy="true"`; a polite live region says "Loading page …" (`js.page_loading`, en/de). · It does **not** start for: Ctrl/Cmd/Shift/Alt or a middle click, `target="_blank"` (or any other target, `formtarget` too), `download`, a jump within the page (`#anchor`, also with the page's own path), `javascript:`, another origin, a file by its extension (pdf, zip, csv, xlsx, docx, images, …) or a path segment like `/download` or `/export`, `method="dialog"`, a click or submit a page has already handled (`defaultPrevented`, checked after every listener has run), and anything inside `[data-gk-ohne-lade]` or `[data-gk-no-progress]`. · It is reset by `pageshow` (back and forward, also from the bfcache), by Escape and by the next click that does not navigate. When a page hangs, the bar slows down and stays near 92 % after 15 s — no dialog, nothing that blocks. · `GK.navigate` (the sidebar's page change without a reload) uses the same bar: `createProgress()`, `showProgress()` and `hideProgress()` stay as thin wrappers. On an error it now hands over to a full page load without taking the bar down first. · CSS: `.gk-page-progress` (`data-gk-state="running"` / `"done"`), `@keyframes gk-page-progress`, `.gk-page-pending`. With `prefers-reduced-motion: reduce` the bar stands still at full width. · After review (before release): downloads behind ordinary addresses no longer leave the bar hanging — a last segment `datei` or `file`, and a query `dl=1`, `laden=1`, `herunterladen=1` or `download=1` count as a file. A bare `href="#"` (a pager, a search hit without a target) counts as a jump within the page: `new URL('#').hash` is empty, so the attribute decides. A safety net: after `GK.pageProgress.limit` ms (20 000) without a page change the bar and every `aria-busy` go quietly — a 204, the Stop button, a cancelled "Leave this page?". A form sent without a button (Enter) is only `aria-busy`, not dimmed. The announcement survives a missing catalogue. Demo · Navigation, "Page loading bar": a link that loads the page, one with `data-gk-ohne-lade`, and a button that shows the bar. Tests · `tests/page-progress.test.php`: the texts in en/de, the fixed bar that never catches a click, running/done, reduced motion, the self-start, the pageshow reset, the opt-out attribute, `GK.navigate` on the same bar, the file segments and queries, the 20 s net. · The behaviour in a browser is held by the consumer: SSI Panel `tests/browser/ladeanzeige.js` (40 cases, also `href="#"`, `?dl=1`, `/datei?herunterladen=1`, `/file`, the time limit and a form without a button; among them every "does not start" case above, the back button, dark mode contrast and 390px). ---
    1.134.0]2026-11-30
    The SSI Panel builds every list as one card — search on the left, filters as selects, the main button on the right of the toolbar — and GridKit had three gaps exactly there: `newButton()` could only open a modal (a "New invoice" that is a page stood in the page header above the card), there was no room on the right for an Import or a bulk send, and the toolbar of a `TableHeader` had no place for a button at all and rounded nothing. Additions only: without the new options every toolbar is byte for byte what it was. Added · **`newButton()` as a link** (`Table`): `'href' => '/path'` makes the main button a real link (`<a>`; middle click works). The target goes through the same check as the buttons of a row (`safeTarget()`): `javascript:`, `data:` and `//host` are refused with a warning and the button stays without a target. `'id'` and `'data' => ['name' => 'value']` are for a page that handles the click itself (no `onclick`); a name that cannot be written safely is left out with a warning. `'modal'` still wins over `'href'`; both together is a warning. · **`Table::toolbarButton($label, $opts)`**: as often as you like — a side button on the right, behind the spacer and before the main button, in the order of the calls. Always an outlined, neutral pill (no colour, no class). Options `icon`, `href`, `id`, `data`, `modal`, `title`. With side buttons and no main button the spacer is still written once. The CSV, column and density buttons stay in front of the spacer. · **`TableHeader::action($html)`**: as often as you like — HTML on the right of the toolbar, behind the spacer and the reset button (the spacer is written once). A toolbar with actions also carries `gk-tableheader-has-actions`. · CSS: the filled, outlined and tonal buttons of `.gk-tableheader-toolbar` are pills, as in `.gk-toolbar`. The buttons behind the spacer (`.gk-toolbar > .gk-toolbar-spacer ~ .gk-btn`, and the same in a header toolbar) are at least `--gk-target-min` tall where a finger taps (`pointer: coarse`, or up to 600px) — this also lifts the existing main button of a `Table` from 38 to 44px there. On a phone (≤ 768px) the actions of a header begin a row of their own and a filled one runs across it. The padding of `.gk-tableheader-toolbar` stays (10px 12px; a `.gk-toolbar` has 16px): matching it would move every header toolbar by 12px in height. Demo · Table, "Complete table with all features": `toolbarButton('Import')` beside the "New Article" button, which is a link (`'href'`). TableHeader: an `action()`. Docs · `GRIDKIT_SKILL.md` (`newButton` options, `toolbarButton`, `TableHeader::action`), `skill/` (generated). Tests · `tests/table-toolbar-buttons.test.php`: the link, the refused targets, `id`/`data` and hostile names, modal before href, the fixed look of a side button, the order, one spacer, everything escaped, no toolbar no buttons, the pills in the header stylesheet. · `tests/tableheader-action.test.php`: action on the right, with and without `reset()`, one spacer, the order, the old markup byte for byte, the phone rules. · `ci/browser-werkzeugzeile.js` (+ fixture): at 1440, 1280 and 390px, light and dark — the toolbar of the demo table is one row, the main button at the right edge with the side button left of it, header and table toolbars alike; at 390px nothing scrolls sideways, the main button has the full width, the buttons are 44px tall. ---
    1.133.0]2026-11-22
    An image picker's action that cannot be done right now said nothing: the SSI Panel's customer pressed the bin on an image that is still used on another page, and the answer appeared somewhere below the gallery — "the delete does not work". Now the tile says why before anyone tries, and a try gets an answer. Added · **Locked picker action** (`ImagePicker`, `GK.picker.tileHtml`): an action with `'locked' => 'reason'` gets `aria-disabled="true"` (not `disabled` — it stays focusable and clickable), `aria-describedby` pointing at a visible line `.gk-picker-lock` under the caption (lock icon + the reason) and the reason as its tooltip. PHP and script write the same markup. · `gk:pickeraction` carries `detail.locked`: the reason, or `""` for a free action. The library still decides nothing. · `GK.picker.lock(tile, name, reason)`: locks an action or changes its reason; `null`/`""` unlocks and gives back exactly the free tile. Answers `false` when the tile has no such action. · `GK.confirm(message, { info: true })`: a notice with one button (no cancel) — for explaining, not asking. · CSS: `.gk-picker-action[aria-disabled="true"]` (dimmed, `cursor: help`), `.gk-picker-lock`. Demo · Gallery, "Image picker — six images": the sixth tile's remove button is locked; a click opens the notice. Docs · `GRIDKIT_SKILL.md` (image picker: `locked`, `GK.picker.lock`, `detail.locked`; `GK.confirm` `info`), `skill/` (generated). Tests · `tests/picker.test.php`: a locked action is `aria-disabled`, not `disabled`, its reason the visible, escaped description in the tile with a lock; a free action has none; the CSS and the event field are there. · `ci/browser-picker.js` P13: PHP markup, a click and Enter/Space still fire the event with `detail.locked`, script markup equals PHP, `GK.picker.lock` on/changed/off/unknown, the one-button notice. ---
    1.132.0]2026-11-19
    A switch between two drawings of one list. The SSI Panel draws its ideas as a table and as cards and needs the person to choose; until now every page that wanted this wrote the same twenty lines of script (hide one block, show the other, press the button, remember it). Now it is markup. Added · **View toggle** (`js/gridkit.js`, block "1.132.0 — view toggle"): a `.gk-segmented` with `data-gk-view-toggle="<id>"` and buttons `data-gk-set-view="<name>"` chooses between `[data-gk-view="<name>"]` blocks inside `[data-gk-view-scope="<id>"]`. The chosen block is shown, the others get `hidden`; the pressed button gets `aria-pressed="true"`; the scope names the drawing in `data-gk-view-active`. · The choice is remembered in the browser under `gk-view-<id>` (in the namespace of `GK.theme`, so the next person at a shared computer does not inherit it). Start: stored, else `data-gk-view-default`, else the first button; a stored name no button knows is ignored. Every storage access is wrapped: without storage the toggle still switches, for this page view. · Scopes with the same id switch together; a person's choice fires `gk:viewchange` (`detail: { id, view }`, bubbling) on each scope. · `GK.view.init(root)` shows the stored choice in content that arrives later (`GK.initContent` calls it; a page that swaps a scope itself calls it on the new element), `GK.view.get(id)`, `GK.view.set(id, name)`. · No PHP class: the toggle is the existing `.gk-segmented`, the state is the `hidden` attribute. One zero-weight rule, `:where([data-gk-view])[hidden]`, makes it hide even a block of the page that sets its own `display` (the rule for every `gk-` class does the same for GridKit blocks). The server writes the default drawing visible and the others `hidden`, the toggle `hidden`: a page without the script shows the default and offers no dead switch. Demo · Tabs, "View toggle": a table and cards with the switch. Docs · `GRIDKIT_SKILL.md` ("View toggle" under the segmented button), `skill/reference/components.md` (generated), `SPEC.md`. Tests · `tests/view-toggle.test.php`: the block is one closed function after the density block, every storage access is in a try, the first pass and later content are hooked, the state is the attributes (no style, no class), the documentation and the demo show the markup. · `ci/browser-view.js` (fixture `ci/browser-view-fixture.php`): defaults, a click, the keyboard (Enter, Tab, Space; the outline), two scopes of one id, a reload, a stored name no button knows, storage that throws, `GK.initContent`, a scope without a toggle, 390 px without sideways scroll, the page without the script. Counter-checks: nine one-line breaks of the block, each turns it red. ---
    1.131.0]2026-11-16
    The video frame in landscape. `.gk-video-frame` has been 9:16 only: the SSI Panel put a 16:9 video (its approval dialog "Video freigeben", a recording of a survival day) into a narrow portrait box with black bars on both sides (Martin, 16.11.2026: "das ist ja ein Video, aber hier sehe ich eine Short-Vorschau"). The Panel had a local override for its page; the dialog had none. Added · **`.gk-video-frame-landscape`** — a second class on the `<figure>` makes the same frame 16:9. The box is `aspect-ratio: 16 / 9`; the width comes from the same height limit, `min(100%, calc(var(--gk-video-frame-max-h) * 16 / 9))`: as wide as the column until the limit bites (75 % of the window, or the page's own `--gk-video-frame-max-h`), then it keeps its shape. · Everything else is the frame's own and not repeated: the picture lies in the box and is shown whole (a portrait file in a landscape frame is not cut), caption, busy, failed, the limit variable. The safe zones are drawn for a portrait short; a landscape video has no use for them. · Weight: one class on the figure and the box inside `:where()` (one class), both after the 9:16 rules they change — a rule of a page with one class still wins, as for every GridKit rule a page may want to override (`css/blocks.json`: the class since 1.131.0, the block "changed"). Demo · Gallery, "Portrait video frame": a paragraph and two landscape frames (a picture, the busy state); `demo/media/sample-landscape.svg`. Docs · `GRIDKIT_SKILL.md`, `skill/reference/components.md`, `skill/reference/css.md`, `SPEC.md`: the variant. Tests · video-frame: "the landscape variant is 16:9 and takes its width from the same height limit" (the two declarations and nothing more, the weight, the order in the file) and "keeps everything else of the frame" (exactly two rules, the height limit stays on the box). · ci/browser-timeline-video.js, V09–V13: 16:9 at every width and window height (the limit bites at 400 px: 300 × 533), a column of 300 and 150 px, the picture whole in the box (a portrait file and a portrait picture), busy and failed unchanged, a rule of a page with one class wins on the figure and on the box, a phone (360 and 320 px): no sideways scroll. V06 now expects the pulse of two busy frames. ---

    Pfeil auf und ab wechseln zwischen den Ergebnissen, Eingabe öffnet eines, Steuerung und Eingabe öffnet einen Link in einem neuen Tab, Escape schließt.