Conversation
…om/microsoft/fluentui-apple into laminemale/add-swiftui-pill-button
nabil-k
reviewed
Aug 22, 2025
Demos/FluentUIDemo_iOS/FluentUI.Demo/Demos/PillButtonBarDemoController_SwiftUI.swift
Outdated
Show resolved
Hide resolved
nabil-k
reviewed
Aug 22, 2025
Sources/FluentUI_iOS/Components/PillButtonBar/SwiftUI/PillButtonBarView.swift
Show resolved
Hide resolved
nabil-k
reviewed
Aug 22, 2025
Sources/FluentUI_iOS/Components/Pill Button Bar/SwiftUI/PillButtonBarView.swift
Outdated
Show resolved
Hide resolved
Sources/FluentUI_iOS/Components/Pill Button Bar/SwiftUI/PillButtonBarView.swift
Outdated
Show resolved
Hide resolved
huwilkes
reviewed
Oct 15, 2025
Sources/FluentUI_iOS/Components/PillButtonBar/SwiftUI/PillButtonBarView.swift
Outdated
Show resolved
Hide resolved
huwilkes
approved these changes
Oct 15, 2025
huwilkes
approved these changes
Oct 15, 2025
Sources/FluentUI_iOS/Components/PillButtonBar/SwiftUI/PillButtonBarView.swift
Outdated
Show resolved
Hide resolved
AllieStoyanova
approved these changes
Oct 15, 2025
AllieStoyanova
approved these changes
Oct 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Platforms Impacted
Description of changes
This PR adds a SwiftUI pill button bar.
This implementation uses generic binding to allow clients to set up pill selection with a
HashableSelectiontype that they provide to thePillButtonBarView. Each individual's pill button will have a matchingPillButtonViewModelwhich will provide their respectiveSelectionvalue used by the bar.Moreover, this implementation supports 2 types of pill button bars:
1 - The traditional pill button bar that is restricted to 1 selected pill button at all times.
2 - A pill button bar that supports no selected pill button and a maximum of 1. In other words, if the user taps on the currently selected pill button it will be deselected (client request).
To best support this, I opted to have two separate initializers to help distinguish between the two types of pill button bars: one initializer that takes a non-optional
Selectionbinding for the traditional pill button bar experience, and the other initializer taking an optionalSelectionbinding for pill bars that support no selected pills. Internally, we use an optionalSelectionproperty and a bool (determining which kind of pill bar this is) to correctly set up and change pill selection.This PR also reverts changes to the UIKit pill button made in #2188 as it was causing a bug on the UIKit pill button bar where it wouldn't show the unread dot. I've investigated the issue quite a bit and could accurately pinpoint what was happening but it seems related to some obscure logic in the bar where the buttons get created and destroyed during layout phases. Decided to simply revert as that control is very fragile and has been a source of headaches in the past with minor changes.
Binary change
Between 80 and 100KB binary impact.
Verification
Visually verified light/dark and all platforms. Disabled state doesn't look obvious on vision dark mode (though I'm not familiar with the platform), so we might need different disabled colors.
Visual Verification
Pull request checklist
This PR has considered:
Microsoft Reviewers: Open in CodeFlow