Proximity Text

Letters grow bolder, and lean toward the accent, the closer the mouse comes.

Halden journal · Issue 04

Made to be carried, not kept.

import { ProximityText } from '@brand-studio/ui';

export default function ProximityTextDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 640 }}>
      <p style={{ margin: '0 0 12px', fontSize: 13, color: 'var(--bs-muted)' }}>Halden journal · Issue 04</p>
      <ProximityText as="h3" text="Made to be carried, not kept." className="demo-proximity" />
      <style>{'.demo-proximity { margin: 0; font-size: clamp(34px, 7vw, 64px); line-height: 1.05; letter-spacing: -.03em; }'}</style>
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { ProximityText } from '@brand-studio/ui';
<ProximityText as="h2" text="Made to be carried, not kept." radius={140} />

The weight runs from 300 to 800, so use it with a variable font; a font with fixed weights jumps between them. radius is how far, in pixels, the mouse reaches.

Accessibility

  • Screen readers hear the plain text once; the letter pieces are hidden from them.
  • Only a mouse changes it. Touch and reduced motion see the text at rest.

API Reference

PropTypeDefault
textstring–
as?React.ElementType–
radius?number140
className?string''

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.