Hypen
Language Reference

Layout Reference

Complete reference for Hypen layout components

Layout Reference

Complete reference for layout components in Hypen.

Column

Arranges children vertically.

Column {
    Text("Top")
    Text("Middle")
    Text("Bottom")
}
.gap(12)

Row

Arranges children horizontally.

Row {
    Text("Left")
    Text("Right")
}
.gap(12)

Box / Container

Generic container with z-axis stacking.

Box {
    Image("background.jpg")
    Text("Overlay")
}

Center

Centers children both horizontally and vertically.

Center {
    Spinner()
}
.fillMaxSize(true)

Stack

Z-axis stacking for overlapping elements.

Stack {
    Card { Text("Base") }
    Badge("New")
}

Grid

Grid layout with configurable columns.

Grid {
    Card { Text("1") }
    Card { Text("2") }
    Card { Text("3") }
    Card { Text("4") }
}
.gridColumns(2)
.gap(16)

List

Scrollable container for items.

List {
    Text("Item 1")
    Text("Item 2")
    Text("Item 3")
}
.height(400)

Spacer

Flexible empty space.

Row {
    Text("Left")
    Spacer()
    Text("Right")
}

Divider

Visual separator line.

Column {
    Text("Section 1")
    Divider()
    Text("Section 2")
}

Alignment Applicators

ApplicatorValues
horizontalAlignmentstart, center, end, space-between, space-around
verticalAlignmentstart, center, end, space-between, space-around
alignItemsflex-start, center, flex-end, stretch
justifyContentflex-start, center, flex-end, space-between, space-around

Size Applicators

ApplicatorDescription
widthFixed width
heightFixed height
minWidth / maxWidthWidth constraints
minHeight / maxHeightHeight constraints
fillMaxWidthFill available width
fillMaxHeightFill available height
fillMaxSizeFill both dimensions