Skip to main content

LineHeight (8.11)

Overrides the default line height (1.0) inherited by descendent Text components.

modifier LineHeight

Example

import { LineHeight, Text, VStack } from ui

export var main = VStack {
Text("Default\nline height")

VStack {
Text("Increased\nline height")
} with {
LineHeight(1.5)
}
}

Constructor

constructor(_ factor: Float? = nil)
_ factor: Float? = nil

An optional line height factor. For example, 1.5 results in 150% of the font's natural line height. To let text inherit the default line height defined above this modifier provide nil.