Phosphor Icons
@c2n/phosphor-icons wraps every Phosphor icon as its own web component: c2-phosphor-<icon-name>.
Every icon supports the regular, thin, light, bold, fill, and duotone weights.
Generated from@phosphor-icons/core@2.1.1
Installation
npm install @c2n/phosphor-iconsImport
Import individual icons to keep bundles small:
import '@c2n/phosphor-icons/icons/heart.js'
import '@c2n/phosphor-icons/icons/camera.js'or register the whole set at once:
import '@c2n/phosphor-icons'Examples
<c2-phosphor-arrow-right></c2-phosphor-arrow-right>
<c2-phosphor-camera weight="thin"></c2-phosphor-camera>
<c2-phosphor-heart weight="fill"></c2-phosphor-heart>
<c2-phosphor-gear weight="duotone"></c2-phosphor-gear>Icons inherit currentColor and use the shared --c2-phosphor-icon--* custom properties.
<c2-phosphor-heart style="--c2-phosphor-icon--size: 48px; --c2-phosphor-icon--color: #dc2626"></c2-phosphor-heart>
<c2-phosphor-heart weight="thin" style="--c2-phosphor-icon--size: 48px"></c2-phosphor-heart>
<c2-phosphor-heart weight="duotone" style="--c2-phosphor-icon--size: 48px"></c2-phosphor-heart>Use the sliders button on an example, or select any icon in the gallery, to open that icon directly in the configuration studio with its selected weight.
API
Every icon element shares the same API.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
weight | PhosphorIconWeight | regular | Visual weight of the icon. |
CSS custom properties
Grouped by the element and state they target. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-phosphor-icon--size | pixel | 24px | |
--c2-phosphor-icon--color | color | currentColor | |
All icons
1,512 icons · select one to customize
No icon matches.
<c2-phosphor-heart></c2-phosphor-heart>