Install Phosphor with one line
The easiest way to add Phosphor to any HTML page is the CDN script. Paste this into
your <head> and every weight becomes available.
<script src="https://unpkg.com/@phosphor-icons/web"></script>
Now use an icon
Every icon is rendered with an <i> tag. The classes follow
the pattern ph-[weight] ph-[icon-name].
Regular is the default and uses just ph.
<i class="ph ph-house"></i> <i class="ph ph-envelope"></i> <i class="ph ph-gear"></i> <i class="ph ph-user"></i> <i class="ph ph-magnifying-glass"></i>
MagnifyingGlass on the website becomes ph-magnifying-glass in your HTML.
Thinner to bolder — the 6 weights
Phosphor ships the same icon in six visual weights. Change the class prefix to swap weights.
Going from ph-thin → ph-fill
is the same icon, just heavier.
<!-- lightest to heaviest --> <i class="ph-thin ph-star"></i> <i class="ph-light ph-star"></i> <i class="ph ph-star"></i> <!-- regular --> <i class="ph-bold ph-star"></i> <i class="ph-fill ph-star"></i> <i class="ph-duotone ph-star"></i>
• Thin / Light — elegant, editorial feel, large display sizes
• Regular — default UI work, body text alignment
• Bold — buttons, headings, small sizes where clarity matters
• Fill — "active" or "selected" states (e.g. filled heart = liked)
• Duotone — decorative, marketing, feature sections
Sizing with CSS font-size
Phosphor icons are fonts — they inherit the font-size of their parent,
just like text. No special size class needed.
<i class="ph ph-rocket" style="font-size: 3rem"></i> /* Or in your stylesheet */ .hero-icon { font-size: 4rem; }
Changing colors
Icons inherit color from their parent. Set color on the icon,
its wrapper, or a parent — it all just works.
/* inline */ <i class="ph-fill ph-heart" style="color: #ef4444"></i> /* in a stylesheet */ .icon-danger { color: #ef4444; } .icon-brand { color: var(--brand); } /* inherit from parent */ .btn { color: white; } /* icons inside go white too */
Duotone uses two colors
Duotone icons have a primary path and a secondary (lighter) path. Control them with
color and the CSS variable --ph-secondary-color
— or use the built-in opacity.
<i class="ph-duotone ph-cloud" style="color:#ec4899; --ph-secondary-color:#fbbf24; --ph-secondary-opacity:1;"></i>
Putting it together
A few common patterns — icons in buttons, lists, and headings.
- Fast, tree-shakeable icon library
- Six distinct weights for any design
- MIT licensed — free for any project
<button class="btn"> <i class="ph-bold ph-download-simple"></i> Download </button>
Browse available icons
Search this mini library of 90+ popular icons — type to filter, change the weight dropdown, and click any tile to copy its HTML.
Quick reference
<!-- 1. Load once in <head> --> <script src="https://unpkg.com/@phosphor-icons/web"></script> <!-- 2. Anywhere in <body> --> <i class="ph ph-house"></i> <!-- Weights: thin | light | (blank = regular) | bold | fill | duotone --> <i class="ph-thin ph-star"></i> <i class="ph-light ph-star"></i> <i class="ph ph-star"></i> <i class="ph-bold ph-star"></i> <i class="ph-fill ph-star"></i> <i class="ph-duotone ph-star"></i> /* Size = font-size, color = color */ .icon { font-size: 2rem; color: #10b981; } /* Duotone secondary layer */ .icon-duo { color: hotpink; --ph-secondary-color: gold; --ph-secondary-opacity: 1; }