Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / ADDITIONAL WIDGETS AND TEXT
Tabs
A single row of tabs.
Selection and event routing remain caller-owned. Overflow starts at the selected tab when it would otherwise be clipped.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Members on this page
Feature guides and release status
Tabs
struct Tabs<ID> where ID : Hashable, ID : SendableConforms to: Widget.
A single row of tabs.
Selection and event routing remain caller-owned. Overflow starts at the selected tab when it would otherwise be clipped.
Source · Tabs.swift:16tabs
var tabs: [Tab<ID>]A public field of this type. Its value type and mutability are shown in the declaration.
Source · Tabs.swift:17selected
var selected: ID?A public field of this type. Its value type and mutability are shown in the declaration.
Source · Tabs.swift:18separator
var separator: StringA public field of this type. Its value type and mutability are shown in the declaration.
Source · Tabs.swift:19padding
var padding: IntPadding between border and content.
Source · Tabs.swift:20style
var style: StyleVisual attributes used when painting this value.
Source · Tabs.swift:21selectedStyle
var selectedStyle: StyleA public field of this type. Its value type and mutability are shown in the declaration.
Source · Tabs.swift:22init(_:selected:separator:padding:style:selectedStyle:)
init(_ tabs: [Tab<ID>], selected: ID? = nil, separator: String = "│", padding: Int = 1, style: Style = Style(), selectedStyle: Style = Style(reversed: true))Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (6)
tabs- Argument type and any default are shown in the declaration; see the behavior notes above.
selected- Argument type and any default are shown in the declaration; see the behavior notes above.
separator- Argument type and any default are shown in the declaration; see the behavior notes above.
padding- Argument type and any default are shown in the declaration; see the behavior notes above.
style- Text/cell appearance.
selectedStyle- Argument type and any default are shown in the declaration; see the behavior notes above.
hitTest(_:in:)
func hitTest(_ point: Point, in area: Rect) -> ID?Returns the tab occupying a painted label or padding cell; separators have no target.
Parameters (2)
point- Zero-based terminal-cell position.
in- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns ID?.
render(in:buffer:)
func render(in area: Rect, buffer: inout Buffer)Paints this widget into the assigned terminal-cell rectangle. Application code owns state, input routing, and terminal lifetime.
Parameters (2)
in- Argument type and any default are shown in the declaration; see the behavior notes above.
buffer- Mutable destination cell grid.