Skip to main content

LetterSpacing (8.11)

Overrides the default letter spacing (0px) inherited by descendent components with text.

modifier LetterSpacing

Example

import { LetterSpacing, Text, VStack } from ui

export var main = VStack {
Text("Default")

VStack {
Text("Wide spacing")
Text("Wide spacing")
} with {
LetterSpacing(3.0)
}
}

Constructor

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

An optional letter spacing in pixels. Can be negative to tighten character spacing. To let text inherit the default letter spacing defined above this modifier provide nil.