Structure
OUDSFilterChip
Filter chip is a UI element that allows to select or deselect an option within a series, and is commonly used to capture filtering decisions. Filter chip allows to filter content by being selected or deselected. It can be toggled “On” or “Off” to refine displayed results, and selected Filter Chips remain visually distinct to indicate active filters.
- iOS 15.0+
- macOS 13.0+
- tvOS 16.0+
- visionOS 1.0+
- watchOS 11.0+
@MainActor struct OUDSFilterChip
Mentioned In
Code samples
// Icon only layout as selected
OUDSFilterChip(icon: Image("ic_heart"), accessibilityLabel: "Heart", selected: true) { /* the action to process */ }
// Text only as not selected (default unselected)
OUDSFilterChip(text: "Label") { /* the action to process */ }
// Text from a localizable and a bundle
OUDSFilterChip(LocalizedStringKey("category_filter"), bundle: Bundle.module) { }
// Text and icon as selected
OUDSFilterChip(icon: Image("ic_heart"), text: "Label", selected: true) { /* the action to process */ }
Design documentation
unified-design-system.orange.com
Themes rendering
Orange

Orange Compact

Sosh

Wireframe

Version
1.3.0
Since
0.17.0
Topics
Initializers
init(LocalizedStringKey, tableName: String?, bundle: Bundle, selected: Bool, action: () -> Void)Creates a filter chip with a localized text only, looking up the key in the given bundle.
init(icon: Image, LocalizedStringKey, tableName: String?, bundle: Bundle, selected: Bool, action: () -> Void)Creates a filter chip with a localized text and icon, looking up the key in the given bundle.
init(icon: Image, accessibilityLabel: String, selected: Bool, action: () -> Void)Create a chip with an icon only.
init(icon: Image, accessibilityLabel: LocalizedStringKey, tableName: String?, bundle: Bundle, selected: Bool, action: () -> Void)Create a chip with an icon only.
init(icon: Image, text: String, selected: Bool, action: () -> Void)Creates a filter chip with text and icon.
init(text: String, selected: Bool, action: () -> Void)Create a chip with a text only.
Instance Properties