Skip to main content
Divider(): Component;
Divider takes no parameters. It renders a horizontal line in a VStack and a vertical line in an HStack.

Support

Usage

In a VStack

VStack([
    Text("Above"),
    Divider(),
    Text("Below")
])

In an HStack

HStack([
    Text("Left"),
    Divider(),
    Text("Right")
])
    .frame({ height: 40 })

Separating list items

VStack({ spacing: 0 }, [
    ForEach(items, (item, index) =>
        Group([
            Text(item.name).padding(12),
            index < items.length - 1 ? Divider() : Empty()
        ])
    )
])