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 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
A tab bar with bold+reverse active style and │ dividers.
pub fn with_active_style(t: Tabs, s: style.Style) -> Tabs
Style of the selected tab (default: bold + reverse).
pub fn with_colors(
t: Tabs,
fg: style.Color,
bg: style.Color,
) -> Tabs
Colors of inactive tabs and the divider.
pub fn with_divider(t: Tabs, div: String) -> Tabs
String drawn between adjacent tabs (default "│"; use " " to hide).