Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / COLLECTIONS AND INTERACTION
ListItem
A list row with a stable application identity, styled text, and an explicit terminal-row height.
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
ListItem
struct ListItem<ID> where ID : HashableConforms to: Swift.Identifiable, Swift.Sendable, Swift.SendableMetatype.
A list row with a stable application identity, styled text, and an explicit terminal-row height.
Source · List.swift:2id
var id: IDStable identity for this icon or code block.
Source · List.swift:3spans
var spans: [TextSpan]A public field of this type. Its value type and mutability are shown in the declaration.
Source · List.swift:4height
var height: IntHeight in terminal cells.
Source · List.swift:5style
var style: StyleVisual attributes used when painting this value.
Source · List.swift:6patch
var patch: StylePatch?A public field of this type. Its value type and mutability are shown in the declaration.
Source · List.swift:7alignment
var alignment: CellAlignment?A public field of this type. Its value type and mutability are shown in the declaration.
Source · List.swift:8init(id:_:height:style:alignment:patch:)
init(id: ID, _ text: String, height: Int = 1, style: Style = Style(), alignment: CellAlignment? = nil, patch: StylePatch? = nil)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (6)
id- Stable entry/icon identity, not an array index.
text- Source text.
height- Available rows in terminal cells.
style- Text/cell appearance.
alignment- Argument type and any default are shown in the declaration; see the behavior notes above.
patch- Argument type and any default are shown in the declaration; see the behavior notes above.
init(id:spans:height:style:alignment:patch:)
init(id: ID, spans: [TextSpan], height: Int = 1, style: Style = Style(), alignment: CellAlignment? = nil, patch: StylePatch? = nil)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (6)
id- Stable entry/icon identity, not an array index.
spans- Styled source spans, in order.
height- Available rows in terminal cells.
style- Text/cell appearance.
alignment- Argument type and any default are shown in the declaration; see the behavior notes above.
patch- Argument type and any default are shown in the declaration; see the behavior notes above.