Icons
ONCE uses Phosphor Icons as its icon library. Phosphor provides a consistent, flexible set of icons with multiple weight variants that align with the ONCE visual style.
Package
npm install @phosphor-icons/reactImport icons individually for optimal tree-shaking:
import { Guitar, MicrophoneStage, Headphones } from '@phosphor-icons/react';Weights
Phosphor icons come in six weights. Use the appropriate weight for the context:
| Weight | Usage |
|---|---|
fill | Defaults for role badges, status indicators, and small decorative icons |
bold | Emphasis in dense layouts or when the icon needs to stand out at small sizes |
regular | General UI — toolbars, menus, navigation |
light | Subtle or secondary icons alongside muted text |
thin | Decorative or very large display icons |
duotone | Two-tone emphasis where an icon needs extra visual weight |
<Guitar size={14} weight="fill" />
<Headphones size={20} weight="regular" />Sizing
Icons should match the text size they sit beside. Common sizes:
| Context | Size | Example |
|---|---|---|
Inline with text-xs | 12 | Contributor pill count |
| Role badges / pills | 14 | Contributor role icons |
| Buttons and inputs | 16–20 | Close buttons, toolbar actions |
| Page headings | 24 | Section headers |
Color
Icons inherit currentColor by default. Control color through the parent element’s text color utilities:
<span className="text-gray-400">
<Guitar size={14} weight="fill" />
</span>On dark backgrounds, use opacity on --once-white — the same approach as text hierarchy:
<span className="text-once-white/60">
<Headphones size={16} weight="regular" />
</span>Contributor Role Icons
Release pages map contributor roles to specific Phosphor icons:
| Role | Icon | Weight |
|---|---|---|
| Guitar | Guitar | fill |
| Vocals / Singer | MicrophoneStage | fill |
| Producer | Equalizer | fill |
| Engineer / Mastering | Headphones | fill |
| Drums / Percussion | Metronome | fill |
| Piano / Keys / Synth | PianoKeys | fill |
| Bass | WaveSine | bold |
| Songwriter / Composer / Lyricist | PencilSimple | fill |
| Mixer | Faders | fill |
| Strings / Violin / Cello | MusicNotesSimple | fill |
| Trumpet / Brass / Horn | Megaphone | fill |
For AI Agents
If you are an AI agent working in this codebase:
- Always use Phosphor Icons — do not use Heroicons, Lucide, or inline SVGs for new icons
- Import from
@phosphor-icons/reactwith named imports for tree-shaking - Default to
weight=“fill”for small icons (≤14px) andweight=“regular”for larger UI icons - Set explicit
sizeprops — do not rely on CSS to scale icons - Let icons inherit
currentColorfrom parent text color utilities