LayerwiseLayerwise
  • Features
  • Pricing
  • Templates
  • Docs
DownloadDownload
FeaturesPricingTemplatesDocsAI Website BuilderVibe CodingPersonal Software
DownloadDownload
  1. Glossary
  2. /
  3. Components

Badge

Also called pill, status badge, or notification badge

A small rounded label that marks a status or a count, like New, Beta, Failed, or the red number on an inbox icon.

import { motion } from 'motion/react';

// The word carries the meaning too, so it reads without the color.
const STATUS = {
  live: 'bg-emerald-500/15 text-emerald-700 dark:text-emerald-300',
  beta: 'bg-violet-500/15 text-violet-700 dark:text-violet-300',
  failed: 'bg-red-500/15 text-red-700 dark:text-red-300'
};
const PILL = 'rounded-full px-2 py-0.5 text-xs font-medium capitalize';
// A quick, springy pop when the count changes draws the eye without shouting.
const BUMP = { type: 'spring', stiffness: 600, damping: 15 } as const;

type Props = { name: string; status: keyof typeof STATUS; unread: number };

export function ProjectHeader({ name, status, unread }: Props) {
  return (
    <header className='flex w-96 items-center justify-between'>
      <div className='flex items-center gap-2'>
        <h2 className='font-semibold'>{name}</h2>
        <span className={`${PILL} ${STATUS[status]}`}>{status}</span>
      </div>
      <button
        type='button'
        aria-label={`Notifications, ${unread} unread`}
        className='relative rounded-lg p-2 hover:bg-muted'
      >
        <svg
          viewBox='0 0 24 24'
          aria-hidden='true'
          className='size-5 fill-none stroke-current stroke-[1.75]'
        >
          <path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9' />
          <path d='M10.3 21a1.94 1.94 0 0 0 3.4 0' />
        </svg>
        {unread > 0 && (
          // A new key remounts the badge, which replays the pop. Hidden at 0, capped at 99+.
          <motion.span
            key={unread}
            initial={{ scale: 1.2 }}
            animate={{ scale: 1 }}
            transition={BUMP}
            aria-hidden='true'
            className='absolute top-0.5 right-0.5 min-w-4.5 rounded-full bg-red-600 px-1 text-[11px] leading-4.5 font-semibold text-white tabular-nums'
          >
            {unread > 99 ? '99+' : unread}
          </motion.span>
        )}
      </button>
    </header>
  );
}
Add a notification badge to the bell icon in the header: a red circle on its top-right corner showing the unread count, hidden at 0 and capped at 99+. When the count changes, pop it to 1.2× scale and back with a spring over about 200ms. Also give each project row a status badge (Live in green, Beta in purple, Failed in red) as a small rounded pill with 12px text.

Paste into Layerwise or any AI coding tool.

What is Badge?

A badge is a word or number in a small, rounded container. Status badges sit next to an item and describe it (New, Beta, Paid, Failed), with a color that matches the meaning. Count badges sit on the corner of an icon and show how many unread messages or notifications are waiting.

Use badges sparingly so they stay noticeable. Keep the text to one or two words, hide a count badge at zero, and cap large counts at “99+”. Let the word carry the meaning as well as the color, so people who cannot tell red from green still understand it.

When a count changes, a quick bump to about 1.2× scale for 150 to 200ms draws the eye without being loud. Badges are read-only labels; if clicking one should do something, use a button or a removable chip instead.

Often confused with

Tag input
Chips in a tag input are values a person typed and can remove. A badge is a read-only label the app shows about an item.

Related terms

All terms

Avatar stack

A row of overlapping profile pictures that shows who is on a project or in a document, with a +3 counter for everyone who doesn’t fit.

Pop in

An entrance animation where an element scales up past its full size and settles back, giving it a quick, springy arrival.

Pulse animation

A soft, repeating beat or expanding ring that draws the eye to a live status, a new notification, or something that needs attention.

Color contrast

How much text stands out from its background, measured as a ratio from 1:1 to 21:1 and checked against the WCAG levels AA and AAA.

Build it with Layerwise

Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.

DownloadDownloadRead the docs
LayerwiseLayerwise

Build full-stack web apps in minutes with AI.

Product

  • Features
  • Pricing
  • Download
  • Templates

Solutions

  • AI Website Builder
  • Vibe Coding
  • Personal Software

Resources

  • Documentation
  • Changelog
  • Blog
  • Vibe Coding Glossary
  • llms.txt
  • llms-full.txt

Company

  • About
  • Contact

Legal

  • Privacy
  • Analytics Privacy
  • Terms
  • Security
  • Abuse

© 2026 Layerwise. All rights reserved.

