Skip to content

z-index

Utilities for controlling the stack order of an element.

Class Effect
z-<number> z-index: <number>;
z-auto z-index: auto;
z-[<value>] z-index: <value>;

Use z-<number> to control the stack order of positioned siblings.

z-index: Basic examplez-index: Basic example
if ui.div("flex") {
for z, i in ([]string{"z-40", "z-30", "z-20", "z-10", "z-0"}) {
ui.key(z)
colors := [?]string{"bg-blue-500", "bg-indigo-500", "bg-violet-500", "bg-purple-500", "bg-fuchsia-500"}
ui.text(z, ui.cx("relative flex size-16 items-center justify-center rounded-full font-mono text-xs font-bold text-white shadow-lg ring-2 ring-white dark:ring-gray-900", colors[i], z, i > 0 ? "-ml-3" : ""))
}
}