Skip to main content
Lab

Keyline Icons

216 icons · MIT

Precision icons that move with meaning.

216 clean-room glyphs on a 24x24 optical grid. Hover or select any icon to preview its mechanism and copy SVG, React, CSS, Vue, or Svelte code.

System specification, optical keylines, and master prompts

Keyline Icons is authored from first principles across 24 3x3 batches. Every glyph follows equal-area optical keylines, 2px counter separation, and stationary-anchor choreography with zero rest-state shift.

Circle (314 sq px)cx=12, cy=12, r=10

Curved extrema reach the 2px live boundary because circular arcs carry less corner mass.

Square (324 sq px)x=3..21, y=3..21, rx=2.5

Orthogonal squares pull in 1px per side so their 324 sq px area matches the 314 sq px circle within 3 percent.

Landscape (320 sq px)x=2..22, y=4..20, rx=2.5

Horizontal frames span the full 20px width while compressing height to 16px for equal ink density.

Portrait (320 sq px)x=4..20, y=2..22, rx=2.5

Vertical documents, locks, and devices span 20px tall within a 16px column.

1. Master optical design system prompt

Establishes the 24x24 coordinate grid, equal-mass optical keylines, centroid balance, and 3x3 batch parity.

You are a first-principles iconographer engineering an open-source product icon system. Every glyph must feel inevitable, calm, and legible at a glance.

Non-negotiable optical rules:
1. Artboard and snapping: 24x24 px viewBox with a 2 px outer safety margin (maximum live envelope 20x20, coordinates 2..22). Anchor points snap to integer pixels or 0.5 px half-steps for sharp rasterization at 1x and 2x DPR.
2. Equal-mass keylines: Seat every icon inside one of four equal-area optical frames so visual mass stays within 3 percent across the library:
   - Circle: r=10 centered at (12, 12), area 314 sq px.
   - Square: 18x18 optical body (x=3..21, y=3..21, rx=2..3), area 324 sq px.
   - Landscape: 20x16 horizontal frame (x=2..22, y=4..20), area 320 sq px.
   - Portrait: 16x20 vertical frame (x=4..20, y=2..22), area 320 sq px.
3. Centroid alignment: Center icons by visual center of gravity rather than bounding-box midpoint. Shift asymmetric wedges (play, send, megaphones) so perceptual weight rests on (12, 12).
4. Stroke and counter-space: Uniform centered stroke (default 2 px, calibrated across 1.5 to 2.25 px), round caps, round joins, no mixed weights. Preserve at least 2 px clear counter-space between parallel strokes so details never close up at 16 px.
5. Element budget and part decomposition: 1 to 6 primitives per icon. Separate moving actors from stationary anchors (for example bell dome vs clapper, arrow vs tray, shackle vs lock body) while keeping rest coordinates identical to the static SVG.
6. Variant parity: Tag closed interior containers for duotone (0.14 currentColor fill beneath full strokes) and knockout interior details for solid variants so counters remain legible at 16 px.
7. 3x3 consistency gate: Author and audit icons in batches of 9. In a 3x3 grid at 16 px, 24 px, and 32 px, no icon may read heavier, sparser, or noisier than its neighbors.

2. Per-icon geometric construction prompt

Guides single-glyph metaphor selection, 16px legibility checks, and static-to-animated coordinate identity.

Construct the [ICON_NAME] icon under the Master Optical Design System.

1. Semantic target: Communicate [MEANING] in under 500 ms at 16 px without relying on fine interior texture.
2. Keyline assignment: Select [circle | square | landscape | portrait] and state why its proportions fit the silhouette.
3. Path construction:
   - Use clean geometric primitives (circle, rect, line, polyline, minimal cubic/arc paths).
   - Keep parallel strokes at least 2 px apart.
   - Decompose only the sub-elements that move independently during interaction.
4. Multi-scale verification: Mentally rasterize at 16 px, 24 px, and 32 px. Confirm open counters, crisp terminals, and optical centering around (12, 12).
5. Deliverables:
   - Production SVG (viewBox="0 0 24 24", fill="none", stroke="currentColor", stroke-width="2", stroke-linecap="round", stroke-linejoin="round")
   - Part-annotated metadata for Stroke, Duotone, and Solid variants
   - Concise 1 to 2 sentence optical rationale.

3. Semantic micro-choreography specification

Defines multi-principle hover physics, secondary follow-through, reduced-motion compliance, and zero layout shift.

Author a semantic micro-animation for [ICON_NAME] with strict zero-shift geometry parity:

Hover / Active choreography (primary):
- Duration: 260 to 380 ms.
- Physical principles: Combine at least two of anticipation (small reverse pre-load), subtle squash/stretch, spring overshoot, and independent secondary action (25 to 55 ms phase offset on trailing parts).
- Easing: Custom non-linear curves only, using cubic-bezier(0.22, 1, 0.36, 1) for crisp deceleration and cubic-bezier(0.34, 1.56, 0.64, 1) for tactile settle. Never use linear easing.
- Kinematic meaning: Motion must enact what the object does (a download arrow lifts in anticipation then plunges into a flexing tray; a bell swings from its top ring while the clapper follows; sliders counter-glide along parallel tracks).
- Rest identity: Keyframe t=0 and t=1 must match the static SVG coordinates exactly so swapping static and animated components causes zero layout or sub-pixel shift.

