Dev Helpers
← Back

Role badge with explanation

Import and render <RoleBadgeWithExplanation /> in a React project.

Open this example in the interactive library

Live preview

Source code

// 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>;
}