Playing cards for your terminal.

An Ink component library for building card games in the CLI. Cards, decks, hands, game state — everything you need to go from idea to playable prototype.

ink-playing-cards storybook
♠

Loading interactive storybook...

Everything you need to deal.

Cards, layouts, state management, and a hook-based game engine — all for the terminal.

♠

Card Components

Render standard, mini, unicode, or fully custom cards. Pick from simple, ASCII, or minimal styles — each with its own character.

♦

Stacks & Decks

Group cards into stacks and decks. Fan them out horizontally, stack vertically, or overlap however you like.

♣

Grid Layouts

Lay cards out in rows and columns. Control spacing, alignment, and how empty slots get filled.

♥

Game State

DeckProvider gives you zones — draw pile, hands, discard, play area. Per-player hands and immutable state out of the box.

🎴

Custom Cards

Design your own cards with structured regions (header, art, body, footer) or go freeform. Five size presets, custom backs.

⚡

Events & Effects

Hook into draws, plays, and shuffles. Chain effects together — conditional, triggered, delayed, or targeted.

Quick start

Install, import, deal. That's it.

1. Install

$ npm install ink-playing-cards ink react

2. Deal some cards

♠

Loading live demo...

Try it yourself.

These are real Ink components running live in your browser. Click a terminal to play with it.

All examples →
Loading live demos...

Built for agents.

Ships with an Agent Skill so your coding agent knows the full API, architecture, and patterns — no hallucinated imports.

Learn more →

Install the skill

npx skills add gfargo/ink-playing-cards

Works with Claude Code, Cursor, Kiro, Copilot, Codex, Amp, Goose, and any agent that supports the open skills spec.

What your agent gets

  • →Every component, hook, and type with correct signatures
  • →Zone system, event dispatch, and effect pipeline architecture
  • →Common gotchas (async dispatch, type guards, ID requirements)
  • →Generates working card game code from natural language prompts