Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Nettalco/nettalco-theme/llms.txt

Use this file to discover all available pages before exploring further.

Overview

p-badge renders a small pill-shaped counter or a dot indicator, commonly overlaid on buttons, avatars, or navigation icons to signal pending items or status. The Nettalco preset provides four size variants (sm, default, lg, xl) and seven color severities that resolve through the same semantic token layer used by tags, toasts, and messages — ensuring visual consistency across the entire application.

Usage

Number Badge

<!-- Standalone numeric badge -->
<p-badge value="5" />
<p-badge value="99+" severity="danger" />

<!-- Different sizes -->
<p-badge value="3" size="small"  severity="info" />
<p-badge value="3"               severity="success" />
<p-badge value="3" size="large"  severity="warn" />
<p-badge value="3" size="xlarge" severity="danger" />

Dot Badge (no number)

<!-- Dot badge — use empty value or omit value entirely -->
<p-badge />
<p-badge severity="success" />
<p-badge severity="warn" />
<p-badge severity="danger" />

Overlay Badge on a Button

<p-overlaybadge value="4" severity="danger">
  <button pButton icon="pi pi-bell" [rounded]="true" outlined />
</p-overlaybadge>

Overlay Badge on an Avatar

<p-overlaybadge value="2" severity="success">
  <p-avatar label="JD" shape="circle" size="large" />
</p-overlaybadge>

All Severities

<p-badge value="1" severity="primary"   />
<p-badge value="2" severity="secondary" />
<p-badge value="3" severity="success"   />
<p-badge value="4" severity="info"      />
<p-badge value="5" severity="warn"      />
<p-badge value="6" severity="danger"    />
<p-badge value="7" severity="contrast"  />

Design Tokens

Defined in src/lib/theme/badge/index.ts:

Root (Default Size)

TokenValue
root.borderRadius{border.radius.md}
root.padding0 0.5rem
root.fontSize0.75rem
root.fontWeight700
root.minWidth1.5rem
root.height1.5rem

Dot

TokenValue
dot.size0.5rem

Size Variants

SizeTokenFont SizeMin WidthHeight
Smallsm0.625rem1.25rem1.25rem
Default0.75rem1.5rem1.5rem
Largelg0.875rem1.75rem1.75rem
Extra Largexl1rem2rem2rem

Color Scheme — Light Mode

SeverityBackgroundText Color
primary{primary.color}{primary.contrast.color}
secondary{surface.100}{surface.600}
success{success.color}{success.contrast.color}
info{info.color}{info.contrast.color}
warn{warn.color}{warn.contrast.color}
danger{error.color}{error.contrast.color}
contrast{surface.950}{surface.0}

Color Scheme — Dark Mode

SeverityBackgroundText Color
primary{primary.color}{primary.contrast.color}
secondary{surface.800}{surface.300}
success{success.color}{success.contrast.color}
info{info.color}{info.contrast.color}
warn{warn.color}{warn.contrast.color}
danger{error.color}{error.contrast.color}
contrast{surface.0}{surface.950}

Nettalco Semantic Color Mappings

Badge severity backgrounds use {severity.color} — the resolved semantic color value — rather than a specific palette step. This ensures the badge background matches the exact brand color used in buttons and other solid-fill elements.
Severitycolor token resolves toHex (light)Contrast (light)
success{success.color}nettalcoSuccess.500#2BA5CD#ffffff
info{info.color}nettalcoInfo.500#66A6FB#ffffff
warn{warn.color}nettalcoWarn.500#D57952#ffffff
danger{error.color}red.500#ef4444#ffffff
All contrast colors are white (#ffffff) in light mode by the colorScheme.light.*.contrastColor definitions. In dark mode the success contrast resolves to {success.contrast.color} = {success.800} = #0C3D5C (dark cyan), and warn contrast resolves to {warn.950} = #5C3E1A.

Build docs developers (and LLMs) love