Installation
pnpm dlx shadcn@latest add https://asciicn.dev/r/ascii-card.jsonThis also installs ascii-box, which draws the frame, and ascii-glow, which draws the glow.
Usage
import { AsciiCard } from "@/components/asciicn/ascii-card";
export function RuntimeCard() {
return (
<AsciiCard title="edge-runtime" footer="31 regions" glow="top-right">
<p className="font-semibold">Cold starts under 40 ms</p>
</AsciiCard>
);
}AsciiCard is an AsciiBox that fills its container's width, with a title set into the top border (┌─ Title ─────┐), an optional footer in the bottom border and a description line above the content. The title also names the card for screen readers.
glow lights the inside of the frame with an AsciiGlow from an edge, a corner or any point, drawn in the glyphs of glowCharset. The glow sits behind the content and fills the cells inside the frame exactly.
Set interactive on a card that holds a link or button. Hover or focus inside it turns the frame heavy and brightens the glow.
Examples
Glows
Three interactive cards lit from different sides in braille, block and katakana glyphs. Hover one, or tab to its link.
Status panel
A double frame with a medium shade shadow, a description and a count in the footer.
Props
| Prop | Type | Default |
|---|---|---|
| title Set into the top border. Also names the card for screen readers. | Type: ReactNode | Default – |
| description A line of muted text above the content. | Type: ReactNode | Default – |
| footer Set into the bottom border, such as a status or a count. | Type: ReactNode | Default – |
| glow Where a glyph glow lights the card from: an edge, a corner, center, or an [x, y] point from 0 to 1. | Type: GlowPosition | "none" | Default "none" |
| glowCharset Glyphs the glow is drawn with. | Type: CharsetName | Default "standard" |
| glowColor Glow colour. | Type: AsciiColor | Default color |
| interactive For clickable cards: hover and focus inside turn the frame heavy and brighten the glow. | Type: boolean | Default false |
| frame Box-drawing set for the frame. | Type: "light" | "heavy" | "double" | "rounded" | "ascii" | Default "light" |
| activeFrame The frame while an interactive card is hovered or focused. | Type: "light" | "heavy" | "double" | "rounded" | "ascii" | Default "heavy" |
| color Frame colour, and the glow's unless glowColor is set. | Type: AsciiColor | Default "ink" |
| padding Space inside the frame in rows; columns are doubled. | Type: number | Default 1 |
AsciiCard takes every other AsciiBox prop (labelAlign, shadow, filled, cell) and passes the rest to the wrapping <div>.
Notes
- The frame and glow are
aria-hidden. The card is agroupnamed by its title. - The glow pauses offscreen and in hidden tabs, and holds one still frame with reduced motion.
- The interactive frame swaps glyph sets instantly, as a terminal redraws, with no transition to tune.
- Without
glow, the card draws no canvas and runs no animation.