Glyph Card
A hairline card whose background resolves into tiny plus marks on hover, gathering inside the glyph. Draws itself from a single SVG path on a 24x24 grid.
Aditya
An off-center mark, recentered
Installation
Glyph Card is published as a shadcn registry item. The CLI drops the file into your project, installs its dependencies, and adds any primitives it relies on.
$npx shadcn@latest add https://akoder.xyz/r/glyph-card.jsonInstall directly from the URL above. To configure the registry once and install components by name, use the setup snippet on the components page.
"registries": {
"@akoder": "https://akoder.xyz/r/{name}.json"
}Usage
The only required props are eyebrow, title, and glyph. Everything else is
optional.
The glyph
glyph is SVG path data authored on a 24x24 grid. Drop in any single-path
brand mark and it lands centered in the card.
Omit href and the card renders as a static div instead of a link.
Accent
accent tints the plus marks and the link arrow. It accepts any CSS color and
defaults to var(--primary, #1447E6). Omitting it gives you the primary token,
which reads black on white in most setups.
Recentering an off-grid mark
Most brand marks are already centered on the 24x24 grid and need nothing. A mark that is not, for example one whose art only occupies the bottom-right quadrant, renders off-center. Rather than rewriting the path coordinates, pass the offset that recenters it in grid units.
A mark whose bounding box runs x 10..22 and y 8..24 has a center of (16, 16), so
it wants glyphOffset={[-4, -4]} to land on (12, 12).
Glyph size
glyphSize sets the size of the glyph viewport inside the card's 100x100 field.
The reserved vertical space scales with it, so a larger glyph cannot outgrow its
own card.
Props
GlyphCard
| Prop | Type | Default | Notes |
|---|---|---|---|
eyebrow | string | required | Small mono label in the top-left. |
title | string | required | Rendered as an h3 in the card footer. |
subtitle | string | - | Muted second line under the title. |
glyph | string | required | SVG path data authored on a 24x24 grid. |
href | string | - | Makes the whole card a link. Omit for a static card. |
glyphOffset | readonly [number, number] | - | Shifts the glyph inside the viewBox, in grid units. |
glyphSize | number | 62 | Glyph viewport size inside the 100x100 field. |
accent | string | var(--primary, #1447E6) | Accent for the artwork and link arrow. |
className | string | - | Extra classes for the root. |
Notes & features
- One path, no icon dependency. The card takes raw SVG path data rather than a React component, so it works with any icon set, including ones you do not want to install.
- Hover and focus are the same state. Hovering, focusing, or tabbing to a card rotates the tiny plus marks 45 degrees, fades them, and gathers a brighter tint inside the glyph. The two are wired to one flag so a keyboard user sees exactly what a mouse user sees.
- The tint is masked by the glyph. Two masks are generated from your path, one inverted, so the resting pattern is excluded from the glyph's shape and the hover tint is confined to it. Every card gets its own generated ids, so several cards can share a page.
- Reduced motion. When the operating system asks for reduced motion, the transitions collapse and the plus marks hold at their resting angle and opacity. State changes still happen, they just stop animating.
- Self-contained colors.
accentand the pattern's mixing color read theme tokens with literal fallbacks, so the card renders correctly in a project that has neither this site's tokens nor a shadcn setup. - Sizing. The card fills its container's height (
h-full) and reserves vertical space proportional toglyphSize. Put it in a grid cell or give the wrapper an explicit height.
Manual installation
Copy components/ui/glyph-card.tsx into your project and install motion and
lucide-react. The component is a client component and needs no provider.
examples
Explore different presets, palettes, and configurations.
Brand marks
Each card drives its own accent, which tints the arrow, the plus marks, and the hover tint inside the glyph.
Tailwind CSS
Utility-first CSS
GitHub
Where the code lives
The eyebrow pill is intentionally neutral so the accent stays the only color on the card.
Example 1 of 3: Brand marks