Skip to main content

Divider & VerticalDivider

Thin lines that separate content. Divider draws a horizontal line (for use in columns) and VerticalDivider draws a vertical line (for use in rows).

Divider

A horizontal separator that expands to fill available width.

// Themed (recommended)
theme.DividerOf(ctx)

// Explicit (full control)
widgets.Divider{
Height: 16,
Thickness: 1,
Color: colors.OutlineVariant,
}

Divider Properties

PropertyTypeDescription
Heightfloat64Total vertical space occupied
Thicknessfloat64Thickness of the drawn line
Colorgraphics.ColorLine color
Indentfloat64Left inset from the leading edge
EndIndentfloat64Right inset from the trailing edge

VerticalDivider

A vertical separator that expands to fill available height.

// Themed (recommended)
theme.VerticalDividerOf(ctx)

// Explicit (full control)
widgets.VerticalDivider{
Width: 16,
Thickness: 1,
Color: colors.OutlineVariant,
}

VerticalDivider Properties

PropertyTypeDescription
Widthfloat64Total horizontal space occupied
Thicknessfloat64Thickness of the drawn line
Colorgraphics.ColorLine color
Indentfloat64Top inset
EndIndentfloat64Bottom inset

Common Patterns

List with Dividers

widgets.Column{
CrossAxisAlignment: widgets.CrossAxisAlignmentStretch,
Children: []core.Widget{
listItem("Account"),
theme.DividerOf(ctx),
listItem("Notifications"),
theme.DividerOf(ctx),
listItem("Privacy"),
},
}

Indented Divider

Use Indent to align the divider with content that has leading padding:

widgets.Divider{
Height: 1,
Thickness: 1,
Color: colors.OutlineVariant,
Indent: 56, // align with text after a 40px avatar + 16px gap
}

Theme Data

Both widgets share DividerThemeData:

FieldDefaultDescription
ColorOutlineVariantLine color
Space16Default Height (Divider) or Width (VerticalDivider)
Thickness1Line thickness
Indent0Leading inset
EndIndent0Trailing inset

Override via ThemeData.DividerTheme:

theme.Theme{
Data: &theme.ThemeData{
ColorScheme: colors,
DividerTheme: &theme.DividerThemeData{
Color: colors.Outline,
Space: 8,
Thickness: 2,
},
},
Child: app,
}