Split Flap
ComponentsSplit Flap
TypographyNew

Split Flap

Good things are on their way. A mechanical departure board with hinged letters and a cascading flip.

React + CSS
ANTICRAFT
DEPARTURES
OPEN TICKETS
HERESOMEWHERE GOOD
NEXT DESTINATION AC 001ALL GREAT THINGS BEGIN WITH GOING.
NEXT DEPARTURE: WHENEVER YOU’RE READY.Selected departure: Stay curious.
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/split-flap.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
'use client';

import { useState } from 'react';
import { SplitFlap } from '@/components/anticraft/SplitFlap';

export function Example() {
  const [text, setText] = useState('STAY\nCURIOUS');
  return (
    <div style={{ maxWidth: 360, padding: 24, background: '#e8dc9c' }}>
      <SplitFlap text={text} label="Next departure" duration={500} stagger={35} />
      <button type="button" onClick={() => setText(text === 'STAY\nCURIOUS' ? 'MAKE\nWAVES' : 'STAY\nCURIOUS')}>
        Change departure
      </button>
    </div>
  );
}
03

Props

PropTypeDefaultDescription
textstringRequiredThe complete phrase. Spaces, punctuation, Unicode code points, and newline characters are preserved. Long phrases wrap instead of being truncated.
labelstringundefinedAn optional description placed before the complete phrase in the accessible image name. Decorative tile faces are hidden from assistive technology.
durationnumber500The duration of an individual flip in milliseconds, clamped from 150 to 1500.
staggernumber35The delay between tiles in milliseconds, clamped from 0 to 150. Cascading delays stop growing after 1500ms so long phrases finish promptly.
classNamestring''Additional classes. Customize --ac-flap-surface, --ac-flap-color, --ac-flap-font, --ac-flap-tile-width, --ac-flap-tile-height, and --ac-flap-gap.
04

Motion & accessibility

Considered by default.

The first render contains the actual text. Changed letters flip in a short mechanical cascade, and another change safely replaces the current animation. There is no automatic cycling. Reduced motion shows each new phrase immediately. Supply changing text from a Client Component; the example includes that boundary. The component exposes one complete accessible phrase without an automatic live announcement; add a separate status message when the surrounding interaction needs one.

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