The accessible base
@sypnia/base: the behaviour every piece needs, with no look of its own.
Some things are hard to get right and should never look different from one app to the next: how the keyboard moves through a menu, where focus goes when a dialog closes, what a screen reader says about a switch. @sypnia/base does those things, and nothing else. It has no colours, no sizes, no fonts and no icons.
It is a React package, MIT-licensed, built on React Aria, the same engine Sypnia’s own library uses. Every customer shares it; no customer looks like another because of it.
What it guarantees
| Area | What the base does |
|---|---|
| Focus | a visible focus state only when people use the keyboard; focus moves to a dialog when it opens and back when it closes |
| Keyboard | every piece works with the keyboard alone: arrows in menus and tabs, Escape to close, Enter and Space to press |
| Screen readers | the right role, name and state on every piece; announcements for toasts and changes |
| Layers | one manager for everything that floats (menus, popovers, dialogs, sheets, toasts): the right one is on top, Escape closes the top one, the page behind does not scroll |
| Dialogs and menus | focus kept inside while open, outside clicks handled, nested menus |
| Phone behaviour | hit areas of at least 44 px; popovers become bottom sheets under 640 px; safe areas respected; the field you type in stays visible above the keyboard; nothing depends on hover |
| Languages | right-to-left layouts, dates and numbers in the person’s language |
The pieces
Button, Link, TextField, NumberField, SearchField, Select, ComboBox, Checkbox, RadioGroup, Switch, Slider, Dialog, AlertDialog, Sheet, Popover, Menu, Tooltip, Tabs, Disclosure, Toast region, Table, GridList, Calendar, DatePicker, FileTrigger, DropZone, Toolbar, Breadcrumbs, Form, VisuallyHidden, SkipLink and Layer.
How your look attaches
The base exposes each state as a data attribute, so your styles are plain CSS:
.button { background: var(--espiga-color-accent); border-radius: var(--espiga-radius-control); }
.button[data-pressed] { transform: translateY(1px); }
.button[data-focus-visible] { outline: 2px solid var(--espiga-color-focus); outline-offset: 2px; }States: data-pressed, data-hovered, data-focus-visible, data-open, data-selected, data-invalid, data-disabled.
You never import it directly
Screens import pieces from your own src/design/. design check reports a screen that imports @sypnia/base directly, because that piece would have no look and no place in your gallery.