Adventureland Registry

Cyberpunk Text Box

A fully-customisable bordered monospace label box with Tailwind-based theming for color, typography, and background.

CyberpunkTextBox is the configurable sibling of CyberpunkText. Unlike its counterpart, every visual aspect — border color, text color, font size, background — is controlled through props rather than theme tokens, making it suitable for standalone use or as a design-system primitive. Optional ref props allow GSAP-driven parent animations.

Installation

npx shadcn@latest add @adv/cyberpunk-text-box

Usage

import { CyberpunkTextBox } from '@/components/ui/CyberpunkTextBox';

<CyberpunkTextBox
  text="ACCESS GRANTED"
  borderColor="border-cyan-500"
  textColor="text-cyan-500"
  textBackgroundColor="bg-black"
  fontSize="text-lg"
  letterSpacing="tracking-widest"
/>

Example

DEFAULT
CUSTOM
BOLD

Props

PropTypeDefaultDescription
textstringThe label text rendered inside the box.
paddingnumber3Tailwind padding level applied to the inner container (e.g. 3p-3).
fontSizestring"text-base"Tailwind font-size class.
borderColorstring"border-red-500"Tailwind border-color class.
borderThicknessstring"4"Tailwind border-width value (e.g. "4"border-4).
textColorstring"text-red-500"Tailwind text-color class.
fontFamilystring"font-mono"Tailwind font-family class.
fontWeightstring"font-bold"Tailwind font-weight class.
letterSpacingstring"tracking-wider"Tailwind letter-spacing class.
textTransformstring"uppercase"Tailwind text-transform class.
textBackgroundColorstring"bg-transparent"Tailwind background-color class for the inner text area.
classNamestring""Extra classes applied to the outermost container.
containerRefRef<HTMLDivElement>Ref for the animated-width wrapper.
boxRefRef<HTMLDivElement>Ref for the bordered box (GSAP scale target).
textVisualRefRef<HTMLDivElement>Ref for the text <div> (GSAP text scramble target).

On this page