Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
8b14cc0
WIP
vnbaaij Feb 18, 2025
48eafc6
Initial AppBar work
vnbaaij Dec 22, 2025
b97d818
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/overflow
vnbaaij Dec 22, 2025
8649abb
Finish work.
vnbaaij Dec 24, 2025
b612635
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/overflow
vnbaaij Dec 24, 2025
a26f9be
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/overflow
dvoituron Dec 28, 2025
c15abee
Merge branch 'users/vnbaaij/dev-v5/overflow' into users/vnbaaij/dev-v…
vnbaaij Dec 29, 2025
a67cc88
Make it work
vnbaaij Dec 29, 2025
f533730
Add tests (wip)
vnbaaij Dec 29, 2025
02b8049
Add tests (wip)
vnbaaij Dec 29, 2025
4f0de5a
Merge branch 'users/vnbaaij/dev-v5/appbar-part1' of https://github.co…
vnbaaij Dec 29, 2025
abebf71
merge dev-v5
vnbaaij Dec 29, 2025
0fd96b6
Make ShowZero=false actually hide the CounterBadge
vnbaaij Dec 30, 2025
ef2fe52
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/enhance-counterbadge
vnbaaij Dec 30, 2025
d55f890
- Add ShowEmpty parameter
vnbaaij Dec 30, 2025
a6e1411
Store
vnbaaij Dec 31, 2025
fa695ff
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/appbar-part0
vnbaaij Dec 31, 2025
2b4644d
Fix AppBar
vnbaaij Jan 2, 2026
3132c7e
- Restructure badges docs
vnbaaij Jan 2, 2026
26ae21d
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/enhance-counterbadge
vnbaaij Jan 2, 2026
7f25baa
Cleanup test csproj
vnbaaij Jan 2, 2026
a02b4d8
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/appbar-part1
vnbaaij Jan 2, 2026
703b3e5
Fix JSON error
vnbaaij Jan 2, 2026
a3e243f
Add check in OverflowRaisedAsync- Use general OverflowItem class
vnbaaij Jan 2, 2026
4e3276a
Merge branch 'users/vnbaaij/dev-v5/enhance-counterbadge' into users/v…
vnbaaij Jan 2, 2026
79ba583
Merge enhance counter badge
vnbaaij Jan 2, 2026
c0543ae
Update src/Core/Components/CounterBadge/FluentCounterBadge.razor
vnbaaij Jan 4, 2026
7c9ff33
Update src/Core/Components/CounterBadge/FluentCounterBadge.razor
vnbaaij Jan 4, 2026
8e27d82
Update src/Core/Components/CounterBadge/FluentCounterBadge.razor.cs
vnbaaij Jan 4, 2026
01f6530
Set ShowEmpty="false"
vnbaaij Jan 5, 2026
e8b0f75
- Add ContainerStyle to Badge/CounterBadge
vnbaaij Jan 5, 2026
99c7a9a
merge
vnbaaij Jan 5, 2026
7722e39
Merge branch 'users/vnbaaij/dev-v5/enhance-counterbadge' into users/v…
vnbaaij Jan 5, 2026
ef80176
Move CounterBadge into badge folder
vnbaaij Jan 5, 2026
7415f88
Merge branch 'users/vnbaaij/dev-v5/enhance-counterbadge' into users/v…
vnbaaij Jan 5, 2026
12593a4
- Add doc icon
vnbaaij Jan 5, 2026
ac2a8a6
- Undo .csproj change
vnbaaij Jan 5, 2026
be15a14
- Better check in OverflowRaisedAsync
vnbaaij Jan 5, 2026
5b017d1
- Add tests, Alter test to not use Verify
vnbaaij Jan 5, 2026
00d8f1c
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/appbar-part1
vnbaaij Jan 5, 2026
47fb3d9
Process Copilot remarks
vnbaaij Jan 5, 2026
ddb7c44
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/enhance-counterbadge
vnbaaij Jan 5, 2026
928446f
Spelling errors
vnbaaij Jan 5, 2026
7933a86
- Add FluentPresenceBadge, examples, icons
vnbaaij Jan 6, 2026
7d1f5ff
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/appbar-part1
vnbaaij Jan 6, 2026
1c24210
Refactor way to set style on badge container
vnbaaij Jan 6, 2026
3e28dbf
merge dev-v5
vnbaaij Jan 6, 2026
9915fba
merge
vnbaaij Jan 6, 2026
bae0abc
Fix merge inconsistencies
vnbaaij Jan 6, 2026
6af4847
Fix merging inconsistensies
vnbaaij Jan 7, 2026
3bd39f9
Undo blank line
vnbaaij Jan 7, 2026
c8b4e90
Remove ContainerStyle test as parameter is removed
vnbaaij Jan 7, 2026
6a9dd91
Process review comments
vnbaaij Jan 7, 2026
bbdcf9a
Process review comments
vnbaaij Jan 7, 2026
9dc1599
merge
vnbaaij Jan 7, 2026
521f923
Try to work around Avatar issue
vnbaaij Jan 7, 2026
f5f339d
merge
vnbaaij Jan 9, 2026
0c86f2a
Implement internalized container style for counter badge
vnbaaij Jan 9, 2026
dc83c89
Add a StateHasChanged based onGH review comment
vnbaaij Jan 9, 2026
767d510
Merge branch 'users/vnbaaij/dev-v5/cleanup-badges' into users/vnbaaij…
vnbaaij Jan 9, 2026
a183390
Add localization, cleunup code
vnbaaij Jan 9, 2026
46d6395
Add tests
vnbaaij Jan 12, 2026
d080d71
Add tests, add slot parameter
vnbaaij Jan 12, 2026
7c410de
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/add-presence-badge
vnbaaij Jan 12, 2026
f0b0036
More tests, docs
vnbaaij Jan 12, 2026
f409297
Undo Avatar slot removal
vnbaaij Jan 12, 2026
fa9230a
Fix Avatar tests
vnbaaij Jan 12, 2026
ed51dec
Process review comments
vnbaaij Jan 12, 2026
8ad49d8
Merge branch 'dev-v5' into users/vnbaaij/dev-v5/add-presence-badge
vnbaaij Jan 13, 2026
9b8518e
- Process review comment.
vnbaaij Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ The `FluentAppBar` component is an implementation of the AppBar as you know from
## Change strings used in the UI

