Ostraca

Options

render(), mount(), update() and the React component all take the same options. Every one is optional.

render("inbox", {
  state: "loading",
  value: 0.4,
  crew: true,
});
OptionTypeDefaultWhat it does
state"idle", "empty", "loading", "success", "changed", "error""idle"Which of the six states to draw
valuenumber, 0 to 1noneHow far loading has got. Leave it out when nobody knows
revstring or numbernoneThe app's real version, in the changed triangle
figure{ value, unit? } or nullnullA real measure, for figures that draw one
crewbooleanfalsePuts the workers on site
letteredstringnoneA short word lettered on the drawing in the drawn pen
titlestringthe figure's title and stateThe accessible name
decorativebooleanfalseHides the drawing from assistive tech
dir"ltr" or "rtl""ltr""rtl" mirrors the drawing for right to left pages
colorCSS colour--ostraca-thingThe colour of the drawing: its lines, marks and figures
crewColorCSS colour--ostraca-crewThe colour of the workers
paperColorCSS colour--ostraca-paperThe paper the drawing sits on

state#

render("laptop", { state: "error" });

An unknown state throws. See states.

value#

render("wall", { state: "loading", value: rows.length / total });

Only loading builds by it. Values outside 0 to 1 are clamped. A value that is not a finite number counts as no value. See value.

rev#

render("door-frame", { state: "changed", rev: "2.4.1" });

Only changed draws it. Numbers are turned into strings. See rev.

figure#

render("ramp", { state: "loading", value: 0.5, figure: { value: 1.8, unit: "MB" } });

Only the figures listed with a measure below draw it. See figure.

crew#

render("stair", { state: "loading", value: 0.5, crew: true });

Draws the workers for the state: a carrier on the stair while it goes up, a sitter on top when it is done. See workers.

lettered#

render("door-frame", { state: "error", lettered: "Not here" });

A word or two, lettered in the library's own drawn capitals. Some figures keep a place for it, and four of them (the door frame, the ramp, the phone and the camera) point an arrow from the word to the work. The rest letter it in their top left corner.

The pen knows A to Z, the space and the full stop. Lower case is lettered as capitals, and anything else (digits, punctuation, other scripts) is left out of the drawing.

Keep it to about ten letters. The lettering is drawn at one size, and "Page not found anywhere" is already two thirds of a figure's width.

title#

render("inbox", { state: "empty", title: "No messages yet" });

The accessible name, written to the drawing's <title> and aria-label. With no title it is the figure's title and state: "Inbox, empty", "Wall, loading, 40 percent", "Laptop, something went wrong". See accessibility.

decorative#

render("bridge", { state: "success", decorative: true });

For a drawing next to text that already says what happened. It gets aria-hidden="true" and no title.

dir#

render("tin-can-line", { state: "error", dir: "rtl" });

Mirrors the drawing so it faces the way your page reads. Lettering and dimension figures still read left to right. See right to left.

color, crewColor and paperColor#

render("inbox", { state: "loading", crew: true, color: "#c2410c", crewColor: "#1c1917" });
<Ostraca name="inbox" state="loading" crew color="var(--accent-600)" crewColor="var(--text)" />

The colours of one drawing: color for the thing and everything drawn on it, crewColor for the workers, paperColor for the surface it sits on. Any CSS colour works, including var() and light-dark(). Each one sets its --ostraca-* token on that drawing only, so leave it out and the stylesheet's colour stays. Change one with update() or a new prop and the drawing takes it at once. Theming says which colours work.

Figures#

<!-- figures:start --> 34 figures on 8 shelves. Every figure draws all six states. Error says how it goes wrong: it leans off a plumb line or sags under a string. Measure is what figure carries, for the figures that draw one; the example is a sample, so pass your own.

Messages#

Inboxes, notifications, email and comments. Most products show their first empty screen here.

FigureNameForErrorMeasure
BellbellNotifications, all caught up, alerts muted, a reminder going outleanUnread notifications, such as { value: 3 }
InboxinboxInbox zero, no messages yet, new mail coming in, a message that failed to sendleanUnread messages, such as { value: 12 }
MailboxmailboxEmail, newsletters, subscribe forms, a confirmation sent, an address that bouncedleanUnread messages, raising the flag above zero, such as { value: 2 }
NoticeboardnoticeboardComments, feedback, announcements, notes and idea boards with nothing pinned yetleanComments, such as { value: 14 }

