Skip to content

Interface: SvgTileLayoutProps ​

Extends ​

  • Omit<SVGProps<SVGSVGElement>, "children" | "fill" | "stroke" | "strokeWidth">

Properties ​

backdrop? ​

ts
optional backdrop?: string;

One image across all the cells (a URL), cropped to cover the layout and clipped to the cells. The default cell rendering then skips fill; per-cell images go on top.


background? ​

ts
optional background?: string;

Color painted across the whole region, behind the cells.


choose? ​

ts
optional choose?: "placement" | "shape";

With imageAspects: "shape" also picks which cells get images by their shape.


containWithin? ​

ts
optional containWithin?: "tile" | "visible";

With imageFit: "contain", for cells an edges: "window" layout cuts: fit the image in the whole tile ("tile", the default) or in the part that shows ("visible").


contentCells? ​

ts
optional contentCells?: ContentCells;

Which cells may hold an image from the images array: "all" (default), "whole" or a test.


fill? ​

ts
optional fill?: FillSource;

Cell color under (or instead of) images. Defaults to defaultPalette.


fit? ​

ts
optional fit?: FitProp;

Size the tiles to the images array (counted by contentCells): true/"atLeast" or "nearest". Ignored with layout, repeatImages or an images function.


imageAlts? ​

ts
optional imageAlts?: readonly string[];

Text alternative per image in images: those cells become labeled images; the rest decoration.


imageAspects? ​

ts
optional imageAspects?: readonly number[];

Width / height of each image, to put images in cells of similar shape (see matchSlots).


imageFit? ​

ts
optional imageFit?: "cover" | "contain";

"cover" (default) fills each cell's bounding box, cropped to its shape; "contain" shows each image whole inside the cell's safe area (see safeArea), at its imageAspects shape.


imageFocus? ​

ts
optional imageFocus?: readonly (Focus | undefined)[];

Focal point of each image (by position; fractions of its width and height, see estimateFocus), kept in view when "cover" crops it (see coverRect). Needs each image's shape, from imageAspects or the focus's aspect.


images? ​

ts
optional images?: ImageSource;

imageWeights? ​

ts
optional imageWeights?: readonly number[];

How many tiles each image in images spans (1 for most): heavier images get featured tiles where they fall in reading order (see weightedLayout). Needs options.


layout? ​

ts
optional layout?: Layout;

options? ​

ts
optional options?: LayoutOptions;

Layout options; or pass a precomputed layout instead.


placement? ​

ts
optional placement?: ContentPlacement;

Where images go when there are fewer than cells: "reading" (default), "center" or "spread".


relief? ​

ts
optional relief?: boolean | ReliefOptions;

Raised tiles: a lit bevel over each cell, and optionally a shadow cast into the grout. true for the defaults. See ReliefOptions. Drawn over renderCell content too.


renderCell? ​

ts
optional renderCell?: (cell, ctx) => ReactNode;

Replace the default cell rendering with SVG content. Rendered inside a <g> per cell.

Parameters ​

ParameterType
cellCell
ctxSvgCellRenderContext

Returns ​

ReactNode


repeatImages? ​

ts
optional repeatImages?: boolean;

stroke? ​

ts
optional stroke?: string;

strokeWidth? ​

ts
optional strokeWidth?: number;

title? ​

ts
optional title?: string;

Accessible title.

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).