このページの翻訳はまだありません。英語版を表示しています。

Size<T>

type Size<T> = { height: T; width: T; };

Generic size type with width and height.

A two-dimensional container for width and height values. The type parameter T determines what kind of values are stored.

Example

import type { Size, Dimension, AvailableSpace } from "taffy-layout"; // Size with explicit type parameters const pixelSize: Size<number> = { width: 200, height: 100 }; const dimensionSize: Size<Dimension> = { width: 200, height: "50%", }; const availableSize: Size<AvailableSpace> = { width: 800, height: "max-content", };

Type Parameters

Type ParameterDescription
TThe type of each dimension (e.g., number, Dimension, AvailableSpace)

Properties

PropertyTypeDescription
heightTThe vertical dimension value
widthTThe horizontal dimension value

© 2026 ByteLand Technology Limited