Elastic Type
ComponentsElastic Type
ExperimentsNew

Elastic Type

Give your words a little give. Letterforms stretch, lean, and spring back around the pointer.

React + CSS
A LITTLE GIVE. A LOT OF CHARACTER.

MAKE

WAVES.

Live component. Go ahead, interact.
01

Installation

Run this in your shadcn-configured React project. The component and stylesheet are added together.

TERMINAL
npx shadcn@latest add http://localhost:5173/r/elastic-type.json

This command uses the current site address. For localhost, keep this preview running on the same computer. Files follow your configured components alias.

02

Usage

Import the component and make the details your own.

TypeScript
import { ElasticType } from '@/components/anticraft/ElasticType';

export function Example() {
  return (
    <div style={{ padding: 32, background: '#cadd8d', fontSize: 'clamp(40px, 8vw, 100px)', fontWeight: 800 }}>
      <ElasticType as="h2" text="MAKE WAVES" strength={1} radius={150} />
    </div>
  );
}
03

Props

PropTypeDefaultDescription
textstringRequiredThe complete phrase. Screen readers receive one uninterrupted copy.
as'h1' | 'h2' | 'h3' | 'p''p'The semantic element for the phrase.
strengthnumber1The deformation strength, clamped from 0 to 2.
radiusnumber150How far the pointer affects nearby letters, in pixels.
classNamestring''Additional classes. The component inherits font, size, weight, and color.
04

Motion & accessibility

Considered by default.

Letterforms respond to a fine pointer and settle back when it leaves. The phrase wraps naturally and remains readable without JavaScript. Coarse pointers and reduced motion receive static typography. The decorative split letters are hidden from assistive technology.

Use semantic content and meaningful labels in your composition. Check contrast and keyboard behavior with your own styles and content.