Configure default icon styles with IconContext
masterUse IconContext.Provider to apply default styles (color, size, weight, etc.) to all icons within a specific part of your component tree. Icons will use the nearest IconContext provider above them.
import { IconContext, HorseIcon, HeartIcon, CubeIcon } from "@phosphor-icons/react";
const App = () => {
return (
<IconContext.Provider
value={{
color: "limegreen",
size: 32,
weight: "bold",
mirrored: false,
}}
>
<div>
<HorseIcon /> {/* I'm lime-green, 32px, and bold! */}
<HeartIcon /> {/* Me too! */}
<CubeIcon /> {/* Me three :) */}
</div>
</IconContext.Provider>
);
};