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/react

Import 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:

WeightUsage
fillDefaults for role badges, status indicators, and small decorative icons
boldEmphasis in dense layouts or when the icon needs to stand out at small sizes
regularGeneral UI — toolbars, menus, navigation
lightSubtle or secondary icons alongside muted text
thinDecorative or very large display icons
duotoneTwo-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:

ContextSizeExample
Inline with text-xs12Contributor pill count
Role badges / pills14Contributor role icons
Buttons and inputs1620Close buttons, toolbar actions
Page headings24Section 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:

RoleIconWeight
GuitarGuitarfill
Vocals / SingerMicrophoneStagefill
ProducerEqualizerfill
Engineer / MasteringHeadphonesfill
Drums / PercussionMetronomefill
Piano / Keys / SynthPianoKeysfill
BassWaveSinebold
Songwriter / Composer / LyricistPencilSimplefill
MixerFadersfill
Strings / Violin / CelloMusicNotesSimplefill
Trumpet / Brass / HornMegaphonefill

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/react with named imports for tree-shaking
  • Default to weight=“fill” for small icons (≤14px) and weight=“regular” for larger UI icons
  • Set explicit size props — do not rely on CSS to scale icons
  • Let icons inherit currentColor from parent text color utilities