Size Component

Overflow-safe dynamic sizes, input-proportional sizes, and floating overlay sizes — supplementing Tailwind's width / height utilities.

Overflow-safe sizes

Dynamic width / height capped at 100% so the element never overflows its parent.

w-safe-* — dynamic width

Fixed w-safe-96:

w-safe-96

Fixed-in-length w-safe-[40rem]:

w-safe-[40rem]

Narrow parent — capped at 100%:

capped

h-safe-* — dynamic height

h-safe-48:

h-safe-48

h-safe-[4rem]:

4rem

size-safe-* — dynamic width + height

size-safe-24:

24

size-safe-[20rem]:

20rem

Input-based sizes

Dimensions derived from the default input metrics (--default-width-input / --default-height-input), capped at 100%.

w-input / w-input-* — width

w-input (default input width):

w-input

w-input-2 (2x):

w-input-2

w-input-3 (3x):

w-input-3

h-input / h-input-* — height

h-input:

h-input

h-input-2:

h-input-2

Overlay sizes

Floating layer dimensions relative to the parent, keeping safe gaps.

w-overlay — full-width layer

w-overlay

h-overlay — full-height layer

h-overlay

size-overlay — full-width + full-height layer

size-overlay

Interactive size switching

Click a button to apply a size class to the child box. The current computed size is displayed below. In a narrow parent, any overflow is capped at 100%.

child