BOBBadge
Compact label for status, counts, or tags. Circular, dot-only, or with content — use it anywhere.
API reference ↗Basic usage
RAZOR
<BOBBadge>New</BOBBadge>
<BOBBadge>12</BOBBadge>
<BOBBadge>
<BOBSvgIcon Icon="@BOBIconKeys.MaterialIconsOutlined.i_star" Size="BOBSize.Small" />
Featured
</BOBBadge>Dot badge
An empty badge renders as a dot — perfect as an unread indicator.
RAZOR
<BOBBadge />
<BOBBadge BackgroundColor="@PaletteColor.Success" />
<BOBBadge BackgroundColor="@PaletteColor.Warning" />
<BOBBadge BackgroundColor="@PaletteColor.Error" />Circular
Use Circular for single-digit or icon badges.
RAZOR
<BOBBadge Circular="true">1</BOBBadge>
<BOBBadge Circular="true" BackgroundColor="@PaletteColor.Success">9</BOBBadge>
<BOBBadge Circular="true" BackgroundColor="@PaletteColor.Error">!</BOBBadge>Colors
RAZOR
<BOBBadge BackgroundColor="@PaletteColor.Primary" Color="@PaletteColor.PrimaryContrast">Primary</BOBBadge>
<BOBBadge BackgroundColor="@PaletteColor.Success" Color="@PaletteColor.SuccessContrast">Success</BOBBadge>
<BOBBadge BackgroundColor="@PaletteColor.Warning" Color="@PaletteColor.WarningContrast">Warning</BOBBadge>
<BOBBadge BackgroundColor="@PaletteColor.Error" Color="@PaletteColor.ErrorContrast">Error</BOBBadge>
<BOBBadge BackgroundColor="@PaletteColor.Info" Color="@PaletteColor.InfoContrast">Info</BOBBadge>Shadow & Border
RAZOR
<BOBBadge Shadow="@BOBShadowPresets.Elevation(3)">Elevated</BOBBadge>
<BOBBadge Border="@BOBBorderPresets.Pill" BackgroundColor="@PaletteColor.Primary" Color="@PaletteColor.PrimaryContrast">Pill</BOBBadge>
<BOBBadge Border="@BOBBorderPresets.RoundedLarge" BackgroundColor="@PaletteColor.Secondary" Color="@PaletteColor.SecondaryContrast">Rounded</BOBBadge>
<BOBBadge Border="@BOBBorderPresets.Default">Bordered</BOBBadge>Notification badge
BOBNotificationBadge overlays a badge onto any child content.
RAZOR
<BOBNotificationBadge>
<ChildContent>
<BOBButton BackgroundColor="@PaletteColor.Secondary" Text="Messages" LeadingIcon="@BOBIconKeys.MaterialIconsOutlined.i_mail" />
</ChildContent>
<BadgeContent>4</BadgeContent>
</BOBNotificationBadge>
<BOBNotificationBadge>
<ChildContent>
<BOBButton BackgroundColor="@PaletteColor.Warning" Text="Inbox" LeadingIcon="@BOBIconKeys.MaterialIconsOutlined.i_inbox" />
</ChildContent>
<BadgeContent>99+</BadgeContent>
</BOBNotificationBadge>
<BOBNotificationBadge>
<ChildContent>
<BOBButton BackgroundColor="@BOBColor.Chocolate.Darken2.ToString(ColorOutputFormats.Hex)" Text="Alerts" LeadingIcon="@BOBIconKeys.MaterialIconsOutlined.i_notifications" />
</ChildContent>
</BOBNotificationBadge>Properties
BOBBadge
7 rows.
| Property | Type | Default | Description |
|---|---|---|---|
ChildContent | RenderFragment? | | Content rendered inside the badge (typically a number or short label). |
Circular | bool | | When , the badge is forced to a circular shape; otherwise it adapts to its content. |
Size | BOBSize | BOBSize.Medium | Visual size of the badge. |
Color | string? | | Text color of the badge. Accepts any valid CSS color value. |
BackgroundColor | string? | | Background color of the badge. Accepts any valid CSS color value. |
Border | BorderStyle? | | Border style applied to the badge. |
Shadow | ShadowStyle? | | Shadow style applied to the badge. |
BOBNotificationBadge
9 rows.
| Property | Type | Default | Description |
|---|---|---|---|
ChildContent | RenderFragment? | | Content rendered inside the component. |
BadgeContent | RenderFragment? | | BadgeContent. |
Position | BadgePosition | BadgePosition.TopRight | Position. |
Circular | bool | true | Circular. |
Size | BOBSize | BOBSize.Small | Visual size of the component. |
Color | string? | | Text or foreground color. Accepts any valid CSS color value. |
BackgroundColor | string? | | Background color. Accepts any valid CSS color value. |
Border | BorderStyle? | | Border style applied to the component. |
Shadow | ShadowStyle? | | Shadow style applied to the component. |