Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
FormsApple

Input group

Join a text field with prefix or suffix text, an icon, or a button in one frame.

Public APILumenInputGroupApple / 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 Vision · visionOS 1+

Native example

Use Input group

Use it for units, domains, and inline actions. Keep addon text short.

Input group rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulatorView dark appearance
swift
import LumenUI
import SwiftUI

struct InputGroupExample: View {
    @State private var site = "lumen"
    @State private var query = ""

    var body: some View {
        VStack(alignment: .leading, spacing: LumenSpacing.md) {
            LumenInputGroup("Website", text: $site, placeholder: "your-site",
                            leadingText: "https://", trailingText: ".com")
            LumenInputGroup("Search projects", text: $query, placeholder: "Search projects", leading: {
                LumenIcon(name: .search, size: .sm)
            })
        }
    }
}
Apple
A website field with `https://` and `.com` text addons, and a search field with a leading icon.

Reference

Public API

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

APIValues or typeDefaultDescription
leading / trailing / invalidleading addon / trailing addon / error framenone / none / falseUse it for units, domains, and inline actions.

Native behavior

Design and accessibility

When to use it

Use it for units, domains, and inline actions. Keep addon text short.

Accessibility

The field keeps its own name; addon buttons keep their own names.

Shared component

Available on other platforms

React NativeAndroid / Compose Web
Apple docsSwiftUI package