etui/widgets/tabs

Types

pub type Tabs {
  Tabs(
    labels: List(String),
    active: Int,
    fg: style.Color,
    bg: style.Color,
    active_style: style.Style,
    divider: String,
    padding: Int,
  )
}

Constructors

  • Tabs(
      labels: List(String),
      active: Int,
      fg: style.Color,
      bg: style.Color,
      active_style: style.Style,
      divider: String,
      padding: Int,
    )

    Arguments

    active

    0-based index of the active tab.

    divider

    String rendered between tabs.

    padding

    Padding spaces inside each tab label.

Values

pub fn next_tab(t: Tabs) -> Tabs
pub fn prev_tab(t: Tabs) -> Tabs
pub fn render(
  buf: buffer.Buffer,
  area: geometry.Rect,
  t: Tabs,
) -> buffer.Buffer

Render the tab bar into the first row of area.

pub fn tabs_new(labels: List(String)) -> Tabs
pub fn with_active(t: Tabs, idx: Int) -> Tabs
pub fn with_active_style(t: Tabs, s: style.Style) -> Tabs
pub fn with_colors(
  t: Tabs,
  fg: style.Color,
  bg: style.Color,
) -> Tabs
pub fn with_divider(t: Tabs, div: String) -> Tabs
pub fn with_padding(t: Tabs, p: Int) -> Tabs
Search Document