gentleface

Gentleface › How to use

How to use Gentleface icons

Every icon page has its code ready to copy in every format below, for any of the 6 styles. The code is self-contained. Or install the npm packages.

npm

Version 0.6.0. React components, tree-shakable, each with all 6 styles:

npm i @gentleface/react
import { BellIcon, GentlefaceProvider } from '@gentleface/react';

<BellIcon />                                  // 16 px, line-round
<BellIcon variant="solid-sharp" size={32} />
<BellIcon title="Notifications" />            // an accessible name
<GentlefaceProvider variant="line-soft">…</GentlefaceProvider>

The 20 and 24 px drawings are in their own entry points, with the same names. At 24 there are three weights:

import { BellIcon } from '@gentleface/react-24';   // or '@gentleface/react-20'

<BellIcon />                                  // 24 px, regular (1.5 px line)
<BellIcon weight="light" />                   // 1 px; "bold" is 2 px
<BellIcon size={48} />

The files and data: npm i @gentleface/icons gives svg/<style>/16/<name>.svg, sprite/<style>.svg, iconify.json and the metadata. CDN: https://cdn.jsdelivr.net/npm/@gentleface/icons@0.6.0/svg/{style}/16/{name}.svg. @gentleface/icons-20 and @gentleface/icons-24 have the 20 and 24 px SVGs: svg/<style>/<name>.svg, and at 24 also svg/<style>-light/ and svg/<style>-bold/. CDN: https://cdn.jsdelivr.net/npm/@gentleface/icons-24@0.6.0/svg/{style}/{name}.svg.

Keep them crisp

Each icon is drawn on the 16 px grid, and most also on the 20 and 24 px grids: the Grid switch in the header shows them, and at 24 the Weight switch picks light (1 px), regular (1.5 px) or bold (2 px). Show the drawing made for your size, or an exact multiple of it, on whole pixels: 16 for 16 and 32 px, 20 for 20 and 40, 24 for 24 and 48. A size in between like 18 px, a position like 7.5 px (centring a 16 px icon in a 31 px box) or a transform blurs every edge.

The code on each icon page is the 16 px drawing. The icon page's SVG and PNG downloads follow the Grid switch, and npm has the 20 and 24 px drawings too.

Accessibility

The snippets are decorative (aria-hidden). For an icon that carries meaning on its own, such as an icon-only button, label the button, or give the SVG role="img" and an aria-label.

Inline SVG

The SVG uses fill="currentColor", so it takes the text color.

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M5.5 10.793L12.146 4.146C12.246 4.047 12.364 3.997 12.5 3.997C12.636 3.997 12.754 4.047 12.854 4.146C12.951 4.244 13 4.362 13 4.5C13 4.638 12.951 4.756 12.854 4.854L5.854 11.854C5.754 11.953 5.636 12.003 5.5 12.003C5.364 12.003 5.246 11.953 5.146 11.854L2.146 8.854C2.047 8.754 1.997 8.636 1.997 8.5C1.997 8.364 2.047 8.246 2.146 8.146C2.244 8.049 2.362 8 2.5 8C2.638 8 2.756 8.049 2.854 8.146L5.5 10.793Z"/></svg>

React, Vue, Svelte

Each icon page gives a component. React example:

// Gentleface "check" (line-round), MIT. https://gentleface.com/icons/check
import type { SVGProps } from 'react';

export function CheckIcon(props: SVGProps<SVGSVGElement>) {
  return (
    <svg xmlns="http://www.w3.org/2000/svg" width={16} height={16} viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" {...props}>
      <path d="M5.5 10.793L12.146 4.146C12.246 4.047 12.364 3.997 12.5 3.997C12.636 3.997 12.754 4.047 12.854 4.146C12.951 4.244 13 4.362 13 4.5C13 4.638 12.951 4.756 12.854 4.854L5.854 11.854C5.754 11.953 5.636 12.003 5.5 12.003C5.364 12.003 5.246 11.953 5.146 11.854L2.146 8.854C2.047 8.754 1.997 8.636 1.997 8.5C1.997 8.364 2.047 8.246 2.146 8.146C2.244 8.049 2.362 8 2.5 8C2.638 8 2.756 8.049 2.854 8.146L5.5 10.793Z" />
    </svg>
  );
}

