skip to content
mpkcn

~/components/fetch-card

Fetch Card

A neofetch-style info card: ASCII art, a user@host header, key / value rows and a palette strip, with lines that slide in and art that tilts towards the pointer.

guest@mpkcn
os
mpkcn 0.3 x86_64
shell
zsh 5.9
stack
Next.js · React · TypeScript
theme
dark (amber / blue)
uptime
42 days
status
open to work

Installation

terminal
npx mpkcn add fetch-card
deps:framer-motion@13.4.4· tested with react@19.3.0

Usage

Pass ASCII art and the rows. The header reads user@host.

tsx
import { FetchCard } from "@/components/mpkcn/fetch-card";

const ART = `
  /\\_/\\
 ( o.o )
  > ^ <`;

export function About() {
  return (
    <FetchCard
      art={ART}
      artLabel="A cat"
      user="you"
      host="portfolio"
      rows={[
        { label: "role", value: "full-stack developer" },
        { label: "stack", value: "Next.js · React · TypeScript" },
        { label: "loc", value: "Earth" },
      ]}
    />
  );
}

A string art is split into lines that slide in one after another. Leading and trailing blank lines are trimmed, so you can start the template literal on a new line. Set its size with artClassName (block-letter logos usually need text-[9px] to text-[11px]).

Any other node works as art too: an <img>, an SVG, an AsciiImage.

Examples

Amber, without the palette

guest@mpkcn
os
mpkcn 0.3 x86_64
shell
zsh 5.9
stack
Next.js · React · TypeScript
theme
dark (amber / blue)

Your own header

title replaces the user@host line, for a name or a link.

tsx
<FetchCard title={<a href="/about">read more</a>} rows={rows} art={ART} />

Props

PropTypeDefaultDescription
artReactNode—ASCII art on the left. A string is split into lines.
artLabelstring—Accessible name for the art. Without it the art is hidden from screen readers.
userstring"guest"User part of the header.
hoststring"localhost"Host part of the header.
titleReactNode—Replaces the user@host header.
rows{ label: string; value: ReactNode }[]—Key / value rows under the header.
palettebooleantrueShow the strip of theme color swatches.
tone"blue" | "amber""blue"Accent of the art and header.
animatebooleantrueSlide the lines in when the card scrolls into view.
tiltbooleantrueTilt the art in 3D towards a mouse pointer.
ignoreReducedMotionbooleanfalseAnimate even under reduced motion. Only use it behind an explicit action.
classNamestring—Extra classes for the root.
artClassNamestring"text-[11px]"Classes for the art (font size, line height). Replaces the default size.

Accessibility

  • The rows are a description list, so each label is tied to its value.
  • ASCII art is noise to a screen reader: it is hidden unless you give it an artLabel, which turns it into an image with that name.
  • The palette strip and the rule under the header are decorative and hidden.
  • Under prefers-reduced-motion: reduce nothing slides and the art does not tilt. Touch input never tilts it.