A role badge needs an explanation that remains accessible outside its colour coding. Keep its display separate from authorization decisions.
Worked example
// components/RoleBadgeWithExplanation.tsx
export default function RoleBadgeWithExplanation({
name = "Mira Bell",
role = "Editor",
}: { name?: string; role?: string } = {}) {
return <abbr title={name + " has the " + role + " role"}>{role}</abbr>;
}Implementation notes
Badges describe a user's role as seen by the interface. The server must still authorize actions based on current permissions.
Try it yourself
Change the label in the view and verify that permissions are enforced elsewhere.
Open the React example →Editorial date April 17, 2026 · Published December 6, 2026