Skip to content
Documentation

Badge

Display information with badges or labels

Overview
Miru dashboard in a light theme

The Badge component is a versatile and reusable component that allows us to display badges or labels in our app. We can customize it by passing various props to suit our component needs. In this guide, we’ll walk through how to use the Badge component in codebase.

Importing the Badge Component

To use the Badge component in our app, we need to import it from our styled components. Here’s how we can import it:

import { Badge } from "StyledComponents";

default badge

Using the Badge Component

The Badge component can be used with various props to control its appearance. Here are some examples of how we can use it:

<Badge
  text="Paid"
/>

with text

<Badge
  className="uppercase"
  text="Paid"
/>

with class

<Badge
  className="uppercase"
  bgColor="bg-emerald-100"
  text="Paid"
/>

with bgcolor

<Badge
  className="mt-2 uppercase"
  bgColor="bg-sky-100"
  color="text-sky-900"
  text="Paid"
/>

with bgcolor

<Badge
  className="bg-amber-100 text-amber-900 mt-2 uppercase"
  text="Paid"
/>

with class colors

Badge Component Props

NameDescriptionDefault Value
textProvide the name of the badge.Badge
colorSpecify the text color of the badge.text-purple-800
bgColorSpecify the background color of badge.bg-purple-100
classNameSpecify the extra style classes needed for Badge componentinline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold leading-4 tracking-widest
Try Miru

Read it once. Run it for real.

The docs explain the workflow. Miru gives you the actual timer, invoice, reports, and payment flow without another pile of tools.

Overview
Miru dashboard in a light theme
Workspace Miru
Start Tracking Free