OGE logoOGE

Tile Layout

oge-tile-layout arranges tiles on a CSS grid — a dashboard of figures, a launchpad, a personal start page — with column and row spans, drag to reorder, resize handles and a serializable layout.

No APG pattern exists, so the tiles are a labelled list of focusable role="group" tiles (aria-roledescription="tile") sharing one roving tab stop. Every drag has a keyboard twin: Ctrl+arrows move the focused tile, Ctrl+Shift+arrows resize it (horizontal arrows mirror in RTL), and each change is announced in the shared live region.

dashboard drag to reorder resize keyboard twins serializable state RTL

Dashboard & spans

Tiles take a colSpan and a rowSpan on a columns-wide grid; grid-auto-flow: dense back-fills the holes a wide tile leaves. The host is an inline-size container, so below 480px of its own width the layout collapses to one column instead of overflowing.

items columns colSpan rowSpan rowHeight
Revenue
€ 48,210+12% on last week
Orders
1,284+4% on last week
Visitors
23,915−2% on last week
Traffic sources
61% search24% direct · 15% social
Conversion
3.4%Goal 3.0%
Refunds
180.9% of orders
Open tickets
427 waiting for a reply
Press Control and an arrow key to move the tile, Control, Shift and an arrow key to resize it.

Reorder by drag & keyboard

Drag a tile by its header (touch drags start at once — the header is a dedicated handle), or focus a tile and press Ctrl+arrows. Both run the same commit, so reordering (cancelable) → reordered → layoutChanged fire identically, focus stays on the moved tile and the new position is announced. Escape cancels a drag.

reorderable reordering reordered Ctrl+Arrow
Revenue
€ 48,210
Orders
1,284
Visitors
23,915
Traffic sources
61% search
Conversion
3.4%
Refunds
18
Open tickets
42
Press Control and an arrow key to move the tile, Control, Shift and an arrow key to resize it.

Drag a header or press Ctrl+Arrow on a tile.

Resizing tiles

resizable adds a corner handle (pointer only, aria-hidden) whose drag snaps to whole tracks with a live preview; Ctrl+Shift+arrows are the keyboard twin. Spans stay inside each tile's bounds, 'horizontal' / 'vertical' lock an axis, and the cancelable resizing event here vetoes anything taller than three rows.

resizable minColSpan / maxColSpan resizing resized
Revenue
2 × 1
Orders
1 × 1
Traffic sources
1 × 1
Open tickets
1 × 1
Press Control and an arrow key to move the tile, Control, Shift and an arrow key to resize it.

Drag a corner or press Ctrl+Shift+Arrow.

Persisted layout state

[(state)] is the serializable layout — { version: 1, tiles: [{ key, order, colSpan, rowSpan }] }. Persist it from layoutChanged; hand it back through applyState(), which validates it first (persisted state is untrusted input), ignores keys it does not know and places new tiles after the saved ones.

state layoutChanged applyState() sanitize
Revenue
revenue
Orders
orders
Visitors
visitors
Traffic sources
traffic
Press Control and an arrow key to move the tile, Control, Shift and an arrow key to resize it.
Move or resize a tile to save the layout.

Declarative tiles & templates

Tiles can be declared as <oge-tile-layout-item> children (merged before items): projected content becomes the body, an element marked ogeTileLayoutItemHeader replaces the title. Controls in a header stay real buttons — pressing one never starts a drag — and content inside a tile keeps its own place in the Tab order.

oge-tile-layout-item ogeTileLayoutItemHeader rowHeight: auto
Welcome

Drag the headers or use Ctrl+Arrow keys to arrange the board.

Notes

3 notes pinned

Press Control and an arrow key to move the tile, Control, Shift and an arrow key to resize it.