Animated

1,000 icons also come as one SVG file with native animation: no library, no CSS, no script. Examples and helper, or browse them.

Many icons at once

  • SVG sprite, one file per style: /sprite/line-round.svg, /sprite/line-soft.svg, /sprite/line-sharp.svg, /sprite/solid-round.svg, /sprite/solid-soft.svg, /sprite/solid-sharp.svg. Serve it from your own origin and reference icons by name:
    <!-- Gentleface "check" (line-round), MIT. https://gentleface.com/icons/check
         Every icon of this style in one file: https://gentleface.com/sprite/line-round.svg
         Serve it from your own origin: <use> does not load from another origin. -->
    <svg width="16" height="16" aria-hidden="true"><use href="/sprite/line-round.svg#check"/></svg>
  • Iconify JSON: /iconify/gentleface.json, prefix gentleface. Line-round names are bare (gentleface:check). The other styles add a suffix: -soft, -sharp, -solid, -solid-soft, -solid-sharp. Load it with addCollection() from @iconify/react or another Iconify package, or as a custom collection in unplugin-icons, UnoCSS or the Tailwind Iconify plugin.
  • ZIP: /gentleface-svg.zip has every SVG, the sprites, the Iconify JSON and the license. /gentleface-png.zip has every PNG.

CSS

A mask takes the text color, so the icon can live in a stylesheet:

/* Gentleface "check" (line-round), MIT. https://gentleface.com/icons/check. Takes the text color. */
.icon-check {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M5.5 10.793L12.146 4.146C12.246 4.047 12.364 3.997 12.5 3.997C12.636 3.997 12.754 4.047 12.854 4.146C12.951 4.244 13 4.362 13 4.5C13 4.638 12.951 4.756 12.854 4.854L5.854 11.854C5.754 11.953 5.636 12.003 5.5 12.003C5.364 12.003 5.246 11.953 5.146 11.854L2.146 8.854C2.047 8.754 1.997 8.636 1.997 8.5C1.997 8.364 2.047 8.246 2.146 8.146C2.244 8.049 2.362 8 2.5 8C2.638 8 2.756 8.049 2.854 8.146L5.5 10.793Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M5.5 10.793L12.146 4.146C12.246 4.047 12.364 3.997 12.5 3.997C12.636 3.997 12.754 4.047 12.854 4.146C12.951 4.244 13 4.362 13 4.5C13 4.638 12.951 4.756 12.854 4.854L5.854 11.854C5.754 11.953 5.636 12.003 5.5 12.003C5.364 12.003 5.246 11.953 5.146 11.854L2.146 8.854C2.047 8.754 1.997 8.636 1.997 8.5C1.997 8.364 2.047 8.246 2.146 8.146C2.244 8.049 2.362 8 2.5 8C2.638 8 2.756 8.049 2.854 8.146L5.5 10.793Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

PNG

Every style at 16, 32 and 48 px, rendered by the same rasterizer the icons are designed with: https://gentleface.com/png/{style}/{16|32|48}/{name}.png. Black on transparent.

SwiftUI

A Shape with the icon's own path. It needs no asset.

// Gentleface "check" (line-round), MIT. https://gentleface.com/icons/check
import SwiftUI

struct CheckIcon: Shape {
    func path(in rect: CGRect) -> Path {
        var p = Path()
        p.move(to: CGPoint(x: 5.5, y: 10.793))
        p.addLine(to: CGPoint(x: 12.146, y: 4.146))
        p.addCurve(to: CGPoint(x: 12.5, y: 3.997), control1: CGPoint(x: 12.246, y: 4.047), control2: CGPoint(x: 12.364, y: 3.997))
        p.addCurve(to: CGPoint(x: 12.854, y: 4.146), control1: CGPoint(x: 12.636, y: 3.997), control2: CGPoint(x: 12.754, y: 4.047))
        p.addCurve(to: CGPoint(x: 13, y: 4.5), control1: CGPoint(x: 12.951, y: 4.244), control2: CGPoint(x: 13, y: 4.362))
        p.addCurve(to: CGPoint(x: 12.854, y: 4.854), control1: CGPoint(x: 13, y: 4.638), control2: CGPoint(x: 12.951, y: 4.756))
        p.addLine(to: CGPoint(x: 5.854, y: 11.854))
        p.addCurve(to: CGPoint(x: 5.5, y: 12.003), control1: CGPoint(x: 5.754, y: 11.953), control2: CGPoint(x: 5.636, y: 12.003))
        p.addCurve(to: CGPoint(x: 5.146, y: 11.854), control1: CGPoint(x: 5.364, y: 12.003), control2: CGPoint(x: 5.246, y: 11.953))
        p.addLine(to: CGPoint(x: 2.146, y: 8.854))
        p.addCurve(to: CGPoint(x: 1.997, y: 8.5), control1: CGPoint(x: 2.047, y: 8.754), control2: CGPoint(x: 1.997, y: 8.636))
        p.addCurve(to: CGPoint(x: 2.146, y: 8.146), control1: CGPoint(x: 1.997, y: 8.364), control2: CGPoint(x: 2.047, y: 8.246))
        p.addCurve(to: CGPoint(x: 2.5, y: 8), control1: CGPoint(x: 2.244, y: 8.049), control2: CGPoint(x: 2.362, y: 8))
        p.addCurve(to: CGPoint(x: 2.854, y: 8.146), control1: CGPoint(x: 2.638, y: 8), control2: CGPoint(x: 2.756, y: 8.049))
        p.addLine(to: CGPoint(x: 5.5, y: 10.793))
        p.closeSubpath()
        return p.applying(CGAffineTransform(scaleX: rect.width / 16, y: rect.height / 16))
    }
}

// CheckIcon().frame(width: 16, height: 16) fills with the foreground style. Keep it on whole points to stay crisp.

Jetpack Compose and Android

An ImageVector for Compose, or a vector drawable for Android views:

// Gentleface "check" (line-round), MIT. https://gentleface.com/icons/check
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.addPathNodes
import androidx.compose.ui.unit.dp

val CheckIcon: ImageVector by lazy {
    ImageVector.Builder(
        name = "check", defaultWidth = 16.dp, defaultHeight = 16.dp,
        viewportWidth = 16f, viewportHeight = 16f,
    ).addPath(
        pathData = addPathNodes("M5.5 10.793L12.146 4.146C12.246 4.047 12.364 3.997 12.5 3.997C12.636 3.997 12.754 4.047 12.854 4.146C12.951 4.244 13 4.362 13 4.5C13 4.638 12.951 4.756 12.854 4.854L5.854 11.854C5.754 11.953 5.636 12.003 5.5 12.003C5.364 12.003 5.246 11.953 5.146 11.854L2.146 8.854C2.047 8.754 1.997 8.636 1.997 8.5C1.997 8.364 2.047 8.246 2.146 8.146C2.244 8.049 2.362 8 2.5 8C2.638 8 2.756 8.049 2.854 8.146L5.5 10.793Z"),
        fill = SolidColor(Color.Black),
    ).build()
}

// Icon(CheckIcon, contentDescription = null) tints it with LocalContentColor.

Flutter

A widget that paints the path and takes the color from IconTheme.

See the Flutter tab on any icon page.

For coding agents

Connect the MCP server at https://gentleface.com/mcp: how, for each client.

/llms.txt describes the set and the URL patterns. /icons.json and /icons.txt list every icon with its meanings. Every icon page has a .json and a .md version with all of the above.