Entrances & exits

  • Fade in
  • Slide in
  • Scale in
  • Pop in
  • Blur in
  • Reveal animation
  • Enter and exit animations

Timing & sequencing

  • Duration
  • Delay
  • Keyframes
  • Tweening
  • Stagger
  • Orchestration
  • Fill mode
  • Stepped animation
  • Looping animation
  • Yoyo animation

Easing

  • Easing
  • Linear easing
  • Ease-in
  • Ease-out
  • Ease-in-out
  • Cubic-bezier
  • Asymmetric easing
  • Overshoot easing

Springs & physics

  • Spring animation
  • Stiffness
  • Damping
  • Mass
  • Bounce
  • Velocity
  • Momentum
  • Interruptible animation
  • Rubber-banding

Transforms

  • Translate
  • Scale
  • Rotate
  • Skew
  • 3D flip
  • Perspective
  • Transform origin
  • Origin-aware animation

State transitions

  • Crossfade
  • Morph
  • Shared element transition
  • Layout animation
  • Height auto animation
  • Direction-aware transition
  • Continuity transition
  • Page transition
  • View Transitions API

Scroll effects

  • Scroll reveal
  • Scroll-driven animation
  • Parallax scrolling
  • Scrollytelling
  • Scroll pinning
  • Horizontal scroll section
  • Scroll progress bar
  • Scroll snap
  • Smooth scrolling

Interaction feedback

  • Hover effect
  • Press feedback
  • Ripple effect
  • Shake animation
  • Hold to confirm
  • Drag gesture
  • Drag to reorder
  • Swipe to dismiss
  • Pull to refresh
  • Magnetic button
  • Custom cursor
  • 3D tilt card
  • Spotlight card

Text effects

  • Typewriter effect
  • Text scramble
  • Split text animation
  • Text morph
  • Rotating words
  • Gradient text
  • Shimmer text
  • Number ticker
  • Tabular numbers
  • Underline animation

Loops & ambient motion

  • Marquee
  • Pulse animation
  • Float animation
  • Orbit animation
  • Idle animation
  • Particle background
  • Border beam
  • Confetti
  • Animated gradient

Visual effects

  • Blur
  • Clip-path
  • Mask
  • Before/after slider
  • SVG line drawing
  • Lottie animation

Motion principles

  • Purposeful animation
  • Anticipation
  • Follow-through
  • Squash and stretch
  • Perceived performance
  • Frequency of use
  • Spatial consistency
  • Reduced motion

Animation performance

  • Frame rate (FPS)
  • Jank
  • GPU acceleration
  • will-change
  • Layout thrashing

Layout

  • Hero section
  • Above the fold
  • Sticky header
  • Sidebar
  • Bento grid
  • Card
  • Flexbox
  • CSS Grid
  • Padding vs margin
  • Responsive design
  • Container
  • Masonry layout
  • Split screen
  • Z-index
  • Overflow

Components

  • Button variants
  • Modal
  • Drawer
  • Popover
  • Tooltip
  • Dropdown menu
  • Context menu
  • Toast notification
  • Tabs
  • Segmented control
  • Accordion
  • Carousel
  • Command palette
  • Combobox
  • Toggle switch
  • Checkbox
  • Radio button
  • Date picker
  • Breadcrumb
  • Pagination
  • Infinite scroll
  • Badge
  • Avatar stack
  • Empty state
  • Skeleton screen
  • Spinner
  • Progress bar
  • Data table
  • Stepper
  • Floating label
  • Inline validation
  • Alert banner
  • Tag input

States & patterns

  • Interaction states
  • Focus ring
  • Loading state
  • Optimistic UI
  • Debounce
  • Lazy loading
  • Dark mode
  • Micro-interaction
  • Affordance
  • Undo
  • Drag and drop
  • Keyboard shortcut

Visual styles

  • Glassmorphism
  • Liquid glass
  • Neumorphism
  • Claymorphism
  • Neo-brutalism
  • Skeuomorphism
  • Flat design
  • Mesh gradient
  • Aurora background
  • Grain texture
  • Glow effect
  • Drop shadow
  • Border radius
  • Grid background
  • Typographic hierarchy
  • Accent color
  • Color contrast

Vibe coding & AI

  • Vibe coding
  • Prompt
  • Context window
  • Token
  • AI agent
  • Tool call
  • Hallucination
  • Diff
  • Live preview
  • Checkpoint
  • Git commit
  • Deploy
  • Frontend and backend
  • API
  • Database
  • Rules file
  • MCP
  • Plan mode
  • Visual edit
Projects
  • Landing pageNew
  • Checkout flowBeta
  • Payments APIBuilding