Optional Idle / Live cadence:
- Low-amplitude ambient loop (scale 1.02 to 1.03 or gentle harmonic drift, max 2000 ms with natural rest) reserved for live status, audio, or telemetry states.

Accessibility and control API:
- Respect prefers-reduced-motion: reduce automatically.
- Expose playOnHover, playOnMount, idle, and imperative ref methods { play(), stop(), reset() }.

4. Open-source package and batch architecture

Structures 216 icons across 24 3x3 batches with tree-shakable React, Vue, Svelte, CSS, and raw SVG outputs.

Package Keyline Icons as a tree-shakable, MIT-licensed icon library:

1. Taxonomy: 216 core product icons organized into 6 categories (Interface, Navigation, Actions, Status, Media, Objects) and 24 curated 3x3 batches (9 icons per batch).
2. Outputs per icon:
   - Clean static SVG
   - React component (Motion + forwardRef imperative API)
   - Pure CSS / Vanilla ESM module (@keyframes + CSS custom property tokens)
   - Vue 3 and Svelte 5 components
   - Stroke, Duotone, and Solid visual styles
3. Design tokens: Expose --kl-size, --kl-stroke, --kl-duotone-opacity, --kl-duration-base, --kl-ease-out, and --kl-ease-spring as themeable CSS variables.
4. Verification pipeline: Run automated bounds, stroke-gap, center-of-mass, duplicate-signature, and 3x3 batch ink-density checks across all 216 glyphs before release.

5. CSS design tokens

Themeable geometry and physical easing custom properties for tree-shakable builds.

:root {
  /* Geometry tokens */
  --kl-size: 24px;
  --kl-stroke: 2;
  --kl-duotone-opacity: 0.14;

  /* Motion timing and physical easing */
  --kl-duration-fast: 260ms;
  --kl-duration-base: 320ms;
  --kl-duration-slow: 380ms;
  --kl-idle-duration: 1800ms;
  --kl-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --kl-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --kl-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --kl-duration-fast: 0ms;
    --kl-duration-base: 0ms;
    --kl-duration-slow: 0ms;
  }
}
Specimen

Search

search · circle · 330ms

16px
20px
24px
32px

Lens sits at (10.5, 10.5) with r=6.5 and a crisp inner glint arc so the 45-degree handle balances diagonal mass.

Motion: Cohesive loupe scan around the optical center with magnifying lens glint.

import { forwardRef, useEffect, useImperativeHandle, useState } from "react"
import { motion, useReducedMotion } from "framer-motion"

export interface SearchIconHandle {
  play: () => void
  stop: () => void
  reset: () => void
}

export interface SearchIconProps {
  size?: number
  color?: string
  strokeWidth?: number
  playOnHover?: boolean
  playOnMount?: boolean
  className?: string
}

export const SearchIcon = forwardRef<SearchIconHandle, SearchIconProps>(
  function SearchIcon(
    {
      size = 24,
      color = "currentColor",
      strokeWidth = 2,
      playOnHover = true,
      playOnMount = false,
      className,
    },
    ref,
  ) {
    const reduced = useReducedMotion()
    const [runId, setRunId] = useState(playOnMount ? 1 : 0)
    const active = runId > 0

    useEffect(() => {
      if (playOnMount && !reduced) setRunId((n) => n + 1)
    }, [playOnMount, reduced])

    useImperativeHandle(ref, () => ({
      play: () => setRunId((n) => n + 1),
      stop: () => setRunId(0),
      reset: () => setRunId(0),
    }))

    return (
      <svg
        key={runId}
        xmlns="http://www.w3.org/2000/svg"
        width={size}
        height={size}
        viewBox="0 0 24 24"
        overflow="visible"
        fill="none"
        stroke={color}
        strokeWidth={strokeWidth}
        strokeLinecap="round"
        strokeLinejoin="round"
        className={className}
        style={{ overflow: "visible" }}
        onPointerEnter={playOnHover ? () => setRunId((n) => n + 1) : undefined}
      >
        <motion.g
          style={{ transformOrigin: "43.75% 43.75%", transformBox: "view-box" }}
          animate={active && !reduced ? {"scale":[1,0.96,1.04,1]} : undefined}
          transition={{"duration":0.34650000000000003,"ease":[0.34,1.45,0.64,1]}}
        >
          <circle cx={10.5} cy={10.5} r={6.5} />
        </motion.g>
        <motion.g
          style={{ transformOrigin: "43.75% 43.75%", transformBox: "view-box" }}
          animate={active && !reduced ? {"rotate":[0,-22,28,-6,0]} : undefined}
          transition={{"duration":0.396,"ease":[0.34,1.45,0.64,1]}}
        >
          <line x1={15.2} y1={15.2} x2={20.5} y2={20.5} />
        </motion.g>
        <motion.g
          style={{ transformOrigin: "43.75% 43.75%", transformBox: "view-box" }}
          animate={active && !reduced ? {"x":[0,0.4,-0.9,0.15,0],"y":[0,0.4,-0.9,0.15,0],"scale":[1,0.94,1.22,0.99,1]} : undefined}
          transition={{"duration":0.34650000000000003,"ease":[0.34,1.45,0.64,1]}}
        >
          <path d="M8 8.5a3 3 0 0 1 4.2-.4" />
        </motion.g>
      </svg>
    )
  },
)