Mochi Icons
DOCS · 03 / 07

Styling

Change size, colour and stroke with props, CSS or Tailwind.

Two kinds of icons

Mochi Icons come in two kinds. How you colour an icon depends on its kind.

KINDCOLOURSCAN YOU RECOLOUR IT?
MulticolourOriginal palette with a selectable accentYes, with primaryColor on supported Sticker and Pixels icons.
MonochromeOne colourYes, with color or CSS.

Sticker and Pixels are icon families. Multicolour icons preserve their original palette unless you select a theme accent.

Size

Use the size prop, or set the width and height with CSS. CSS wins over the prop.

SIZE
<WifiIcon size={32} />

{/* Tailwind */}
<WifiIcon className="size-12" />

{/* Plain CSS */}
<WifiIcon style={{ width: 48, height: 48 }} />

Primary colour (Sticker and Pixels)

Match your theme with primaryColor. Each icon has a selected accent area: Houseplant changes its leaves and keeps its terracotta pot; Camera changes its body and keeps its blue lens. Omit the prop to keep the original palette.

Pixels supports the same prop, for example <CameraPixelIcon primaryColor="#8B5CF6" />. FigmaPixel, RainbowPixel and PoolBallPixel preserve their original palettes.

PRIMARY COLOR
<HouseplantIcon />
<HouseplantIcon primaryColor="#8B5CF6" />
<HouseplantIcon primaryColor="#26B" />
<HouseplantIcon primaryColor="var(--primary)" />
<HouseplantIcon primaryColor="currentColor" />

Three- and six-digit hex colors produce standalone SVG paints. CSS variables and named colors use color-mix() for tonal variations, which requires browser support. Google, Instagram and Rainbow keep their defining multicolor palettes. Try the color controls in the library drawer; copied JSX and SVG downloads match your selection.

Colour (monochrome icons)

A monochrome icon uses the text colour around it. So if the text is red, the icon is red too. You can also set it yourself.

COLOUR
{/* Follows the text colour of its parent */}
<p style={{ color: "tomato" }}>
  <SomeIcon /> Saved
</p>

{/* Set it directly */}
<SomeIcon color="#2C3E5C" />

{/* Tailwind */}
<SomeIcon className="text-emerald-600" />

To make the lines thinner or thicker, use strokeWidth. The default is 2.

STROKE
<SomeIcon strokeWidth={1.5} />

Line up an icon with text

Put the icon and the text in a flex row. This keeps them centred on the same line.

All done
ALIGN
<span style={{ display: "inline-flex", alignItems: "center", gap: 8 }}>
  <CheckIcon size={22} />
  All done
</span>

Want the icon to scale with the font size? Use size="1em".

Hover and animation

Icons are plain <svg> elements, so normal CSS works: transitions, transforms and hover states.

HOVER
import { BellIcon } from "mochi-icons/BellIcon";

<BellIcon className="transition-transform hover:rotate-12" />

A LITTLE SUPPORT GOES A LONG WAY

Love the icons?

Your contribution helps keep the icons free, pay for infrastructure, and bring more features to life.

Every contribution is optional. The icons stay free for everyone.

Choose your amount at checkout. One-time contribution.