Badge
A compact indicator component for displaying counts, status, or labels
A compact component for displaying counts, status indicators, or labels.
When to use this
- Notification counts: Show unread message or notification counts
- Status indicators: Display online/offline status or alert levels
- Labels: Attach categorical labels to other UI elements
- Counters: Show numerical values in a compact format
Basic implementation
Basic implementation
import 'package:flutter/material.dart';
import 'package:remix/remix.dart';
class BadgeExample extends StatelessWidget {
const BadgeExample({super.key});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 16,
children: [
RemixBadge(
label: '8',
style: styleLabel,
),
RemixBadge(
style: styleIcon,
child: const Icon(Icons.camera_alt),
),
],
);
}
RemixBadgeStyle get styleLabel {
return RemixBadgeStyle()
.size(24, 24)
.wrapClipOval()
.label(
TextStyler()
.fontSize(15)
.wrapAlign(Alignment.center)
.fontFeatures([const FontFeature.tabularFigures()]),
)
.textColor(Colors.greenAccent.shade700)
.labelColor(Colors.white)
.labelFontWeight(FontWeight.bold)
.labelFontSize(15);
}
RemixBadgeStyle get styleIcon {
return RemixBadgeStyle()
.size(24, 24)
.wrapClipOval()
.label(
TextStyler()
.fontSize(15)
.wrapAlign(Alignment.center)
.fontFeatures([const FontFeature.tabularFigures()]),
)
.textColor(Colors.redAccent)
.wrapIconTheme(const IconThemeData(color: Colors.white, size: 15));
}
}
Fortal styles
Remix includes Fortal-themed style helpers for this component:
Fortal variants
import 'package:flutter/material.dart';
import 'package:remix/remix.dart';
class FortalBadgeExample extends StatelessWidget {
const FortalBadgeExample({super.key});
@override
Widget build(BuildContext context) {
return Row(
spacing: 16,
children: [
RemixBadge(
label: '5',
style: FortalBadgeStyle.solid(),
),
RemixBadge(
label: 'New',
style: FortalBadgeStyle.soft(),
),
],
);
}
}
See the FortalBadgeStyle source code for all available options.
Constructor
Constructor
const RemixBadge({
Key? key,
Widget? child,
String? label,
RemixBadgeLabelBuilder? labelBuilder,
RemixBadgeStyle style = const RemixBadgeStyle.create(),
RemixBadgeSpec? styleSpec,
})
child → Widget?
Optional. Optional fully custom badge content. When provided the badge style is applied only to the container.

