Character Field
A dense ambient surface of monospace glyphs that mutate independently. Canvas-rendered, stationary, and restrained — dark green-teal by default with occasional bright flickers.
Installation#
pnpm dlx shadcn@latest add @davinciui/character-fieldUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
characterSetWhich glyph pool fills the grid. | "mixed" | "letters" | "numbers" | "symbols" | "custom" | "mixed" |
customCharactersCustom glyph pool used when characterSet is "custom". | string | "" |
fontFamilyFont family applied to every glyph. | string | "ui-monospace, ..." |
fontSizeGlyph size in CSS pixels. | number | 14 |
fontWeightFont weight applied to every glyph. | number | string | 400 |
characterSpacingExtra horizontal space between glyphs, in px. | number | 2 |
lineHeightLine height multiplier for grid rows. | number | 1.5 |
backgroundColorCanvas background fill. | string | "#060a09" |
characterColorBase glyph color. | string | "#1d3a34" |
highlightColorColor used for occasional bright glyphs. | string | "#8fc0b5" |
baseOpacityGlobal opacity multiplier for glyphs. | number | 0.6 |
brightnessVariationSpread of per-glyph brightness. Higher values make bright glyphs rarer. | number | 0.55 |
densityGrid density multiplier. Higher values pack more glyphs. | number | 1 |
mutationSpeedGlobal mutation rate multiplier. Set to 0 to freeze the field. | number | 1.8 |
mutationAmountProbability that a scheduled cell event replaces its glyph. | number | 0.16 |
minUpdateDelayMinimum delay in milliseconds between mutations of the same cell. | number | 60 |
maxUpdateDelayMaximum delay in milliseconds between mutations of the same cell. | number | 1400 |
flickerIntensityPer-frame opacity shimmer strength, 0 to 1. | number | 0.35 |
smoothFadeEase opacity toward its target instead of snapping. | boolean | true |
pauseWhenOffscreenPause the loop while outside the viewport. | boolean | true |
respectReducedMotionRender one static field for reduced-motion users. | boolean | true |
seedOptional seed for a deterministic initial field. | number | — |
maxDprMaximum device pixel ratio for the backing buffer. | number | 2 |
classNameAdditional classes for the outer element. | string | — |
Accessibility#
It is presentational: the host is role img with a fixed decorative aria-label and the canvas is aria-hidden, so no glyph content reaches assistive technology.
Motion#
A requestAnimationFrame loop mutates glyphs using mutationSpeed plus min and max update delays, with smoothFade and flickerIntensity shaping opacity. prefers-reduced-motion is watched live and renders one static frame when respectReducedMotion is enabled.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

