Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
Data displayApple

Tag group

Show removable tags in a wrapping list.

Public APILumenTagGroupApple / 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 Tag group

The host owns the tags and removes them in onRemove (value in React Native/Compose, id in SwiftUI).

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

struct TagGroupExample: View {
    @State private var tags: [LumenTagItem] = [
        .init(id: "swift", label: "SwiftUI"),
        .init(id: "design", label: "Design systems"),
        .init(id: "native", label: "Native", removable: false),
        .init(id: "archived", label: "Archived", isDisabled: true)
    ]

    var body: some View {
        LumenTagGroup("Project topics", tags: tags, onRemove: { id in
            tags.removeAll { $0.id == id }
        })
    }
}
Apple
Host-owned topic tags: removing a tag deletes it from state, while the fixed and disabled tags stay.

Reference

Public API

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

APIValues or typeDefaultDescription
tags / onRemove / removeLabeltags / removal callback / remove button namerequired / none / Remove {label}The host owns the tags and removes them in onRemove (value in React Native/Compose, id in SwiftUI).

Native behavior

Design and accessibility

When to use it

The host owns the tags and removes them in onRemove (value in React Native/Compose, id in SwiftUI).

Accessibility

Named group; remove buttons are named, and focus moves to a remaining removable tag or the group after removal.

Shared component

Available on other platforms

React NativeAndroid / Compose Web
Apple docsSwiftUI package