The AppBar uses a string in the UI. It's value can be changed by leveraging the built-in [localization](/localization) functionality.
The following values can be localized:
The following values can be localized (the default value is shown between brackets) :

- AppBar_MoreItems
- AppBar_MoreItems ("View more apps")

## Simple AppBar

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Different badges can display different content.

- `Badge` displays text and/or an icon
- `CounterBadge` displays numerical values
- `PresenceBadge` displays status (not yet implemented)
- `PresenceBadge` displays status

Typically a badge 'wraps' a component, such as a `FluentButton`, to indicate a status.

Expand Down Expand Up @@ -45,7 +45,7 @@ There are two actions authors should consider taking when using Badge to improve
</FluentBadge>
```

### Badge shouldn't rely only on color information
### Badges shouldn't rely only on color information
Include meaningful descriptions when using color to represent meaning in a badge. If relying on color only, ensure that non-visual information is included in the parent's label or description.

### Text on Badge
Expand All @@ -54,3 +54,4 @@ Badges are intended to have short text, small numerical values or status informa
See the following pages for more information on the different badge components:
- [Badge](/Badges/Badge)
- [CounterBadge](/Badges/CounterBadge)
- [PresenceBadge](/Badges/PresenceBadge)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<FluentPresenceBadge />
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

<FluentStack HorizontalGap="12px" Wrap="true">
<FluentAvatar Color="AvatarColor.Colorful" Name="Denis Voituron">
<FluentPresenceBadge Status="PresenceStatus.Available" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Vincent Baaij" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.Away" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Tyme Bleyaert">
<FluentPresenceBadge Status="PresenceStatus.Busy" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Marvin Klein" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.DoNotDisturb" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Adrien Clerbois">
<FluentPresenceBadge Status="PresenceStatus.Offline" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Tof Net" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.OutOfOffice" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Scott McPhierson">
<FluentPresenceBadge Status="PresenceStatus.Blocked" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Idris Baker" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.Unknown" slot="@FluentSlot.Badge" />
</FluentAvatar>
</FluentStack>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

<FluentStack HorizontalGap="12px" Wrap="true">
<FluentAvatar Color="AvatarColor.Colorful" Name="Denis Voituron">
<FluentPresenceBadge Status="PresenceStatus.Available" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Vincent Baaij" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.Away" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Tyme Bleyaert">
<FluentPresenceBadge Status="PresenceStatus.Busy" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Marvin Klein" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.DoNotDisturb" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Adrien Clerbois">
<FluentPresenceBadge Status="PresenceStatus.Offline" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Tof Net" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.OutOfOffice" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Scott McPhierson">
<FluentPresenceBadge Status="PresenceStatus.Blocked" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>

<FluentAvatar Color="AvatarColor.Colorful" Name="Idris Baker" Shape="AvatarShape.Square">
<FluentPresenceBadge Status="PresenceStatus.Unknown" OutOfOffice="true" slot="@FluentSlot.Badge" />
</FluentAvatar>
</FluentStack>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<FluentStack HorizontalGap="5" Wrap="true" VerticalAlignment="VerticalAlignment.Center">
<FluentPresenceBadge Status="PresenceStatus.Available" Size="BadgeSize.Tiny" />
<FluentPresenceBadge Status="PresenceStatus.Available" Size="BadgeSize.ExtraSmall" />
<FluentPresenceBadge Status="PresenceStatus.Available" Size="BadgeSize.Small" />
<FluentPresenceBadge Status="PresenceStatus.Available" Size="BadgeSize.Medium" />
<FluentPresenceBadge Status="PresenceStatus.Available" Size="BadgeSize.Large" />
<FluentPresenceBadge Status="PresenceStatus.Available" Size="BadgeSize.ExtraLarge" />
</FluentStack>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<FluentStack HorizontalGap="5" Wrap="true">
<FluentPresenceBadge Status="PresenceStatus.Available" />
<FluentPresenceBadge Status="PresenceStatus.Away" />
<FluentPresenceBadge Status="PresenceStatus.Busy" />
<FluentPresenceBadge Status="PresenceStatus.DoNotDisturb" />
<FluentPresenceBadge Status="PresenceStatus.Offline" />
<FluentPresenceBadge Status="PresenceStatus.OutOfOffice" />
<FluentPresenceBadge Status="PresenceStatus.Blocked" />
<FluentPresenceBadge Status="PresenceStatus.Unknown" />
</FluentStack>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<FluentStack HorizontalGap="5" Wrap="true">
<FluentPresenceBadge Status="PresenceStatus.Available" OutOfOffice="true" />
<FluentPresenceBadge Status="PresenceStatus.Away" OutOfOffice="true" />
<FluentPresenceBadge Status="PresenceStatus.Busy" OutOfOffice="true" />
<FluentPresenceBadge Status="PresenceStatus.DoNotDisturb" OutOfOffice="true" />
<FluentPresenceBadge Status="PresenceStatus.Offline" OutOfOffice="true" />
<FluentPresenceBadge Status="PresenceStatus.OutOfOffice" OutOfOffice="true" />
<FluentPresenceBadge Status="PresenceStatus.Blocked" OutOfOffice="true" />
<FluentPresenceBadge Status="PresenceStatus.Unknown" OutOfOffice="true" />
</FluentStack>
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Presence Badge
route: /Badges/PresenceBadge
icon: PresenceAvailable
---


A presence badge is a badge that displays a status indicator such as available, away, or busy.

## Change strings used in the UI

The AppBar uses a string in the UI. It's value can be changed by leveraging the built-in [localization](/localization) functionality.
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation text states "The AppBar uses a string in the UI" but this is documentation for the PresenceBadge component, not the AppBar. The text should refer to PresenceBadge instead of AppBar.

Suggested change
The AppBar uses a string in the UI. It's value can be changed by leveraging the built-in [localization](/localization) functionality.
The PresenceBadge uses a string in the UI. Its value can be changed by leveraging the built-in [localization](/localization) functionality.

Copilot uses AI. Check for mistakes.
The following values can be localized (default value in brackets) :

- PresenceStatus_Available ("available")
- PresenceStatus_Away ("away")
- PresenceStatus_Blocked ("blocked")
- PresenceStatus_Busy ("busy")
- PresenceStatus_DoNotDisturb ("do not disturb")
- PresenceStatus_Offline ("offline")
- PresenceStatus_OutOfOffice ("out of office")
- PresenceStatus_Unknown ("unknown")

## Examples

### Default

{{ PresenceBadgeDefault }}

### Sizes

A presence badge supports all `BadgeSize` values. The default value is `BadgeSize.Medium`.

{{ PresenceBadgeSize }}

### Status

A presence badge status is set by mean of the `PresenceStatus` enumeration. See the documentation below for the possible values. The default is `PresenceStatus.Available`.

{{ PresenceBadgeStatus }}

### Out Of Office

A presence badge can indicate if a user is out of office by setting the `OutOfOffice` parameter to `true`. This will change the appearance of the badge to indicate the out of office status.

{{ PresenceBadgeStatusOOO }}

### On Avatar

The Avatar component is tailored to work with the PresenceBadge component. The PresenceBadge needs to be supplied as the `ChildContent` of the Avatar component.

{{ PresenceBadgeOnAvatar }}

### On Avatar with OutOfOffice

The Avatar component is tailored to work with the PresenceBadge component. The PresenceBadge needs to be supplied as the `ChildContent` of the Avatar component.

{{ PresenceBadgeOnAvatarOOO }}

## API FluentPresenceBadge

The PresenceBadge is a specialized Badge component and does **not** support the following parameters:

- Appearance
- BackgroundColor
- Color
- Content
- IconEnd
- IconLabel
- IconStart
- Shape

{{ API Type=FluentPresenceBadge }}
5 changes: 2 additions & 3 deletions src/Core/Components/Avatar/FluentAvatar.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
name="@GetNameValue"
shape="@Shape.ToAttributeValue()"
size="@Size.ToAttributeValue()"
slot="@Slot"
@onclick="@OnClickHandlerAsync"
@onkeydown="@OnKeyDownHandlerAsync"
@attributes="@AdditionalAttributes">

@if (DisplayImage)
{
<img alt="@Name"
role="presentation"
aria-hidden="true"
src="@Image" />
}

@if (DisplayIcon && Icon is not null)
{
@Icon.ToMarkup(size: GetAvatarSize, color: "currentcolor", backgroundColor: "unset")
}
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation: this line uses tabs while other lines in the file use spaces. For consistency, use the same indentation style (spaces) as the rest of the file.

Copilot uses AI. Check for mistakes.

@ChildContent

</fluent-avatar>
10 changes: 8 additions & 2 deletions src/Core/Components/Avatar/FluentAvatar.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public FluentAvatar(LibraryConfiguration configuration) : base(configuration) {

/// <summary>
/// Gets or sets the default icon. The icon will only be shown when there is no image or initials available.
/// </summary>
/// </summary>
[Parameter]
public Icon? Icon { get; set; }

Expand Down Expand Up @@ -94,6 +94,12 @@ public FluentAvatar(LibraryConfiguration configuration) : base(configuration) {
[Parameter]
public string? Tooltip { get; set; }

/// <summary>
/// Gets or sets the content to be rendered inside the component.
/// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }

/// <summary />
protected override async Task OnInitializedAsync()
{
Expand Down Expand Up @@ -138,7 +144,7 @@ Icon is not null

private string GetAvatarSize =>
Size is not null
? $"{(int)Size}px"
? $"{Size}px"
: "32px"; // Default component size

private string? GetActiveValue =>
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Components/Badge/FluentBadge.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected override void OnParametersSet()
}

/// <summary />
protected string GetIconColor()
protected virtual string GetIconColor()
{
return Color switch
{
Expand Down
24 changes: 24 additions & 0 deletions src/Core/Components/Badge/FluentPresenceBadge.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@namespace Microsoft.FluentUI.AspNetCore.Components
@using Microsoft.FluentUI.AspNetCore.Components.Extensions
@inherits FluentComponentBase

<AddTag Name="fluent-badge-container" TagWhen="@(() => _isAttached)">
@if (ChildContent is not null)
{
@*This is needed to make sure the Avatar renders the initials. It is doing something weird when we just render ChildContent unconditionally *@
@ChildContent
}
<fluent-badge id="@Id"
class="@ClassValue"
style="@StyleValue"
size="@Size.ToAttributeValue()"
positioning="@Positioning.ToAttributeValue()"
aria-label="@_ariaLabel"
@attributes="@AdditionalAttributes">
@if (Icon != null)
{
<FluentIcon Width="@($"{_iconWidth}px")" Value="@Icon" Slot="@FluentSlot.Start" Color="Components.Color.Custom" CustomColor="@GetIconColor()" Style="margin: -1px;" />
}
</fluent-badge>
</AddTag>

Loading
Loading