# Components Badge: Square Badge

A badge with sharp square corners and a compact footprint. Use it for crisp version tags, counts, or labels that suit a structured grid layout.

- Page: https://www.shadcn-ui-blocks.com/blocks/components/badges/square-badge
- Collection: [Components](https://www.shadcn-ui-blocks.com/blocks/components), Free tier
- Group: [Badges](https://www.shadcn-ui-blocks.com/blocks/components/badges)
- Created: 2026-06-14
- Preview image: https://www.shadcn-ui-blocks.com/blocks/components/badges/square-badge.png

## Install

```bash
npx shadcn@latest add @shadcn-ui-blocks/components-badges-square-badge
```

A free block: it installs with no account or key. Or install it by URL: `npx shadcn@latest add "https://www.shadcn-ui-blocks.com/r/components-badges-square-badge.json"`.

## Depends on

- npm packages: class-variance-authority, radix-ui
- shadcn/ui components: badge
- Installs to: `@/components/blocks/components/badges/square-badge`

## About this block

Square Badge renders four badge variants side by side in a centered,
wrapping row. Each badge carries sharp square corners and a short label:
Default (filled), Secondary (muted fill), Destructive (alert fill), and
Outline (bordered with no fill). The result is a tight horizontal cluster
that shows every tone available in the badge set at once.

All four variants are independent. You can drop in just the one or two
tones your interface actually needs, swap the label text, or reorder the
row. Nothing in the layout depends on having all four present, so removing
an unused variant takes one line.

## When to use

Reach for this block when you need clean, rectilinear labels that sit flush
inside a structured grid or data table. The flat corners suit an AI
assistant product where the UI favors precision over softness: model
version tags, response confidence levels, tool status labels, and similar
metadata read clearly without rounded styling introducing visual noise.
Compared to the [Elevated Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/elevated-badge)
or [3D Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/3d-badge), this variant stays
flat and assertive, which works well when many badges appear in the same
view at once.

A natural flow around it on a Components page:

**Before**

- [Buttons](https://www.shadcn-ui-blocks.com/blocks/components/buttons) to establish the core interactive
  palette before introducing purely informational labels
- A short section header or description row to give the badges context

**After**

- [Cards](https://www.shadcn-ui-blocks.com/blocks/components/cards) where the square badges can appear
  as inline status or category tags inside each card
- [Tabs](https://www.shadcn-ui-blocks.com/blocks/components/tabs) when the interface organizes content
  into sections and the badges need to reflect active states

## What you can customize

Each badge is an independent label you can tune for your product:

- **Label text.** Replace "Default", "Secondary", and the rest with your
  own terms such as model names, confidence tiers, or pipeline stages.
- **Variant selection.** Keep only the fill tones your design uses and
  remove the others so the row stays uncluttered.
- **Order and count.** Rearrange the badges or add new ones to cover
  additional states without changing the wrapping row layout.

> Tip: pair the Destructive variant sparingly alongside the others so its
> alert tone retains meaning and does not blend into routine labels.

## More in Components Badges

- [3D Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/3d-badge)
- [Bounce Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/bounce-badge)
- [Dot Indicator Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/dot-indicator-badge)
- [Elevated Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/elevated-badge)
- [Extra Large Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/extra-large-badge)
- [Gradient Border Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/gradient-border-badge)
- [Hover Scale Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/hover-scale-badge)
- [Icon Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/icon-badge)
- [Large Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/large-badge)
- [Pulse Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/pulse-badge)
- [Ribbon Badge](https://www.shadcn-ui-blocks.com/blocks/components/badges/ribbon-badge)
