Skip to content

Divider

Divider preview

Divider renders a single-line visual separator using the theme border color. Default orientation is horizontal; use NewDivider(DividerVertical) for columns.

Constructor func NewDivider() *Divider

Usage

divider := components.NewDivider().
SetLabel("Section").
SetStyle('')
fmt.Println(divider != nil)

Methods

Method Signature Description
GetFieldHeight func (d *Divider) GetFieldHeight() int GetFieldHeight returns preferred height
SetLabel func (d *Divider) SetLabel(label string) *Divider SetLabel sets an optional centered label
SetOrientation func (d *Divider) SetOrientation(o DividerOrientation) *Divider SetOrientation sets horizontal or vertical
SetStyle func (d *Divider) SetStyle(char rune) *Divider SetStyle sets the divider character

Types

type DividerOrientation DividerOrientation specifies whether the Divider draws horizontally or vertically.
ConstantDescription
DividerHorizontal
DividerVertical