Files#

Keeping, finding, charting and throwing away.

FigureNameForErrorMeasure
BinbinTrash, deleted items, an empty bin, restore, deleted for goodleanDays until the bin empties itself, such as { value: 30, unit: "days" }
Filing cabinetfiling-cabinetDocuments, folders, records, no files yet, a file that failed to saveleanFiles in the folder, such as { value: 6 }
Flip chartflip-chartAnalytics, reports, dashboards and charts with no data yetleanThe series to chart, one value per bar, such as { value: [12, 19, 15, 26, 22] }
MagnifiermagnifierSearch, no results, filters that matched nothing, exploreleanResults, such as { value: 0 }

People#

Teams, profiles, sign in and the first achievement.

FigureNameForErrorMeasure
BustbustProfile, account, no photo yet, finish your profile, a deleted accountlean
GategateSign in, private pages, permission needed, locked features, access deniedsag
SeatsseatsTeam members, invites, seats on a plan, attendees, a waiting listsagSeats taken, of the plan's total, such as { value: 4, unit: "seats" }
TrophytrophyAchievements, rewards, goals reached, streaks, leaderboardsleanA streak, rank or score, such as { value: 12 }

Money#

Payments, balances, savings and receipts.

FigureNameForErrorMeasure
Card readercard-readerCheckout, a payment going through, card added, payment declined, subscriptionsleanThe amount being paid, such as { value: 240, unit: "EGP" }
CoinscoinsBalance, savings, earnings, points, cashback, top upsleanThe balance, such as { value: 1240, unit: "EGP" }
ReceiptreceiptInvoices, receipts, billing history, statements, refundsleanThe total, or with no unit a count of line items, such as { value: 1240, unit: "EGP" }
SafesafeSavings goals, vaults, secure storage, backups, encrypted or private dataleanA saved amount or a goal, such as { value: 25000, unit: "EGP" }

Shopping#

Carts, orders, shop fronts and food on the way.

FigureNameForErrorMeasure
Market stallmarket-stallStorefront, seller dashboard, product catalogue, a shop with no products yet, store closedsagProducts, such as { value: 6 }
ParcelparcelOrders, shipping, delivery tracking, returns, a delivery that failedleanParcels in the order, such as { value: 3 }
StovestoveFood orders being cooked, recipes, meal plans, a kitchen closed for the nightleanTime left, such as { value: 12, unit: "min" }
TrolleytrolleyShopping cart, wishlist, saved for later, checkout, an item out of stockleanItems in the cart, such as { value: 9 }

Time#

Calendars, countdowns, reminders and time away.

FigureNameForErrorMeasure
Alarm clockalarm-clockReminders, alarms, due soon, snooze, deadlinesleanTime, such as { value: "7:30" }
CalendarcalendarSchedule, bookings, events, no meetings today, a booking that failedleanDate, such as { value: "2026-10-09" }
Deck chairdeck-chairAway, out of office, time off, do not disturb, quiet hoursleanBack on, such as { value: "Oct 20" }
HourglasshourglassWaiting, a trial ending, a session timing out, rate limited, try again laterleanTime left, such as { value: "4 min" }

Devices#

The computer and phone an app runs on, and what it asks of them.

FigureNameForErrorMeasure
CameracameraPhotos, video, a media library, camera access, a photo uploadlean
LaptoplaptopDesktop apps, installs, signing in on a new computer, a device gone offlinesag
PhonephoneMobile apps, scan to install, a code sent by text, two step sign in, push notificationslean
Server rackserver-rackMaintenance, status pages, outages, deploys, self hostingleanServices, such as { value: 6 }

Site#

The building site the library started from. Six subjects for lists, onboarding, integrations, live connections, missing pages and uploads.

FigureNameForErrorMeasure
BridgebridgeSync, linked accounts and anything joining two endssag
Door framedoor-frameNot found, a page that moved, a way inlean
RamprampUploads, imports and anything sent somewheresagThe size being sent, such as { value: 1.8, unit: "MB" }
StairstairOnboarding, setup and anything done in stepslean
Tin can linetin-can-lineCalls, connections and anything livesag
WallwallLists, tables and rows that fill inlean

Figures of your own join this list once you pass them to define(). The agent skill draws them. <!-- figures:end -->