Editorial Accordion
ComponentsEditorial Accordion
Layout

Editorial Accordion

Big type, fine rules, and room to breathe. A more considered way to tell the story.

React + CSS
THE ART OF THE DETAILS

Small details.
Big difference.

Copy the source. Change every detail. Make something only you could make.

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/editorial-accordion.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 { EditorialAccordion } from '@/components/anticraft/EditorialAccordion';

export function Example() {
  return (
    <EditorialAccordion
      defaultValue="source"
      items={[
        { id: 'source', title: 'Make it your own', content: 'The source is yours to change.' },
        { id: 'license', title: 'Free to ship', content: 'Use it in personal and commercial projects.' },
      ]}
    />
  );
}
03

Props

PropTypeDefaultDescription
itemsEditorialAccordionItem[]RequiredItems with a unique id, string title, and ReactNode content.
defaultValuestringundefinedThe id of the item that starts open. At most one item is open at a time.
classNamestring''Additional classes for the accordion.
04

Motion & accessibility

Considered by default.

Uses native buttons with expanded state and linked content regions. Reduced motion removes the icon and text transitions.

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