Interface: TileLayoutConfig
Properties
animate?
optional animate?:
| boolean
| {
duration?: number;
easing?: string;
};Animate layout and content changes. true for 400 ms, or { duration, easing }.
aspects?
optional aspects?: readonly number[];Width / height of each item, to put items in tiles of similar shape (see matchSlots).
backdrop?
optional backdrop?: Node | (() => Node);One picture across all the tiles: a node copied into every tile (or a function making a fresh one per tile), sized to the whole layout so each tile shows its piece.
background?
optional background?: string;Color painted across the whole region, visible through the gaps.
cellAttributes?
optional cellAttributes?: PerCell<Record<string, string | undefined> | undefined>;Extra attributes for each tile element (part, title, …).
cellClass?
optional cellClass?: PerCell<string | undefined>;Class for each tile element.
cellLabel?
optional cellLabel?: PerCell<string | undefined>;Accessible name for each tile.
cellStyle?
optional cellStyle?: PerCell<StyleMap | undefined>;Extra style for each tile element: camelCase or custom (--x) properties.
choose?
optional choose?: "placement" | "shape";With aspects: "shape" also picks which tiles hold items by their shape.
className?
optional className?: string;Class for the layout element.
contentCells?
optional contentCells?: ContentCells;Which tiles may hold content: "all" (default), "whole" (not cut by the outline) or a test.
fallback?
optional fallback?: PerCell<TileContent>;Content for empty tiles.
fill?
optional fill?: FillSource;Color of empty tiles: a color, a palette or a function per cell. Defaults to neutralPalette.
fit?
optional fit?: FitProp;Size the tiles to the items: true/"atLeast" or "nearest". Ignored with layout or renderCell.
focalPoints?
optional focalPoints?: readonly (Focus | undefined)[];Focal point of each item (fractions of its width and height; see estimateFocus): what a photo keeps in view as its tile crops it. Each tile sets --andamento-object-position, which coverStyle uses; exact when the photo's shape is known (aspects, or the focus's aspect).
focusRing?
optional focusRing?: string | false;Focus ring color, or false for none. Defaults to "#1a56db".
items?
optional items?: readonly TileContent[];The content: each item fills one tile, in reading order, clipped to the tile's shape. Nodes are moved into their tiles (and kept there as the layout changes), so pass the same node again to keep its state.
label?
optional label?: string;Accessible name of the layout (its aria-label).
layout?
optional layout?: Layout;navigable?
optional navigable?: boolean;Arrow-key navigation over the tiles with content, as one tab stop.
onCellActivate?
optional onCellActivate?: (cell, state) => void;Called when a tile with content is clicked, or Enter / Space pressed on it (with navigable).
Parameters
| Parameter | Type |
|---|---|
cell | Cell |
state | CellState |
Returns
void
options?
optional options?: LayoutOptions;Layout options; or pass a precomputed layout instead.
placement?
optional placement?: ContentPlacement;Where items go when there are fewer than tiles: "reading" (default), "center" or "spread".
relief?
optional relief?: boolean | ReliefOptions;Raised tiles: a lit bevel and optional shadow. true for the defaults.
renderCell?
optional renderCell?: (cell, state) => TileContent;Alternative to items: each tile's content from its cell, worked out on every render. Return the same node again to keep it. slot numbers the cells allowed by contentCells.
Parameters
| Parameter | Type |
|---|---|
cell | Cell |
state | { slot: number; } |
state.slot | number |
Returns
role?
optional role?: string;Role of the layout element: "list" (default; tiles with content are list items) or another.
safeArea?
optional safeArea?: SafeAreaProp;Put each tile's content in the tile's safe area, not its bounding box (see safeArea). For tiles an edges: "window" layout cuts, true or "tile" fits the whole tile and "visible" the part that shows.
virtualize?
optional virtualize?:
| boolean
| {
overscan?: number;
};Only put tiles in view (plus overscan pixels, default 300) in the DOM.
weights?
optional weights?: readonly number[];How many tiles each item spans (1 for an ordinary item; rounded): heavier items get a featured tile of that many merged tiles, where they fall in reading order (see weightedLayout). With fit, the tiles are sized to fit everything. Needs options.