Skip to content

gridaco/grida / .agents/skills/docs-svg-kit

docs-svg-kit

Verified

Author SVG figures for Grida docs — diff-able, version-controlled vector diagrams embedded in doc pages instead of screenshots. Provides reusable primitives (selection chrome, size badges, anchor pins, resize cursors, click ripples), color/typography tokens, a starter template, and finished examples to crib from. Canvas user docs (docs/editor/) are the first consumer; the kit is meant to generalize to any product's docs. Use when drawing diagrams that explain UI behaviour — gestures, alignment, before/after states — that a screenshot alone can't capture. Trigger phrases: "svg diagram", "draw a figure", "visual for docs", "explain this gesture visually", "before/after diagram".

snippets/handles.svg

View on GitHub
<!-- @generated-by: docs-svg-kit v1 -->
<!--
  docs-svg-kit  ·  handles

  The kit's three "point" primitives:
    .handle             → square corner handle (selection chrome)
    #ft-handle          → circle handle (free-transform grip)
    #anchor-pin         → red dot with halo (anchor point — fixed point in space)

  Each is positioned via translate(cx, cy) so the centre lands exactly on
  (cx, cy) — important for visual accuracy in alignment figures.

  Source for the canonical look:
    editor/grida-canvas-react/viewport/surface.tsx               (square handle)
    editor/grida-canvas-react/viewport/ui/surface-image-editor.tsx  (circle / free-transform)
-->
<svg xmlns="http://www.w3.org/2000/svg"
     viewBox="0 0 960 480"
     width="960"
     height="480"
     font-family="-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif">
  <metadata>docs-svg-kit/v1</metadata>
  <defs>
    <style>
      .canvas-bg     { fill: #ECECEC; }
      .doc-heading   { font-size: 24px; fill: #0a0a0a; font-weight: 600; letter-spacing: -0.3px; }
      .doc-sub       { font-size: 13px; fill: #6b7280; }
      .cell-bg       { fill: #ffffff; stroke: #e5e5e5; stroke-width: 1; }
      .cell-title    { font-size: 13px; fill: #0a0a0a; font-weight: 600; }
      .cell-class    { font-size: 11px; fill: #6b7280; font-family: 'SF Mono', Menlo, Consolas, monospace; }
      .cell-meta     { font-size: 10px; fill: #9ca3af; font-family: 'SF Mono', Menlo, Consolas, monospace; }

      .sel-outline   { fill: none; stroke: #0D99FF; stroke-width: 1; shape-rendering: crispEdges; }
      .handle        { fill: #ffffff; stroke: #0D99FF; stroke-width: 1; shape-rendering: crispEdges; }
      .handle-circle { fill: #ffffff; stroke: #0D99FF; stroke-width: 1.5; }
    </style>

    <filter id="pin-shadow" x="-200%" y="-200%" width="500%" height="500%">
      <feGaussianBlur in="SourceAlpha" stdDeviation="1"/>
      <feOffset dx="0" dy="0.5"/>
      <feComponentTransfer><feFuncA type="linear" slope="0.4"/></feComponentTransfer>
      <feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>
    </filter>

    <g id="anchor-pin">
      <circle cx="0" cy="0" r="9" fill="#FF3B30" opacity="0.18"/>
      <circle cx="0" cy="0" r="5.5" fill="#FF3B30"/>
      <circle cx="0" cy="0" r="2" fill="#ffffff"/>
    </g>
    <g id="ft-handle">
      <circle cx="0" cy="0" r="7" class="handle-circle"/>
    </g>
  </defs>

  <rect class="canvas-bg" width="960" height="480"/>

  <text x="40" y="50" class="doc-heading">Handles &amp; pins</text>
  <text x="40" y="74" class="doc-sub">Three "point" primitives. Each positioned via translate(cx, cy) — the centre lands exactly on the target point.</text>

  <!-- Square handle -->
  <g transform="translate(40, 110)">
    <rect width="293" height="320" rx="8" class="cell-bg"/>
    <text x="20" y="30" class="cell-title">Square handle</text>
    <text x="20" y="50" class="cell-class">.handle · 7×7 corner</text>

    <!-- show against a selection outline so role is clear -->
    <rect x="86.5" y="120.5" width="120" height="80" class="sel-outline"/>
    <rect x="83" y="117"  width="7" height="7" class="handle"/>
    <rect x="203" y="117" width="7" height="7" class="handle"/>
    <rect x="83" y="197"  width="7" height="7" class="handle"/>
    <rect x="203" y="197" width="7" height="7" class="handle"/>

    <text x="146" y="270" class="cell-meta" text-anchor="middle">selection corner — resize gesture</text>
  </g>

  <!-- Free-transform handle (circle variant) -->
  <g transform="translate(353, 110)">
    <rect width="293" height="320" rx="8" class="cell-bg"/>
    <text x="20" y="30" class="cell-title">Free-transform handle</text>
    <text x="20" y="50" class="cell-class">#ft-handle · .handle-circle</text>

    <rect x="86.5" y="120.5" width="120" height="80" class="sel-outline" opacity="0.5"/>
    <g transform="translate(86, 120)"><use href="#ft-handle"/></g>
    <g transform="translate(206, 120)"><use href="#ft-handle"/></g>
    <g transform="translate(86, 200)"><use href="#ft-handle"/></g>
    <g transform="translate(206, 200)"><use href="#ft-handle"/></g>

    <text x="146" y="270" class="cell-meta" text-anchor="middle">corner grip — rotate / scale gesture</text>
  </g>

  <!-- Anchor pin -->
  <g transform="translate(666, 110)">
    <rect width="254" height="320" rx="8" class="cell-bg"/>
    <text x="20" y="30" class="cell-title">Anchor pin</text>
    <text x="20" y="50" class="cell-class">#anchor-pin · #pin-shadow</text>

    <line x1="40" y1="160" x2="214" y2="160" stroke="#b5b5b5" stroke-width="1" stroke-dasharray="3 3"/>
    <g transform="translate(127, 160)" filter="url(#pin-shadow)">
      <use href="#anchor-pin"/>
    </g>

    <text x="127" y="240" class="cell-meta" text-anchor="middle">a fixed point in space</text>
    <text x="127" y="256" class="cell-meta" text-anchor="middle">(centre is exactly on cx, cy)</text>
  </g>
</svg>
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall