Skip to content

Fit: clip

A container with a fixed size and the fit clip. The content keeps its size, and the renderer cuts it at the edge.

Edit it

Fit: clipPlayground →
Fit: clip: the layoutviewportitem-1item-2item-3item-4item-5item-6item-7item-8item-9

10 boxes, 0 edges. The audit finds no defect.

The input

The same layout in TypeScript. The input is plain data, so it can come from JSON.

fit-clip.ts
import { layout } from "ireko";
const input = {
"root": {
"id": "viewport",
"mode": "nested",
"fit": "clip",
"size": {
"width": 300,
"height": 140
},
"children": [
{
"id": "item-1"
},
{
"id": "item-2"
},
{
"id": "item-3"
},
{
"id": "item-4"
},
{
"id": "item-5"
},
{
"id": "item-6"
},
{
"id": "item-7"
},
{
"id": "item-8"
},
{
"id": "item-9"
}
]
}
};
const result = layout(input);