Components

Index card

A 3 x 5 card of cream stock with a red header rule and blue lines every 30 px. Header, body and footer parts lay out on the printed rules; the card can have its rod hole punched at the foot, a colored flag stuck over its edge, and a pile of cards behind it.

Install

terminal
npx shadcn@latest add @wobko/index-card

First time here? Add the registry to components.json first. How to install

Examples

An index card

A red header rule, blue lines every 30 px, and text that sits on them. The title goes above the red line; the footer at the foot.

Rod hole, flag, pile

The details of a card that lived in a card box: a hole punched for the rod, a flag stuck over the edge, more cards behind it.

Taped, clipped, stacked

Paper's tape and fasteners work on a card as on any sheet. Cards turn under a quarter of a degree, so the printed lines stay level under the text.

Flashcards

A real use: a pile of flashcards. Press a button to flip the top card between the question and the answer; the pile behind it shows how many are left.

API reference

IndexCard

A Paper (`index-card` stock, `index` rules) as a flex column, at most 28 rem wide and at least 14 rem tall. It takes every Paper prop except `stock` and `rules`. Body text is 17 px on a 30 px line so it sits on the lines.

PropTypeDefaultDescription
holebooleanfalsePunch the rod hole at the bottom center, in the band under the last blue line; the desk shows through it.
flagAccent | falsefalseA translucent plastic flag stuck over the end edge (tomato, tangerine, lemon, grass, teal, sky, grape, bubblegum). It mirrors in RTL.
stack0 | 1 | 2 | 30Cards visible behind this one, at its foot and far edge.
as / tape / fastener / tilt / seedPaper props-As on any sheet. A card turns less than a page (under 0.25 degrees).

Accessibility

  • An index card is a plain `div`; use `as="article"` or `role="group"` with a label when it means more. The hole, flag and pile are aria-hidden decoration; put anything a flag stands for into text.
  • Body ink is 14:1 on the card; the muted footer 8:1. The printed rules and the red header line are decoration and mirror for right-to-left text.
  • The tilt is zero in calm density; Windows high contrast replaces the drawing with a plain outline.

Source

The files the CLI copies into your project.

Loading the source