Skip to content
Text Area preview
Rendered from the SwiftUI source on this page.

Text Area

From syxUI — written for both platforms, not translated between them.

A text area input — self-contained SwiftUI, styled from system tokens.

Inputs · SwiftUI · iOS 17

  • inputs
  • swiftui

The actual source

TextAreaField.swift
// Text Area · syxUI · https://syxui.dev/components/input-textarea
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

extension View {
    func formaCard(_ pad: CGFloat = 18) -> some View {
        self.padding(pad)
            .background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 20, style: .continuous))
            .overlay(RoundedRectangle(cornerRadius: 20, style: .continuous).stroke(Color.primary.opacity(0.06), lineWidth: 1))
            .shadow(color: .black.opacity(0.05), radius: 14, x: 0, y: 6)
    }
}

// 16. Text area
struct TextAreaField: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 7) {
            Text("Your review").font(.system(size: 13, weight: .semibold))
            VStack(alignment: .leading, spacing: 0) {
                Text("Runway replaced our B-roll budget. Locked the style with one reference and shot a 30s promo in an afternoon.")
                    .font(.system(size: 15)).foregroundStyle(.primary).lineSpacing(3)
                Spacer(minLength: 0)
                HStack { Spacer(); Text("128 / 500").font(.system(size: 11)).foregroundStyle(.tertiary) }
            }
            .padding(14).frame(height: 130, alignment: .topLeading)
            .overlay(RoundedRectangle(cornerRadius: 12).stroke(Color.primary.opacity(0.18), lineWidth: 1))
        }
        .formaCard()
    }
}
iOS 17 · 1 dependencies

Dependencies

SwiftUI
  • formaCard

Requires iOS 17