Skip to content

Inset

Inset utilities move a positioned element. Pair them with relative, absolute, fixed, or sticky from the Position page.

Class Effect
inset-0 inset: 0
inset-x-0 inset-inline: 0
inset-y-0 inset-block: 0

These cover the full-bleed and full-height cases. For a specific edge, use the offset classes below.

Class pattern Property
top-0 … top-24, top-auto top
right-* right
bottom-* bottom
left-* left

All four read the --inset knob and use the 4px scale:

<div class="absolute top-4 left-4">Corner badge</div>
<div class="absolute top-0 left-0" style="--inset: 0.5rem">Same, one-off</div>

A full overlay is absolute inset-0:

<article class="relative">
<img src="…" alt="…" />
<div class="absolute inset-0" style="background: rgb(0 0 0 / 0.4)"></div>
</article>

The offsets are physical properties, not logical ones. In a right-to-left page, left-4 still means the physical left edge; write inset-inline-start in your own CSS when direction matters.

Offsets are base-only. A responsive offset is rare enough that a media query is clearer than another matrix of classes.

The class is the markup shorthand. The same style in a component stylesheet:

.badge {
position: absolute;
inset-block-start: var(--nc-space-4);
inset-inline-start: var(--nc-space-4);
}
.overlay {
position: absolute;
inset: 0;
}

The Sass subpackage exposes the same value: nc.nc-space(4). See Sass subpackage.

A breakpoint is the same declaration inside a media query; you do not need a second class.