Skip to content

flex

Utilities for controlling how flex items both grow and shrink.

Class Effect
flex-<number> flex: <number>;
flex-<fraction> flex: calc(<fraction> * 100%);
flex-auto flex: auto;
flex-initial flex: 0 auto;
flex-none flex: none;
flex-[<value>] flex: <value>;

Use flex-1 to let an item grow and shrink as needed, ignoring its initial size.

flex: Basic exampleflex: Basic example
if ui.div("flex gap-4") {
tile("01", "w-14 flex-none")
tile("02", "w-64 flex-1")
tile("03", "w-32 flex-1")
}

Use flex-initial to allow shrinking but not growing.

flex: Initialflex: Initial
if ui.div("flex gap-4") {
tile("01", "w-14 flex-none")
tile("02", "w-64 flex-initial")
tile("03", "w-32 flex-initial")
}
flex: Autoflex: Auto
if ui.div("flex gap-4") {
tile("01", "w-14 flex-none")
tile("02", "w-64 flex-auto")
tile("03", "w-32 flex-auto")
}