Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
FormsApple

Field group

Compose related native controls under one label, description, required state, and validation message.

Public APILumenFieldGroupApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

Native example

Use Field group

Use when several controls share one label or validation message. Do not use it to duplicate a label already owned by one Text field or Textarea.

Field group rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenFieldGroup(
    "Notification channels",
    description: "Choose every channel the team should use.",
    required: true
) {
    NotificationControls()
}

Reference

Public API

The primary shared and platform-specific options exposed by LumenFieldGroup.

APIValues or typeDefaultDescription
labelStringRequiredNames the grouped field controls.
descriptionString?nilAdds shared supporting guidance.
errorMessageString?nilAdds a shared validation message.
requiredBooleanfalseShows that the grouped answer is required.
contentNative contentRequiredProvides independently accessible controls.

Native behavior

Design and accessibility

When to use it

Use when several controls share one label or validation message. Do not use it to duplicate a label already owned by one Text field or Textarea.

Accessibility

The label and messages provide context without merging the semantics of contained native controls or their actions.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package