When to use it
It never truncates; validate the limit on submit.
Apple availability
Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.
Native example
It never truncates; validate the limit on submit.
import LumenUI
import SwiftUI
struct CharacterCountExample: View {
@State private var bio = "Design systems engineer building calm interfaces."
var body: some View {
VStack(alignment: .leading, spacing: LumenSpacing.xs) {
LumenTextField("Short bio", text: $bio)
LumenCharacterCount(text: bio, max: 80)
}
}
}Reference
The primary shared and platform-specific options exposed by LumenCharacterCount.
| API | Values or type | Default | Description |
|---|---|---|---|
| max / value / announceAt | limit / current text / thresholds | required / required / 20, 10, 0 | It never truncates; validate the limit on submit. |
Native behavior
It never truncates; validate the limit on submit.
Counts graphemes and announces only at thresholds and at the limit.
Shared component