Consider a consistent icon tinting API instead of SwipeItem-only IconColor
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 296
Description
Description
Related issue:
https://github.com/dotnet/maui/issues/36766
In the discussion above, adding a new SwipeItem.IconColor property for .NET 11 was mentioned as a possible solution.
While this would address the specific SwipeItem scenario, I am concerned that introducing an icon color API only for SwipeItem could create an inconsistency across MAUI controls.
Several controls display icons or images today, including:
- SwipeItem
- Button (ImageSource)
- Image
- ImageButton
If icon tinting is considered a supported scenario, it may be beneficial to provide a common approach that can be used consistently across controls rather than introducing a property that is specific to SwipeItem.
This would help developers:
- Reuse a single icon asset across multiple themes and visual states
- Reduce the number of image files that must be shipped with an application
- Simplify light and dark theme support
- Improve API consistency across MAUI controls
I am aware that CommunityToolkit provides IconTintColorBehavior for Image and ImageButton. However, this proposal is about providing a consistent built-in MAUI API across controls rather than relying on behaviors for some controls and dedicated properties for others.
Would the team consider a broader icon tinting strategy (for example, IconColor or TintColor) instead of introducing functionality only for SwipeItem?
Public API Changes
One possible approach could be introducing a common tinting/coloring property for controls that display icons or images.
Intended Use-Case
Many applications use monochrome icon assets that need to adapt to:
- Light and dark themes
- Different visual states
- Brand-specific color schemes
- Accessibility requirements
Today, developers often need to maintain multiple versions of the same icon, such as:
- icon_black.png
- icon_white.png
- icon_blue.png
With a built-in icon tinting API, a single image asset could be reused while the displayed color is controlled through XAML or code.
Example:
<Button
ImageSource="ic_fluent_arrow_circle_left_24_filled.png"
IconColor="White" />
<Image
Source="ic_fluent_arrow_circle_left_24_filled.png"
TintColor="Red" />
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing related issue #36766 and the listed controls: SwipeItem, Button, Image, and ImageButton. The issue does not name implementation files or tests; done would require an agreed built-in tinting API that is consistent across applicable controls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100