inputs/DSTextArea
DSTextArea
inputsMulti-line text input that expands as the user types, with an optional character counter.
iOS 17+macOS 14+watchOS 10+tvOS 17+visionOS 1+
Purpose
Long-form text entry: descriptions, notes, comments, and bio fields.
Interactive Reference
Live showroom
Need the full visual surface?
Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().
Best for exploring:
variants, states, categories, and real app examples in one place.
States
default
Minimum 3 visible lines.
focused
Primary-colour border.
error
Red border + error message.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | String? | nil | Label above the field. |
| placeholder | String | "" | Placeholder text. |
| textreq | Binding<String> | โ | Bound text value. |
| minLines | Int | 3 | Minimum visible lines. |
| maxLines | Int | 8 | Lines before the field starts scrolling. |
| error | String? | nil | Validation error message. |
Examples
Bio field
Grows from 3 to 6 lines, with validation.
swift
DSTextArea(
label: "Bio",
placeholder: "Tell us about yourself...",
text: $bio,
minLines: 3,
maxLines: 6,
error: bio.count > 160 ? "Keep it under 160 characters" : nil
)