Throw Stack
ComponentsThrow Stack
ExperimentsNew

Throw Stack

Ideas worth throwing around. Grab the top print, flick it aside, and see what’s next.

React + CSS

Drag a poster left to advance or right to go back, then release to throw. Use the left and right arrow keys, Home, or End. The collection repeats.

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/throw-stack.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 { ThrowStack } from '@/components/anticraft/ThrowStack';

export function Example() {
  return <ThrowStack items={[
    { id: 'big', title: 'Big Ideas', subtitle: 'Poster study / 01', color: '#c8b2e2', content: <span style={{ fontSize: 72 }}>✳</span> },
    { id: 'small', title: 'Small Wonders', subtitle: 'Poster study / 02', color: '#dce8a9', content: <span style={{ fontSize: 72 }}>◒</span> },
    { id: 'wild', title: 'Wild Thoughts', subtitle: 'Poster study / 03', color: '#ee9a72', content: <span style={{ fontSize: 72 }}>↗</span> },
  ]} />;
}
03

Props

PropTypeDefaultDescription
itemsThrowStackItem[]RequiredPrints with unique id, title, decorative ReactNode content, and optional subtitle, CSS color, and href.
defaultValuestringFirst itemThe id of the print initially on top.
onValueChange(id: string) => voidundefinedCalled when a throw or navigation action changes the selected print.
classNamestring''Additional classes. Set --ac-throw-height to size the stack.
04

Motion & accessibility

Considered by default.

Drag the top print horizontally and release to throw it; a short drag returns it to the stack. Previous and next controls, arrow keys, Home, and End offer direct navigation. Prints cycle without being removed from the collection. Touch preserves vertical scrolling. Reduced motion changes the selection immediately without a fly-out.

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