loom & weft
Made for Swift.

Published release 0.2.1. Unreleased PR #2 reference.

LOOM 0.2.1 / 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

Structure
struct ListItem<ID> where ID : Hashable

Conforms 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:2

id

Instance Property
var id: ID

Stable identity for this icon or code block.

Source · List.swift:3

spans

Instance Property
var spans: [TextSpan]

A public field of this type. Its value type and mutability are shown in the declaration.

Source · List.swift:4

height

Instance Property
var height: Int

Height in terminal cells.

Source · List.swift:5

style

Instance Property
var style: Style

Visual attributes used when painting this value.

Source · List.swift:6

patch

Instance Property
var patch: StylePatch?

A public field of this type. Its value type and mutability are shown in the declaration.

Source · List.swift:7

alignment

Instance Property
var alignment: CellAlignment?

A public field of this type. Its value type and mutability are shown in the declaration.

Source · List.swift:8

init(id:_:height:style:alignment:patch:)

Initializer
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.
Source · List.swift:10

init(id:spans:height:style:alignment:patch:)

Initializer
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.
Source · List.swift:17