Heroes

AsciiHero

For hackers, by people who follow the right newsletters.

A canvas-rendered procedural ASCII field that reacts to the cursor. The grid auto-fits its container. Two visual modes: `panel` (default, bordered card) and `bare` (no chrome, intended for background use). Flip on `colorful` for the aurora palette and `spotlightOpacity` to brighten the area under the cursor, perfect for low-opacity backgrounds where the user gets rewarded for hovering.

Install

Copy this owned-code component into your app from the registry.

pnpm dlx shadcn-svelte@latest add https://benjamin-brady.github.io/performative-ui-svelte/registry/ascii-hero.json

Examples

Default panel
<AsciiHero />
Colorful (aurora palette)
<AsciiHero colorful />
As a hero background (low opacity + cursor spotlight)

Hover this card.

The field stays dim until your cursor lights it up.

<div style={{ position: "relative" }}>
  <AsciiHero
    variant="bare"
    colorful
    baseOpacity={0.18}
    spotlightOpacity={0.9}
    spotlightRadius={10}
    style={{ position: "absolute", inset: 0 }}
  />
  <div style={{ position: "relative", zIndex: 1 }}>…content…</div>
</div>
Custom palette + ramp
<AsciiHero
  palette={["#22c55e", "#86efac", "#fbbf24"]}
  charRamp=" .:-=+*#%@"
/>

Props

PropTypeDefaultDescription
variant"panel" | "bare""panel"panel = bordered card; bare = no chrome (for background use).
colsnumber-Grid width in cells. Auto-computed from container if omitted.
rowsnumber-Grid height in cells. Auto-computed from container if omitted.
fontSizenumber11Character font size (px).
charRampstring-Sparsest → densest characters.
colorfulboolean-Paint with the default aurora palette.
palettestring[]-Custom palette; overrides `colorful`.
baseOpacitynumber1Base alpha. Drop low (≈ 0.18) for background use.
reactivebooleantrueEnable cursor reactivity.
rippleStrengthnumber1.4Cursor ripple amplitude (changes which chars show).
rippleRadiusnumber6Cursor ripple falloff radius (cells).
spotlightOpacitynumber-Alpha at the cursor center; falls off radially to baseOpacity.
spotlightRadiusnumber8Cursor spotlight radius (cells).
frameMsnumber50Frame throttle (ms).
Next Aurora ]