Pixxl 0.3 rebuilds the foundation of @pixxl-tools/components (tokens, theming, CSS layers, overlays, keyboard support and translations), adds site, marketing, documentation and application components, and packages the candraw editor. Most changes are additive. This guide lists every change that can break an existing app, with the code to change.
Before 1.0, breaking changes ship in minor versions. Upgrade all @pixxl-tools/* packages together: they are released in lockstep and depend on each other by exact version.
Install every @pixxl-tools/* package you use at 0.3.0, and add react-dom if your app does not list it yet.
Move global element resets into @layer pixxl.reset (or delete them) and check pages for spacing changes.
Pass defaultOpen or open to every Dialog, Drawer, BottomSheet and Popover that should render open.
Render <ThemeScript /> (or SitePreferencesProvider) and pass theme to PixxlProvider only when the provider should own the document theme.
Update usePersistentTheme, useBreakpoint and Combobox call sites (signatures below).
Update tests that tab through composite widgets, select ListBox options with arrow keys, or query Combobox options by element type.
Candraw editor apps: import @pixxl-tools/candraw/editor.css and tell users that the rectangle shortcut is now R.
Canvas apps without an AppShell: pass as="main" to CanvasAppCanvas (it and CanvasWorkspace render a div now); cantext hosts: check handlers that relied on the hidden input being on document.body.
Check page widths: Container (and SiteHeader, FooterBar, PublicPage) maxWidth follows the --pixxl-size-content-* tokens (lg is 1200 px, was 1024 px).
Load Inter (or set --pixxl-font-sans-brand), replace variant="solid" on neutral buttons that should stay light with secondary or outline, and pass live to Alerts and Messages that announce changes.
Check composite widgets: tests that tab between items of trees, lists, toolbars, ratings or menus press arrow keys now; ResizeHandle is a separator div; ToolRail is a toolbar, not a nav; name trees, toolbars and tree tables with aria-label.
Check forms, toasts and overlays: drop manual aria-describedby/aria-invalid wiring inside FormField, pass duration to action toasts that should expire, pass defaultOpen to Tour, and use start/end placements on Float and AppSidebar in RTL.
Router apps: pass linkComponent (e.g. next/link) to PixxlProvider and change renderLink callbacks to (props, item); check Dialog className, TagInput, Accordion "" → null, and handlers that relied on onValueChange firing for an unchanged value.
Security and size: replace InspectorPanel responsive / collapsible with ResponsiveInspectorPanel, read consent through getConsent() (it is a JSON record now), pass secure: false to serializeThemeCookie only for plain-http cookies, allowlist extra VideoEmbed hosts, call captureInstallPrompt() early if you offer installation, and update tests that read new-tab link text or ThemeSwitcher[data-variant].
Sites: load css/core.css plus only the component groups you render (site, docs, forms, data, games, inspector, apps), move the theme control into SiteHeader themeSwitcher, check Container gutters, put only language names in LocaleSwitcher ariaLabel, and check Markdown heading sizes and Prose line length.
Apps: drop modal={false} and outside-press workarounds on ResponsiveInspectorPanel, and update tests that query tool palettes, rail button names or Combobox announcements.
Content and games: pass date to ContentDetailPage instead of a date badge, pass announce to a GameOverlay that should be a live region, update tests that query canvas preview cards or rail buttons by exact name or aria-label, and add videoEmbed to complete custom catalogs.
Site shell: drop maxWidth from SiteHeader, FooterBar and PublicPage, let AppMain be the skip target, pass copyright.year from the server, use getThemeColorMeta for viewport.themeColor and cookieDomain={{ shared }} instead of cookie-domain helpers, and give LocaleSwitcher supportedLocales and defaultLocale. Import createSecurityHeaders from /security in next.config.ts, render share images with OgCard from /og and fonts: await loadOgCardFonts(), and add an opengraph-image.tsx to every route that sets its own openGraph.
Run your type check, unit tests and a production build, then review pages in light and dark themes and on a phone.
Every publishable package now has the same version and is released at the same time. Packages that depend on each other (for example candraw on canvas) pin the exact sibling version, so mixing 0.2 and 0.3 packages installs two copies of the shared code.
{
"dependencies": {
"@pixxl-tools/canvas": "^0.2.0",
"@pixxl-tools/candraw": "^0.2.0",
"@pixxl-tools/components": "^0.2.0"
}
}{
"dependencies": {
"@pixxl-tools/canvas": "^0.3.0",
"@pixxl-tools/candraw": "^0.3.0",
"@pixxl-tools/components": "^0.3.0",
"react-dom": "^19.0.0"
}
}Overlays, menus, tooltips, toasts and the combobox list render through createPortal, so react-dom (19 or later) is a required peer of @pixxl-tools/components. On candraw it is an optional peer used by @pixxl-tools/candraw/editor. React apps already install it; React Native or custom renderers cannot use 0.3 components.
The build now emits one minified ES module per component and only modules with hooks or event handlers carry "use client". Paths inside dist/ changed and sourcemaps are no longer published. Import from the documented entry points only: the root, /server, /metadata, /tokens, /icons, /locales/en, /locales/pl, the site-shell catalogs /locales/<code> (de, ja, zh-CN, …), /styles.css, /tokens.css and /css/*.css.
@pixxl-tools/components/server is new: it exports only server-safe components and helpers, so a Server Component that imports from it cannot pull client code by accident. Interactive components such as Autocomplete, Combobox and Dialog are not exported from it.
import { Card } from "@pixxl-tools/components/dist/index.js";// Any component, in client or server code:
import { Card } from "@pixxl-tools/components";
// Server Components that must stay free of client code:
import { Card as ServerCard, PageSection } from "@pixxl-tools/components/server";All Pixxl CSS is wrapped in @layer pixxl.reset, pixxl.base, pixxl.components, pixxl.utilities. Unlayered CSS always beats layered CSS, whatever the specificity. Your overrides no longer need !important or long selectors, but app-wide element resets now override component styles too: * { margin: 0; padding: 0 } removes the padding of every button and card.
Move element resets into the pixxl.reset layer, or put your whole stylesheet in a layer declared after Pixxl’s.
/* app.css: worked in 0.2 because component selectors were more specific */
* {
margin: 0;
padding: 0;
}
.my-dialog .pixxl-button {
border-radius: 0 !important;
}/* app.css */
@layer pixxl.reset {
* {
margin: 0;
padding: 0;
}
}
/* Unlayered: wins over every Pixxl layer without !important. */
.my-dialog .pixxl-button {
border-radius: 0;
}Tailwind v4 and other layered frameworks: declare the order once, for example @layer pixxl.reset, base, pixxl.base, components, pixxl.components, utilities, pixxl.utilities;, before importing either stylesheet.
@pixxl-tools/canvas/styles.css uses the same layers, so canvas app overrides follow the same rule.
Text sizes are now in rem and follow the reader’s browser font size. Body text is 15 px (was 14 px), interface text 14 px, labels 13 px and --pixxl-font-size-xs 12 px (was 10 px), tuned for Inter (see "Visual system" below). Headings and display sizes are fluid between a minimum and maximum. sm, md and lg control heights did not change (xs is 24 px, was 28 px); check tight toolbars and tables.
Dense apps (editors, dashboards) can opt into the compact density, which uses 14 px body and 13 px interface text and smaller controls. Coarse pointers keep at least 44 px touch targets in both densities, and inputs use 16 px text on small screens so iOS does not zoom.
// Whole document:
<html data-density="compact">…</html>
// Or one subtree:
<PixxlProvider density="compact">
<Editor />
</PixxlProvider>HeadingSize gained xl, 2xl and display.
Token objects in @pixxl-tools/components/tokens kept their 0.2 names (spacing, sizes, radius, motion, typography, zIndex), but their values follow the new scale. Prefer the new space, size, fontSize, fontWeight, lineHeight, duration and easing exports. No CSS custom property was removed.
Color tokens are defined in oklch and the primary color is derived from one accent. Hover, active, soft, border, text, focus and on-accent colors follow --pixxl-accent, so overriding a single derived variable (for example --pixxl-color-accent-hover) is no longer the way to rebrand. Use a data-accent preset or set --pixxl-accent.
:root {
--pixxl-color-accent: oklch(0.6 0.12 185);
--pixxl-color-accent-hover: oklch(0.52 0.11 185);
}/* <html data-accent="teal"> — or a brand hue: */
:root {
--pixxl-accent-hue: 185;
--pixxl-accent-chroma: 0.12;
}
/* or one exact color (hue, chroma and lightness still feed browsers
without CSS relative colors): */
:root {
--pixxl-accent: oklch(0.6 0.12 185);
--pixxl-accent-hue: 185;
--pixxl-accent-chroma: 0.12;
--pixxl-accent-lightness-light: 0.6;
--pixxl-accent-lightness-dark: 0.6;
}getThemeColors(theme, accent) returns resolved colors for canvas renderers; the 0.2 colors object is still exported for existing renderers.
Text tokens pass WCAG AA in both themes for every preset; check custom accents with the contrast table on the theming page.
In 0.2 PixxlProvider defaulted to theme="system" and wrote (or removed) data-theme on <html>. In 0.3 it leaves the document theme alone unless you pass theme, so <ThemeScript />, SitePreferencesProvider or your own code can own it without the provider resetting it on mount.
ThemeProvider now always writes data-theme (including system, which follows prefers-color-scheme live). attribute / themeAttribute adds a mirror for your own CSS, for example class toggles light and dark classes; it no longer replaces data-theme.
// 0.2: the provider applied "system" to <html>.
<PixxlProvider>
<App />
</PixxlProvider>// app/layout.tsx
import { PixxlProvider, ThemeScript } from "@pixxl-tools/components";
export default function RootLayout({ children }) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<ThemeScript />
</head>
<body>
<PixxlProvider>{children}</PixxlProvider>
</body>
</html>
);
}
// Or keep the 0.2 behavior explicitly:
<PixxlProvider theme="system">…</PixxlProvider>The stored preference can be "system", the initial value is "system" (was "light") and the hook returns resolvedTheme ("light" or "dark"). Render with resolvedTheme when you need a concrete theme. cookieDomain shares the choice across subdomains and cookieName: false disables the cookie. Use the same storageKey in <ThemeScript /> so the first paint matches.
const { theme, setTheme } = usePersistentTheme();
<Chart dark={theme === "dark"} />
<button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>Toggle</button>const { theme, resolvedTheme, setTheme } = usePersistentTheme({
apply: true, // writes <html data-theme>; omit when a provider owns it
cookieDomain: ".example.com",
storageKey: "theme",
});
<Chart dark={resolvedTheme === "dark"} />
<ThemeSwitcher value={theme} onValueChange={setTheme} variant="segmented" />
// <head>: <ThemeScript storageKey="theme" />Breakpoints now match the CSS: sm 640, md 768, lg 1024 and xl 1280 px. In 0.2 the hook used max-width queries of 640, 720 and 960 px. The second argument is an options object; a boolean is still accepted as serverValue.
// true up to 720 px wide
const compact = useBreakpoint("md", false);// true below 768 px (direction "down" is the default)
const compact = useBreakpoint("md", { serverValue: false });
// true from 1024 px up
const wide = useBreakpoint("lg", { direction: "up" });In 0.2 these overlays defaulted to defaultOpen={true} and rendered in place. In 0.3 they start closed, render in a portal on document.body, and modal overlays (Dialog, Drawer, BottomSheet by default) trap focus, make the rest of the page inert and lock scrolling. Focus returns to the trigger on close.
Pass a trigger element to get aria-expanded, aria-controls and open/close wiring, or control open yourself. Styles that targeted an overlay as a descendant of your container must target the overlay class instead, or render it in place with portal={false}.
{showSettings ? (
<Dialog title="Settings" onClose={() => setShowSettings(false)}>
<SettingsForm />
</Dialog>
) : null}<Dialog
title="Settings"
trigger={<Button>Settings</Button>}
>
<SettingsForm />
</Dialog>
// or controlled:
<Dialog open={showSettings} onOpenChange={setShowSettings} title="Settings">
<SettingsForm />
</Dialog>title on these overlays is a React node rendered as the accessible heading, not the HTML title attribute.
Drawer gained logical sides: start and end (default) follow the writing direction; left, right, top and bottom are physical.
initialFocus, finalFocus, onEscapeKeyDown and onInteractOutside (call event.preventDefault() to stay open) replace custom focus and dismiss code.
Tooltip opens after a 400 ms hover delay (openDelay), immediately on keyboard focus, and on long press for touch; it closes on Escape. It renders in a portal and is positioned with useFloating, so it flips and shifts at the viewport edge. Tests that expected the tooltip in the DOM right after mouseenter need to wait or set openDelay={0}.
Tabs, SegmentedControl, RadioGroup, ToggleGroup, Toolbar, Menu, ContextMenu, Menubar, CommandPalette and Calendar follow the WAI-ARIA Authoring Practices: Tab moves into and out of the widget, and arrow keys, Home and End move inside it. In Tabs, arrows select the focused tab (activationMode="automatic"); use activationMode="manual" to select with Enter or Space instead.
Update end-to-end tests that pressed Tab to reach the second tab or radio.
await page.keyboard.press("Tab"); // first tab
await page.keyboard.press("Tab"); // second tab (0.2)await page.keyboard.press("Tab"); // the selected tab
await page.keyboard.press("ArrowRight"); // next tabIn ListBox, arrow keys now only move the active option; Space or Enter selects it. Set selectionFollowsFocus to restore the 0.2 behavior in single-selection lists where moving should also select.
<ListBox aria-label="Layer" options={layers} value={layer} onValueChange={setLayer} selectionFollowsFocus />Button loading no longer sets disabled. It sets aria-busy and aria-disabled, ignores clicks and keeps focus, so keyboard users do not lose their place. Tests that asserted toBeDisabled() should assert aria-busy instead.
The combobox was rebuilt on the WAI-ARIA editable combobox pattern. The input keeps focus, options are referenced with aria-activedescendant, and the list is portalled and positioned with useFloating.
onValueChange(value, option) passes the selected option object (or null when cleared) as a second argument, and onInputValueChange(value, { reason }) tells you why the text changed: input, select, clear, escape or blur. Existing one-argument callbacks keep working; code that reset state on every input change should check reason.
<Combobox
options={options}
onValueChange={(value) => setUser(users.find((user) => user.id === value))}
onInputValueChange={(text) => search(text)}
/><Combobox<User>
options={users}
getOptionValue={(user) => user.id}
getOptionLabel={(user) => user.name}
onValueChange={(value, user) => setUser(user)}
onInputValueChange={(text, { reason }) => {
if (reason === "input") search(text);
}}
/>Focusing the input does not open the list any more; typing, ArrowDown, Alt+ArrowDown or a click on the toggle does. Set openOnFocus to keep the 0.2 behavior, for example for short static lists.
<Combobox options={countries} openOnFocus />Options are div[role="option"] elements (not buttons) with generated ids and data-active / data-selected attributes; the listbox is rendered in a portal; .pixxl-combobox is block-level and fills its container. Update CSS that targeted .pixxl-combobox button and tests that queried options by element type.
Autocomplete is still an alias of Combobox, but it is no longer exported from @pixxl-tools/components/server; import it from the root in a client module.
await page.locator(".pixxl-combobox button", { hasText: "Ada" }).click();await page.getByRole("option", { name: "Ada" }).click();About 130 built-in strings (close buttons, pagination, loading, empty states, calendar navigation, toasts and more) moved to a typed catalog. English is built in and fills any missing key; Polish ships as @pixxl-tools/components/locales/pl, and partial site-shell catalogs (header, footer, consent banner, toasts, status pages) ship for 19 more languages as @pixxl-tools/components/locales/<code> (ar, de, es, fil, fr, hi, hy, it, ja, ko, ms, nl, pt-BR, pt-PT, ru, uk, ur, zh-CN, zh-HK); combine one with your own strings through mergeMessages. Explicit props such as closeLabel still win, and a test in the package fails when a component adds a hard-coded user-facing string.
Numbers and dates are formatted with the provider locale (default en-US), never the runtime default, so server and client output match. Calendar and DatePicker take the first day of the week from the locale region (Monday for pl-PL, Sunday for en-US) unless weekStartsOn is set.
import { PixxlProvider } from "@pixxl-tools/components";
import { pl } from "@pixxl-tools/components/locales/pl";
<PixxlProvider locale="pl-PL" messages={pl}>
<App />
</PixxlProvider>The .pixxl-candraw-app rules moved from @pixxl-tools/canvas/styles.css to @pixxl-tools/candraw/editor.css. Apps that render the candraw editor must import it after the canvas and components styles.
import "@pixxl-tools/components/styles.css";
import "@pixxl-tools/canvas/styles.css";import "@pixxl-tools/components/styles.css";
import "@pixxl-tools/canvas/styles.css";
import "@pixxl-tools/candraw/editor.css";
import { CandrawEditor } from "@pixxl-tools/candraw/editor";
<div style={{ height: "100dvh" }}>
<CandrawEditor defaultDocument={initial} onChange={save} />
</div>The editor that lived in the pixxl.tools website is now <CandrawEditor> in @pixxl-tools/candraw/editor, with document / defaultDocument, onChange, onSave, slots, locale and messages (Polish: @pixxl-tools/candraw/editor/locales/pl). It needs react-dom and @pixxl-tools/components (optional peers of candraw). Undo history moved into the engine (createHistory, createHistoryController, useCandrawHistory).
The rectangle tool shortcut is R (was E). Shortcuts only fire while focus is inside the editor, not on the whole window. The layers list shows the front-most layer first, like most design tools, and is reordered with a drag handle or Space and the arrow keys.
CanvasMiniMap item and viewport rectangles are aria-hidden and carry an SVG <title> instead of an aria-label, so screen readers no longer announce every shape. Tests that found minimap items by label should query .pixxl-canvas-minimap-item instead.
CanvasWorkspace and CanvasAppCanvas render a div by default (they were main). Inside an AppShell, whose AppMain is the page’s main, the old default nested a second main (axe landmark-no-duplicate-main, landmark-main-is-top-level). A standalone editor page passes as="main" to CanvasAppCanvas, so the page has exactly one main; as="section" with an aria-label makes a named region instead.
Tests that found the canvas area with getByRole("main") should pass as="main" or query by label or class.
<CanvasAppLayout>
<CanvasAppCanvas aria-label="Drawing">
<CanvasWorkspace {...workspaceProps} />
</CanvasAppCanvas>
</CanvasAppLayout>// Standalone app (no AppShell around it): one main, on the canvas area.
<CanvasAppLayout>
<CanvasAppCanvas as="main" aria-label="Drawing">
<CanvasWorkspace {...workspaceProps} />
</CanvasAppCanvas>
</CanvasAppLayout>CantextHost appends its hidden input textarea, live region and accessibility mirror to the canvas’s parent element instead of document.body, so they are inside the editor’s landmark (axe region). Key, input and focus events from the textarea now bubble through your editor’s DOM and its React handlers: shortcut handlers on an ancestor should ignore events whose target is the cantext input (textarea[data-cantext-input]) or another editable element.
Pass options.inputContainer to choose the element, and options.messages (for example cantextMessagesPl) to translate the input’s accessible name, "Canvas text editor". CantextSurfaceRuntime and useCantextTextSurface take inputContainer and messages too; without inputContainer they still use the body.
const editor = new CantextHost({ canvas, options: { a11yMirror: true } });
// The input was document.body > textarea[aria-label="Canvas text editor"]import { CantextHost, cantextMessagesPl } from "@pixxl-tools/cantext/react";
const editor = new CantextHost({
canvas,
options: { a11yMirror: true, messages: cantextMessagesPl },
});
// The input is canvas.parentElement > textarea[data-cantext-input]0.3 retunes the look for Inter, aligns every control to one height system and gives buttons, badges and form controls distinct, consistent variants. Review pages in both themes after upgrading.
Button, IconButton, ActionLink (and Badge, Tag, Chip, Card, Surface, Message) share five variants: solid, secondary, soft, outline and ghost. A plain <Button> is now a secondary button (a quiet raised fill without a border); variant defaults to secondary for the neutral tone and to solid for colored tones, so <Button tone="primary"> is still the filled call to action.
variant="solid" with the neutral tone is now filled with the text color (dark in light mode, light in dark mode), matching Badge. In 0.2 it was a white box with a border, which looked the same as outline.
<Button variant="solid">Cancel</Button> {/* 0.2: white, bordered */}
<Button>Cancel</Button><Button>Cancel</Button> {/* secondary */}
<Button variant="outline">Cancel</Button> {/* bordered, transparent */}
<Button variant="solid">Continue</Button> {/* dark neutral fill */}Neutral soft is a translucent fill that works on any surface; neutral outline uses --pixxl-color-border-strong and darkens to --pixxl-color-border-control on hover.
Button text uses weight 500 (was 600).
The sans stack prefers a site-loaded Inter: --pixxl-font-family-sans starts with var(--pixxl-font-sans-brand, "Inter Variable"). Pixxl ships no font files; load Inter with next/font/google or @fontsource-variable/inter (see the theming guide) or set --pixxl-font-sans-brand to your own stack. Without it the system UI font is used.
The comfortable density is body 15 px, UI 14 px, labels 13 px (weight 500) and captions 12 px; headings use weight 600 and display sizes 700 with tighter tracking. Compact is 14/13/12/12 px.
Every control of a size has exactly --pixxl-control-{size} height: TextField with addons or a clear button (was 2 px taller), Select, Combobox, SegmentedControl (was 44 px at md), Button, IconButton and ToggleButton. xs is 24 px (was 28 px); compact is 24/28/32/40 px (was 24/28/34/42 px). Coarse pointers still get 44 px.
// app/layout.tsx
import { Inter } from "next/font/google";
const inter = Inter({ subsets: ["latin", "latin-ext"], variable: "--font-inter" });
// <html className={inter.variable}>
/* globals.css */
:root { --pixxl-font-sans-brand: var(--font-inter); }The light page background is slightly darker (oklch(0.975 0.004 264)) so white cards separate from it; cards and overlays get an inner top highlight in dark mode, and dark soft fills use 14 % of the color (was 20 %).
A data-theme on <html> now also paints the page: background-color: var(--pixxl-color-background) and color: var(--pixxl-color-text), at zero specificity, so dark mode never shows the browser’s default canvas. Your own html/body rules still win.
Checkbox, Radio, RadioGroup, CheckboxGroup, CheckboxCard, RadioCard and the DataTable row checkbox render a token-styled box (.pixxl-checkbox-indicator / .pixxl-radio-indicator) after a visually hidden native input, wrapped in .pixxl-checkbox-control / .pixxl-radio-control. The input keeps focus, keyboard, forms and labels; ref, id and input props still go to it.
CSS that targeted .pixxl-checkbox input or relied on accent-color must target the indicator instead. Checkbox gained indeterminate.
.pixxl-checkbox input { accent-color: hotpink; }// Checked boxes use the accent (CSS: .my-form { --pixxl-accent: oklch(0.65 0.2 350); })
<Checkbox indeterminate={some && !all} checked={all} label="Select all" />Alert always had role="status" and Message defaulted to it, so every static callout was a live region. Both are now static; pass live when the content appears in response to an action (live uses role="alert" for danger, role="status" otherwise; "polite" / "assertive" force one).
Alert, Message, Toast and StatusBox show a tone icon (pass icon to replace it, icon={false} to hide it), render the title as .pixxl-feedback-title (a <p>, was <strong>) and let inline content flow (.pixxl-message-content is no longer a grid). Message soft is tinted with the tone.
<Alert tone="danger" title="Upload failed">{error}</Alert><Alert live tone="danger" title="Upload failed">{error}</Alert>
<Message tone="info" title="Changed in 0.3">Use <code>loading</code> instead.</Message>Badge is a 20 px status label (radius 6, 12 px / 500), Tag a 24 px category label with a hairline border and an optional onRemove, and Chip a 32 px pill with hover and selected states (aria-pressed, aria-selected or data-state="selected"). The Chip remove button shows an icon instead of the letter x. Kbd is a key cap.
PixxlProvider and DirectionProvider defaulted direction to ltr and wrote dir="ltr", overriding <html dir="rtl">. Now PixxlProvider writes dir only for an explicit direction or a locale (it follows the locale: ar → rtl, see getLocaleDirection); otherwise the document’s direction applies. Pass direction="ltr" to keep a left-to-right island.
Portals carry the scope they were opened from: data-theme, data-accent, data-density, dir and lang of the closest ancestors, plus the pixxl-ui class for typography. A menu opened inside <section data-theme="dark" lang="pl"> stays dark and Polish.
Code, identifiers, emails, URLs, phone numbers, numbers and PIN inputs stay left to right (and isolated) inside right-to-left pages.
Surface placement="left"/"right" are logical (start / end) like Float, so they flip in RTL.
Pagination and DataPagination read "Page 2 of 10" (pagination.status, dataPagination.status; Polish "Strona 2 z 10"), not "2 / 10". Rating names each star "3 of 5", SeekBar reads its position as durations (seekBar.valueText) and moves 5 s per arrow key (keyboardStep). Update tests that matched the old text, or pass messages to keep it.
<PixxlProvider messages={{ pagination: { status: "{page} / {total}" } }}>…</PixxlProvider>Container maxWidth uses the --pixxl-size-content-* tokens it documented: sm 760, md 960, lg 1200, xl 1320 px (was 640/768/1024/1280). Everything built on Container follows: SiteHeader, FooterBar and PublicPage default to lg (now 1200 px). Pass a smaller maxWidth, or set the tokens, to keep the old measure.
Toggle (and the toggles of ToggleGroup) is a pressable button sized to its label with a --pixxl-color-border-control edge; it used to stretch to the full width like a menu row. A horizontal ToggleGroup wraps its toggles like chips (overflow="scroll" keeps one sideways-scrolling row) and a vertical one stacks them at full width.
In a BottomSheet only the content scrolls: the handle, the header (title and close button) and the footer stay in view. Code that scrolled the sheet element itself should scroll .pixxl-bottom-sheet-content. Dialog, Drawer and BottomSheet content is one minmax(0, 1fr) column, so a wide child (a tab list) scrolls inside it instead of widening the panel.
<Container maxWidth="lg">…</Container> {/* 1024 px */}<Container maxWidth="lg">…</Container> {/* 1200 px (--pixxl-size-content-lg) */}
<Container maxWidth="md">…</Container> {/* 960 px: closest to the old lg */}The editor’s topbar.openError and export.error messages dropped the {message} placeholder: users see a localised status, and unexpected errors also go to the console (expected ones, UnsupportedDrawingError, DrawingFileTooLargeError and refused images, are not logged). Unreadable files show topbar.unsupportedFile; parseDrawingJson and readDrawingFile throw UnsupportedDrawingError, whose cause holds the original error. Both open paper.js exports (JSON arrays) as well as candraw documents.
Templates, swatch names, default item and page names and the export file name now come from the editor catalog (templates, defaults, swatches). Catalogs that override every key must add these namespaces; partial overrides are unaffected.
{ topbar: { openError: "Could not open the file: {message}" }, export: { error: "Export failed: {message}" } }{ topbar: { openError: "Could not open the file." }, export: { error: "Export failed. Try a smaller scale or another format." } }0.3 wires form fields to their controls, keeps toasts usable under modal dialogs and moves focus more carefully. Most of it needs no code change; these steps list what can affect tests, styles or behavior you rely on.
Every Pixxl form control inside FormField now gets the field’s ids: the label’s for matches the control’s id (generated unless the control or labelFor sets one), aria-describedby lists description then error, and with an error the control gets aria-invalid="true" and aria-errormessage. required adds aria-required. Radio groups, checkbox groups, segmented controls, list boxes, toggle groups, PIN inputs and date ranges are named with aria-labelledby.
Controls inside a FormField with a label drop their fallback aria-label ("Date", "Tag", "Choose an option"…), so the visible label is the accessible name. Tests that queried a control by that fallback name must use the field label.
FormField gained invalid (invalid without a message). It stays server-safe; the wiring is a small client leaf.
<FormField label="Email" labelFor="email" error={error}>
<TextField id="email" aria-describedby="email-error" invalid={Boolean(error)} />
</FormField><FormField label="Email" error={error}>
<TextField />
</FormField>Your own id, aria-describedby and aria-invalid on the control are kept and merged.
Modal overlays no longer make the toast viewport (or any live region) inert: an "Undo" toast stays clickable and announced while a Dialog is open, F8 moves focus to the toasts from inside the dialog and Escape returns to it. Escape on a focused toast dismisses it; when a focused toast goes away, focus moves to the next toast or back.
Toasts with actions stay until dismissed unless they set duration. All timers also pause while the window is blurred.
The viewport is a labelled region ("Notifications (F8)") only while toasts are shown. Close buttons are named after the toast: "Close notification: Saved".
ToastRegion is a labelled role="region" ("Notifications") instead of role="status"; each Toast announces itself, so messages are no longer read twice.
// 0.2: gone after 5 s
toast.success({ title: "Deleted", actions: <Button onClick={undo}>Undo</Button> });// 0.3: stays until dismissed; opt back in to a timer explicitly
toast.success({ title: "Deleted", actions: <Button onClick={undo}>Undo</Button>, duration: 10_000 });Tests that queried getByRole("button", { name: "Close notification" }) must use the new name, and tests that waited for an action toast to expire must pass duration.
Focus traps keep aria-disabled elements (a loading Button) in the Tab order and only skip native :disabled ones; hidden ancestors are detected with checkVisibility().
When an overlay closes and its trigger is gone (a deleted row, a menu item that removed itself), focus moves to the trigger’s neighbour in the tab order, then to <main>, instead of <body>. The new onCloseAutoFocus(event) on Dialog, Drawer, BottomSheet and Popover lets you take over (event.preventDefault()).
Programmatic focus (Tab wrapping, restore, roving focus) scrolls the element into view with block: "nearest"; only the initial focus of a surface skips scrolling. A sticky SiteHeader, a bottom ConsentBanner and visible toasts write --pixxl-scroll-padding-block-start / -end, which base.css applies as scroll-padding on <html>, so focus is never hidden behind them. A site’s own scroll-padding still wins.
Overlay layers stack in the order they opened, so a parent and a child that both start open close child first. A touch outside an open layer dismisses it on the following click, so starting a scroll does not close it.
Pagination and Carousel Previous/Next are aria-disabled (not disabled) at the ends, so the focused button keeps focus. Removing a TagInput or Combobox chip moves focus to the next chip (or the input) and announces "Removed …".
Tests asserting toBeDisabled() on Pagination/Carousel end buttons must check aria-disabled="true".
The header and footer of Dialog, Drawer and BottomSheet, and the DialogHeader / DialogFooter parts, render <div> instead of <header> / <footer>: inside role="dialog" those were page banner / contentinfo landmarks. Classes are unchanged.
DialogTitle and DialogDescription rendered in the content name and describe the surrounding Dialog, Drawer or BottomSheet. Drawer and BottomSheet accept labelledBy. Dialogs without an accessible name log a development warning.
ConfirmDialog is described by its body, ignores backdrop clicks while it is an alertdialog, and calls onClose after Confirm too (onCancel still only when cancelled). Popconfirm stays a non-modal role="dialog", now described by description.
Popover keeps your own aria-labelledby, aria-modal and role (they were overwritten).
.pixxl-dialog-surface > header { … }.pixxl-dialog-header { … }CommandPalette no longer has role="dialog" or an aria-label on its root; its list is named "Commands". For the modal version use the new CommandDialog (Dialog + palette, closes after a command runs).
Tour is closed by default (defaultOpen was true). Open, it is a non-modal dialog named "Tour" plus the step title, described by the step, with focus moved in and returned, and Escape finishes it. Previous is aria-disabled on the first step.
<Tour steps={steps} /><Tour defaultOpen steps={steps} />
<CommandDialog options={commands} trigger={<Button>Commands</Button>} />Tooltip adds nothing while disabled, keeps its bubble open on a press inside it (text can be selected), and after a touch long-press stays open until the next tap outside (it used to hide after 1.5 s). mode="label" names an icon-only trigger instead of describing it. A text child logs a development warning: use one focusable element.
HoverCard describes its trigger while open, lets Tab move from the trigger into the card and on past it, and opens on a touch long-press.
ToggleTip wires a custom trigger (children) like its default button: click toggles, aria-expanded, aria-controls, focus return.
Float, Surface and PixxlPlacement accept start / end (plus -start / -end alignments), which follow the writing direction. left / right are physical everywhere — Surface, useFloating, Popover, Tooltip, Menu and Drawer already were; Float mirrored them in RTL in 0.2 and no longer does.
AppSidebar side accepts start (new default, the 0.2 behavior of left) and end; an explicit left / right is now physical, so in RTL side="left" puts the border on the other edge — use start / end.
Prefer start / end; left / right stay for layouts that must not mirror.
<Float placement="right" /> {/* 0.2: after the anchor, on the left in RTL */}<Float placement="end" /> {/* after the anchor in both directions */}
<Float placement="right" /> {/* always on the right */}Several ThemeProviders on the same element (a layout and a page, a docs demo) form a stack in mount order: the latest mounted applies, a lower one taking over when it unmounts, and the element’s original data-theme (and mirrored attribute or class) comes back only after the last one unmounts — in any order. Before, unmounting out of order restored the wrong theme.
target={null} (a ref that is not attached yet) now applies nothing until an element arrives; it used to fall back to <html>. Omit target for <html>.
{target ? <ThemeProvider target={target} theme="dark" /> : null}<ThemeProvider target={target} theme="dark" />In Windows High Contrast a checked Switch is a Highlight track with a HighlightText thumb (the thumb used to vanish); drawers, sheets, toasts, hover cards, the combobox popup and the consent banner get a CanvasText edge; pressed and selected buttons, toggles, segments, options and keypad keys use Highlight; color swatches keep their color with a Highlight ring when selected. The rules live in the components layer.
Every widget that renders a composite role (tree, treegrid, listbox, menu, toolbar, radio group, tabs, separator) now follows its WAI-ARIA APG keyboard pattern: one Tab stop, arrow keys, Home/End and type-ahead. Mostly this changes how tests tab through pages and which elements are buttons.
TreeView items are focusable treeitems with one Tab stop (no inner buttons any more): Up/Down move, Right expands or enters a node, Left collapses or goes to the parent (mirrored in RTL), Home/End, * expands all siblings and type-ahead jumps by label; Enter, Space or a click selects. Items carry aria-level, aria-setsize, aria-posinset and aria-expanded, and children sit in a role="group". The twisty is a decorative chevron.
TableTree is a treegrid: focusable rows with the same tree keys, plus cells (columns, with a header row) reached with Right and moved between with the arrows. It is a client component now, so it is no longer exported from @pixxl-tools/components/server.
TreeSelect opens that tree (aria-haspopup="tree"), focuses the selection, closes on Escape, outside presses and focus loss, and returns focus to its button.
// 0.2: a button per row (and per twisty)
await page.getByRole("button", { name: "Reports" }).click();await page.getByRole("treeitem", { name: "Reports" }).click();
// Name the tree; a tree table types its rows (`Item` is inferred from `items`)
type File = DataTreeItem & { size: string };
const files: File[] = [{ id: "reports", label: "Reports", size: "2 MB" }];
<TreeView aria-label="Files" items={files} />
<TableTree aria-label="Files" items={files} columns={[{ id: "size", header: "Size", cell: (file) => file.size }]} />EntityList, OptionList, SwatchGrid, each Cascader column and an interactive Rating use roving focus: Tab reaches the selected item (or the first), arrow keys and Home/End move (type-ahead in lists; Up/Down by row in SwatchGrid; Right/Left between Cascader columns), and Rating checks the star it moves to.
ActionBar and ToolRail are WAI-ARIA toolbars with one Tab stop. ToolRail renders div role="toolbar" with aria-orientation="vertical" instead of a nav landmark (pass aria-label; orientation="horizontal" for a horizontal rail).
OptionList and ListBox with selectionMode="none" no longer set aria-selected. ListBox gained type-ahead and, with selectionMode="multiple", Shift+Arrow, Shift+Space, Ctrl+Shift+Home/End and Ctrl+A.
Tests that pressed Tab to reach the second item of these widgets must press an arrow key instead.
The default Menu trigger shows a chevron (showIndicator={false} hides it; MenuButton has the same prop). Space on a checkbox or radio item toggles it and keeps the menu open (Enter and clicks still close it); adjacent radio items are wrapped in role="group".
Disabled menu items render aria-disabled and stay reachable with the arrow keys (they no longer use the native disabled); clicks and Enter do nothing.
Tab from an open Menubar menu or a ContextMenu returns focus to the menubar item / the element it opened from before moving on; ContextMenu is named "Context menu" (label). In a Menubar, Left/Right without an open menu only move focus.
Tabs put aria-label/aria-labelledby on the tablist (listProps for more), always keep a Tab stop (the first enabled tab when the value matches none), and can keep inactive panels mounted with keepMounted.
A consumer onKeyDown on RadioGroup, SegmentedControl, ToggleGroup and RovingFocusGroup runs before the arrow-key handling instead of replacing it (call preventDefault() to skip it), and arrows move from the focused item.
ResizeHandle renders div role="separator" (was a button): its ref is an HTMLDivElement and it no longer takes type. Only the arrow keys of its axis move it (Left/Right for side-by-side panels, mirrored in RTL; Up/Down for stacked ones); Home/End call onEdge, Enter calls onToggle, and the pointer drags it (onDragTo(fraction)).
Splitter wires all of it: aria-valuenow/aria-valuemin/aria-valuemax (the first panel’s percentage), aria-controls, Enter to collapse and restore, pointer drag, and the new step and handleLabel props.
<ResizeHandle onStep={resize} type="button" /><ResizeHandle aria-valuenow={size} aria-valuemin={0} aria-valuemax={100} onStep={resize} onDragTo={(fraction) => setSize(fraction * 100)} />Keypad/KeypadGrid: Escape is no longer a default shortcut of the clear key (Delete still is), so a Dialog around the pad closes with Escape; add shortcuts: ["Escape", "Delete"] to keep it. With keyboard="global", text fields, selects, editable content, comboboxes, spin buttons, listboxes, menus, trees, grids and other pads keep every key, a dialog the pad is not in takes nothing, and other focused controls (buttons, radios, checkboxes, links, sliders) keep Enter, Space, Escape, Tab and the arrow/Home/End/Page keys — digits, operators and Backspace typed there go to the pad.
KeypadGrid (and Keypad) is one Tab stop with roving tabindex: Tab enters on the key focused last (else an autoFocus key, else the first enabled one), arrow keys move between keys (Up/Down to the nearest key of the next rendered row), Home/End go to the row’s first/last key and Ctrl+Home/End to the pad’s. Tests or scripts that Tab from key to key should press the arrow keys (or click) instead; a key’s own arrow shortcuts still press it.
PinInput accepts digits only by default (type="alphanumeric" for letters), advances as you type, steps back on Backspace, distributes a pasted code, sets autocomplete="one-time-code" on the first field (autoComplete to change it) and calls onComplete. The value has no gaps (fields after the first empty one are not editable), the fields are one Tab stop and the group is named "Code" outside a labelled FormField.
Mentions matches the word at the caret (not the end of the text), inserts there and keeps focus in the textarea, which gains list autocomplete attributes (aria-autocomplete, aria-haspopup, aria-controls, aria-activedescendant). Suggestions show only while it has focus and are div role="option"s (not buttons); ArrowUp/Down, Enter/Tab and Escape drive them.
Accordion triggers sit inside a heading (headingLevel, default 3), control a labelled region panel (up to six items) and show a chevron; closed panels stay in the DOM, hidden and empty. Pick headingLevel to match your outline; global h3 styles may now apply to the trigger row.
Stepper items are div role="listitem" wrapping a button (was button role="listitem"); completed and failed steps add visually hidden text.
Carousel is a region with aria-roledescription="carousel" (named "Carousel" unless you pass aria-label), the slide a group named "2 of 5", and only that short position is announced (the slide content is no longer a live region). The visible counter reads "2 of 5" (was "2 / 5").
Combobox drops its fallback aria-label when a <label for> names the input, inputProps["aria-label"] now wins over inputLabel's fallback, and inputRef reaches the input. Typed matches are highlighted with <mark class="pixxl-combobox-match">, the footer shows the result count, and loading is shown and announced while results are listed.
SortableList announces politely (was assertive), keeps focus on the moved item’s handle after a keyboard drop, and warns in development when items have no stable id.
On coarse pointers xs/sm/md/lg are 32/36/44/48 px (they were 44/44/44/48), so size still means something on phones. xs/sm buttons, icon buttons, toggles and segments keep their look and extend their hit area to 44 × 44 px with an invisible ::after. data-density="compact" is one step denser on touch screens too (28/32/36/44).
InputStepper takes size (sm/md/lg, default md: the buttons now match the field, they were fixed sm beside an md field) and draws MinusIcon/PlusIcon instead of "-"/"+" text (names unchanged: "Decrease"/"Increase"). On touch screens its buttons and field are 44 px at every size.
Controls whose hit area cannot grow invisibly are 44 px themselves on touch screens: SegmentedControl options (and segmented ThemeSwitchers) are at least 44 px wide (a sideways ::after slop would overlap the neighbouring option; the slop still makes them 44 px tall), native Selects and InputGroups are at least 44 px tall, AccentSwitcher swatches are 44 × 44 px targets and FooterBar links are 44 px rows.
If a layout relied on every touch control being 44 px tall, set size="md" (or override --pixxl-control-sm).
0.3 makes the component API predictable: one way to plug in a router, every stateful component controlled or uncontrolled, className/style/ref on one element, typed values and one vocabulary for props. The rules are on the API Contract page; these steps list what can break.
PixxlProvider takes linkComponent (for example next/link): Link, ActionLink, LinkOverlay, Breadcrumbs, SideNav, BottomNavigation, NavigationMenu, ResponsiveNavbar, SiteHeader, LocaleSwitcher links, ProjectCard, FeatureGrid, Markdown links and menu items with href render through it. The library never imports next/*. Pass a client component (next/link is one) or wrap the provider in your own client module.
Where one component still needs its own link, renderLink has one signature everywhere: renderLink(props, item), where props (href, className, children, aria-current, handlers) go on your link. Breadcrumbs (was (item, index)) and ResponsiveNavbar (was (item, index, state); the props now close the mobile menu and carry aria-current) changed.
SideNav, BottomNavigation and NavigationMenu render <a href> for items with href and buttons for the others (they rendered buttons with aria-current="page" for links). NavigationMenu keys and selects items by id (was href or the index) and respects disabled.
<Breadcrumbs items={items} renderLink={(item) => <Link href={item.href}>{item.label}</Link>} />
<SideNav items={[{ id: "docs", href: "/docs", label: "Docs" }]} value={id} /> // a <button>import NextLink from "next/link";
<PixxlProvider linkComponent={NextLink}>
<Breadcrumbs items={items} />
<SideNav items={[{ id: "docs", href: "/docs", label: "Docs" }]} value={id} />
</PixxlProvider>
// Only where one component needs something else:
<Breadcrumbs items={items} renderLink={(props, item) => <NextLink {...props} prefetch={false} />} />Button, IconButton, Link, ActionLink and MenuItem accept asChild: they render their single child with their own props merged in (Slot). Handlers are composed (the child’s runs first; preventDefault() skips the component’s), classes joined, styles merged and refs composed. Slot used to overwrite the child’s handlers, style and ref.
Menu items with href (MenuAction.href) render a link (<a role="menuitem">) through linkComponent. Card takes as (article by default, section, div, li, aside).
Tab triggers have no asChild: tabs that navigate are a navigation, so use NavigationMenu or SideNav with href items.
<Button asChild tone="primary">
<NextLink href="/signup">Sign up</NextLink>
</Button>
<Menu items={[{ href: "/settings", id: "settings", label: "Settings" }]} label="Account" />SegmentedControl, Slider, SeekBar and VolumeControl no longer require value; SideNav, BottomNavigation, NavigationMenu, ResponsiveNavbar, Stepper, Timeline, ActionList, SwatchGrid, ToolRail and OptionList take defaultValue; DataTable takes defaultSelectedRows, defaultSort (uncontrolled sorting orders rows by the column accessor), defaultExpandedRows and selectable; VolumeControl takes defaultMuted / onMutedChange; Accordion single-item mode takes onOpenChange.
Native defaultValue / onChange are no longer part of these components' types, so <SegmentedControl defaultValue> means the component’s state, not a DOM attribute.
onValueChange (and onOpenChange, …) fire only when the value changes: clicking the selected tab, segment or date no longer calls it. Pickers that closed on onValueChange use the new onAction (Calendar, TreeView, TableTree), which fires on every choice.
null is the controlled "nothing selected" value of single-choice components (RadioGroup, ListBox, ToggleGroup, SegmentedControl, Accordion, nav and tool components). Accordion reports null when its panel closes (was ""). Switching a component between controlled (value) and uncontrolled (undefined) logs a development warning.
const [segment, setSegment] = useState("list"); // required
<SegmentedControl items={items} value={segment} onValueChange={setSegment} />
<Accordion items={items} onValueChange={(id) => id === "" && onCollapse()} /><SegmentedControl items={items} defaultValue="list" />
<Accordion items={items} onValueChange={(id) => id === null && onCollapse()} />TagInput is controlled or uncontrolled like the rest: value / defaultValue / onValueChange hold the tags (string[]), inputValue / defaultInputValue / onInputValueChange the draft text. tags is gone; onAddTag and onRemoveTag are optional notifications. Duplicate tags are ignored unless allowDuplicates.
<TagInput
onAddTag={(tag) => setTags([...tags, tag])}
onRemoveTag={(tag) => setTags(tags.filter((item) => item !== tag))}
onValueChange={setDraft}
tags={tags}
value={draft}
/><TagInput onValueChange={setTags} value={tags} />
// or uncontrolled:
<TagInput defaultValue={["design"]} />Components put className, style, ref and other attributes on their main element; inner parts take *Props (backdropProps, inputProps, listProps, classNames).
Dialog now puts className and ref on the dialog surface (role="dialog"), like Drawer and BottomSheet (they went to the backdrop). Style the backdrop with backdropProps (all three).
Form controls keep ref, id and native attributes on the native input (form libraries register it) and put className and style on the outermost element: Checkbox, Switch and CheckboxCard now also put style on their label, TextField and NumberField (with steppers) put style on the input group when there is one.
Merged refs are memoised: your callback refs are no longer called with null and the node again on every render, and React 19 ref cleanups run once.
<Dialog className="wide" /> /* class landed on the backdrop */
.wide { /* … */ }<Dialog backdropProps={{ className: "blurred" }} className="wide" open title="Settings" />DataTable keeps the row type (rowId={(user) => user.id} is checked against Row); TableTree takes the item type of items for columns[].cell.
Tabs, RadioGroup, Select and Combobox take a Value extends string type parameter, inferred from value / defaultValue, so onValueChange reports your union of ids.
ListBox, ToggleGroup, OptionList and Accordion props are discriminated by selectionMode / multiple: onValueChange reports string or string[] accordingly (was string | readonly string[]). With selectionMode="none" use onAction.
title, content and defaultValue props that render are ReactNode again (17 components collapsed them to string). SelectOption.label is a string (an <option> cannot hold markup); radio, checkbox and transfer groups use ChoiceOption with a ReactNode label. NumberField value is number | string | null and defaultValue number | null. InlineEdit onSubmit receives the text only. TableCell / TableHeadCell accept colSpan, scope, …
Every component exports its props type (TableRowProps, ToolHistoryPanelProps, MenuItemTone, …).
type View = "list" | "grid";
const [view, setView] = useState<View>("list");
<Tabs items={[{ id: "list", label: "List" }, { id: "grid", label: "Grid" }]} onValueChange={setView} value={view} />Booleans: checked / defaultChecked / onCheckedChange (Checkbox, Switch, CheckboxCard; onValueChange is deprecated) and pressed / defaultPressed / onPressedChange (Toggle; value / defaultValue / onValueChange are deprecated).
Commands: onAction(id) on Menu, ContextMenu, Menubar, ActionBar, CommandPalette (also when a command runs again), ListBox and OptionList; onValueChange on the menus and ActionBar is a deprecated alias.
Tones and variants: neutral replaces default on Text and Link (default still works); InlineCode tone="primary" and CallToAction variant="solid" replace accent; keypad keys take tone + variant (secondary, soft, solid) instead of combined values like variant="danger".
Gaps: one PixxlGap scale (none, xs, sm, md, lg = 0, 4, 8, 16, 20 px) for Stack, Inline, Grid, SimpleGrid, Cluster, ResponsiveGrid and Form. ResponsiveGrid gap="lg" is 20 px (was 24) and Form gap="sm" 8 px (was 12); gap="none" is 0 everywhere.
ToolInspectorShell classes → classNames (plus className on the root); VolumeControl onMuteToggle → onMutedChange.
<Checkbox onValueChange={setChecked} />
<Toggle value={bold} onValueChange={setBold} />
<Menu items={items} onValueChange={run} />
<Text tone="default" /><Checkbox onCheckedChange={setChecked} />
<Toggle pressed={bold} onPressedChange={setBold} />
<Menu items={items} onAction={run} />
<Text tone="neutral" />DataFileDialog, ToolHistoryPanel and ToolStylesPanel have English and Polish defaults for every label (labels is optional and partial), forward ref and className, and export their props types. DataFileDialog's primary button uses the primary tone. They stay in @pixxl-tools/components (the candraw editor and the pixxl tools use them).
usePersistentTheme({ apply: true }) writes the preference to <html data-theme> whenever it changes, so a controlled ThemeSwitcher driven by the hook switches the theme. Without apply the hook only stores the preference (as in 0.3 previews), which suits apps where SitePreferencesProvider or PixxlProvider theme owns the attribute.
const { theme, setTheme } = usePersistentTheme({ apply: true, storageKey: "theme" });
<ThemeSwitcher onValueChange={setTheme} value={theme} variant="segmented" />Every export has a default condition and ./package.json is exported, so Jest, CommonJS bundlers and require.resolve("…/package.json") resolve the packages (they failed with ERR_PACKAGE_PATH_NOT_EXPORTED). The packages are still ESM-only.
@pixxl-tools/components and @pixxl-tools/docs-engine no longer write //# sourceMappingURL comments for maps they do not publish (no more devtools 404s).
propGroups are generated from each component’s props type: the vocabulary groups it uses (value state, open state, checked state, links, field, …), then props (its other own props) and native when it passes DOM attributes through. description is the component’s JSDoc summary where it has one; examples is empty (the docs site has the live examples). Tools that generated code from the old placeholder groups should read the new ones.
0.3 treats URLs, cookies, inline styles, embeds and stored preferences as untrusted input, and splits the CSS and one heavy component so pages ship less. The rules are in the README section "Security and Content Security Policy"; these steps list what can break.
Link, ActionLink, LinkOverlay, nav items, menu links, SkipLink, AnchorNav, Markdown links and the navigation of LocaleSwitcher / VersionPicker keep only relative, http(s):, mailto: and tel: URLs. javascript:, vbscript:, data: and obfuscated forms such as java\tscript: are dropped (the anchor renders without href, with a development warning). Markdown images also accept blob: and data:image/*. Check your own sinks with the new isSafeUrl(url, { protocols }) / sanitizeUrl().
target="_blank" links get rel="noopener noreferrer" (or noopener added to your own rel) and a visually hidden "(opens in a new tab)" from the new link message namespace (en + pl). Tests that compare a new-tab link’s full text content or accessible name must include it; a complete custom catalog typed as PixxlMessages must add link.newTab.
<ActionLink href={userUrl}>Website</ActionLink> // "javascript:…" rendered as-is
<Link href="https://example.com" target="_blank" rel="noopener noreferrer">Docs</Link><ActionLink href={userUrl}>Website</ActionLink> // unsafe schemes are dropped
<Link href="https://example.com" target="_blank">Docs</Link> // rel + "(opens in a new tab)" addedserializeThemeCookie adds Secure unless you pass secure: false (the library’s own browser helpers pass false on plain-http pages). It throws a TypeError for a domain, path or sameSite that could inject attributes (e.g. ".x.com; SameSite=None"), and a non-finite maxAgeSeconds falls back to one year instead of a session cookie. New options: path, sameSite (None always adds Secure).
ThemeScript / SitePreferencesProvider throw for a themeAttribute / attribute that is not class or a plain attribute name (event handlers and style are refused).
SitePreferencesProvider ignores a stored locale that is not a valid BCP 47 tag; pass supportedLocales to accept only your locales (matchSupportedLocale). PixxlProvider writes the canonical tag to lang (pl_pl → pl-PL).
document.cookie = serializeThemeCookie("pixxl-theme", "dark", { domain: ".gtktsc.com" });
// pixxl-theme=dark; Path=/; Max-Age=31536000; SameSite=Lax; Domain=.gtktsc.com; Secure
<SitePreferencesProvider locale={locale} supportedLocales={["en", "pl"]}>
{children}
</SitePreferencesProvider>useConsent / ConsentBanner store { decision, timestamp, version } as JSON under analytics-consent (0.2's plain granted / denied values are still read). A decision is asked again after maxAgeDays (default 365) or when version changes. Code that read localStorage.getItem("analytics-consent") must use getConsent(), getConsentRecord() or parseConsentRecord(raw)?.decision.
cookieName + cookieDomain also keep the record in a cookie, so subdomains share one decision (localStorage never did). getConsent, setConsent, openConsentPreferences, closeConsentPreferences and subscribeConsent take the storage key or the same options object.
const granted = localStorage.getItem("analytics-consent") === "granted";const granted = getConsent({ version: "2026-11" }) === "granted";
<ConsentBanner cookieDomain=".gtktsc.com" cookieName="analytics-consent" version="2026-11" />ClipboardButton returns to its copy label after resetDelayMs (default 2000 ms; it stayed on "Copied" by default) and shows and announces "Copy failed" (failedLabel, new key clipboardButton.failed) when nothing could be written. It renders a visually hidden polite live region next to the button. CopyField now shows "Copied".
The legacy copy fallback (execCommand) runs inside the open dialog and returns focus, so copying works under modal focus traps; ShareButton uses it too. copyToClipboard never rejects.
useClipboard().supported is false on the server and during hydration and the real value after mount, so server and client markup agree; the hook also returns status (idle / copied / failed) and error, and resets after 2000 ms by default.
Props that end up in style as --pixxl-* custom properties (ColorSwatch color, ColorPicker swatches, Grid / ResponsiveGrid / SimpleGrid / Masonry / ImageList sizes, AspectRatio ratio, MediaStage aspectRatio, Skeleton, Sticky, ViewportFrame, Panel, CodeCard / CodeExample maxHeight) ignore values containing ;, braces, !, double quotes, < / >, comments or url( / image-set(, because React does not sanitise inline styles in server HTML. Pass single CSS values (red, oklch(…), var(--x), 16 / 9, a length).
VideoEmbed renders the iframe only for https: URLs on allowedHosts (default DEFAULT_VIDEO_EMBED_HOSTS: www.youtube-nocookie.com, player.vimeo.com); other URLs show only the fallback link. youtube.com / youtu.be URLs (watch, embed, short) are rewritten to youtube-nocookie.com. Never add your own origin: a same-origin frame with allow-scripts allow-same-origin can lift its sandbox.
The default allow list is autoplay; encrypted-media; fullscreen; picture-in-picture (motion sensors, clipboard-write and web-share are gone); pass allow to change it.
<VideoEmbed
allowedHosts={[...DEFAULT_VIDEO_EMBED_HOSTS, "fast.wistia.net"]}
fallbackHref={url}
fallbackLabel="Watch video"
src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
title="Product walkthrough"
/>InspectorPanel is a static, server-safe panel again (title, footer, padding). The small-screen bottom sheet or drawer, its trigger, snap points and the collapse toggle moved to the client component ResponsiveInspectorPanel (same props; responsive defaults to true, false keeps it inline). A static panel no longer ships BottomSheet, Drawer and the dialog code (7 KB gzip in the server entry). ResponsiveInspectorPanel is not exported from /server.
<InspectorPanel collapsible responsive snapPoints={[0.45, 0.9]} title="Particles">{controls}</InspectorPanel><ResponsiveInspectorPanel collapsible snapPoints={[0.45, 0.9]} title="Particles">{controls}</ResponsiveInspectorPanel>Importing the library no longer registers a beforeinstallprompt listener (it suppressed the browser’s own install UI on every site that loaded the hooks module). useInstallPrompt() / InstallPrompt start capturing when they mount; call the new captureInstallPrompt() early in your client entry if the event can fire before that.
// app/install-capture.tsx ("use client"), rendered once in the root layout
captureInstallPrompt();New AccentSwitcher (a radio group of accent presets, persisted through SitePreferencesProvider) with the message namespace accentSwitcher (group label and one name per preset; en + pl built in). A complete custom catalog typed as PixxlMessages must add it.
ThemeSwitcher marks its variant with data-switcher (toggle | segmented | select) instead of data-variant; data-variant now belongs to the underlying control (the toggle is ghost again). Update selectors such as .pixxl-theme-switcher[data-variant=…].
CodeExample: the header sits on the code surface (one dark block) and shows a copy button when code is a string; pass copyable={false} to hide it. The language label has the class pixxl-code-example-language.
ActionLink fullWidth aligns its content to the start (navigation and list rows); wrap it yourself for a centred full-width link.
Polish copy edits: "Ładowanie…" (was "Wczytywanie…"), "pliki cookie" (was "cookies"), footer credit "Projekt i wykonanie: {author}.". CommandPalette filters ignore case and diacritics (zolw finds "Żółw").
styles.css is unchanged (everything). Pages that load less import @pixxl-tools/components/css/core.css (tokens, reset, base, the core components, the small shared controls Slider, InputStepper, Meter, ProgressBar and Stat, and utilities) and add only the groups they render: css/forms.css (Combobox, date and time pickers, FileUpload, ColorPicker, …), css/data.css (DataTable, TreeView, Timeline, Carousel, media controls, …), css/site.css (SiteHeader, FooterBar, Hero, content pages, Markdown, PWA prompts, …), css/docs.css (DocumentationLayout, CodeCard, InstallCommand, API docs, …), css/games.css (game UI), css/inspector.css (ResponsiveInspectorPanel, InspectorPanel, BottomSheet, Drawer) and css/apps.css (DashboardShell, tool UI, menus, app navigation, notifications, VirtualList, Keypad, …). The README lists which group each component is in.
Import them in the order core, forms, data, site, docs, games, inspector, apps. css/components.css still holds every component group.
// A content site
import "@pixxl-tools/components/css/core.css";
import "@pixxl-tools/components/css/site.css";
// A docs site adds
import "@pixxl-tools/components/css/docs.css";The editor shows only images embedded in the drawing (data:image/* PNG, JPEG, GIF, WebP, AVIF, BMP, script-free SVG, same-origin blob:); remote http(s) images are never fetched, and File → Open drops them with a status. Check sources with the new isEmbeddedImageSource.
Insert image accepts files up to 10 MB (MAX_IMAGE_BYTES) whose type, extension and first bytes agree; drawings up to 50 MB (MAX_DRAWING_BYTES, DrawingFileTooLargeError). Exporting several pages downloads one .zip.
New editor catalog keys (topbar.fileTooLarge, topbar.removedImages, tools.imageTooLarge, tools.imageUnsupported, tools.imageUnsafe, tools.imageError, inspector.copied, inspector.copyFailed, export.doneZip; en + pl built in): full-catalog overrides must add them.
Every Pixxl site shares one header, one gutter and one theme control. These steps change defaults that existing headers, footers and containers relied on.
SiteHeader takes themeSwitcher (true, or ThemeSwitcher props such as { value, onValueChange }) and renders the house control last in its controls, in the bar and in the mobile menu. Move a ThemeSwitcher out of controls into this prop.
ThemeSwitcher defaults to variant="segmented" (icons with names and tooltips; fullWidth shows the words, which now fit translated labels at 375 px). iconOnly defaults to true unless fullWidth.
The toggle variant cycles System → the opposite of the OS scheme → the OS scheme → System, so it can always get back to System (getNextThemePreference). Its third label is "Use system theme" (themeSwitcher.switchToSystem). ThemeToggle (two states) is for app toolbars, not site headers.
<SiteHeader controls={<><LocaleSwitcher items={locales} value={locale} /><ThemeSwitcher variant="toggle" /></>} /><SiteHeader controls={<LocaleSwitcher items={locales} value={locale} />} themeSwitcher />A Container with inline padding (any padding except none) now pads its sides with the page gutter (--pixxl-layout-page-gutter, 16–32 px, never less than the safe-area inset) and adds it outside maxWidth, so lg text is 1200 px wide. SiteHeader, FooterBar, PublicPage and Container content now start at the same left edge at every width.
FooterBar has no inline padding of its own any more (its inner Container brings the gutter). Pass gutter={false} to keep the old padding on all four sides inside maxWidth.
<Container maxWidth="lg" padding="md">…</Container> // 16 px sides, 1168 px content<Container maxWidth="lg">…</Container> // page gutter, 1200 px content
<Container gutter={false} maxWidth="lg" padding="md">…</Container> // the 0.2 boxA locale link is named by its visible label followed by ariaLabel: { label: "PL", ariaLabel: "Polski" } is "PL – Polski" (WCAG 2.5.3 Label in Name). An ariaLabel that already starts with the label is kept; in development a warning names an ariaLabel that contains the label elsewhere. Put only the language name in ariaLabel.
prefetch defaults to false and is passed only to linkComponent / renderLink (keep spreading the render props into your router link). Prefetching a locale route can run a proxy that sets the locale cookie. Link and ActionLink accept prefetch too.
{ href: "/pl", id: "pl", label: "PL", ariaLabel: "Polski (PL)" } // named "Polski (PL)"{ href: "/pl", id: "pl", label: "PL", ariaLabel: "Polski" } // named "PL – Polski"New keys (en and pl built in): themeSwitcher.switchToSystem, footerBar.source, resultsAnnouncer.results / resultsAnnouncer.empty, combobox.stale, toolStylesPanel.palette. Full custom catalogs must add them; partial catalogs fall back to English. resultsAnnouncer is not a shell namespace yet, so the 17 other shell locales use English until they gain it (pass formatResultsCount to override).
Changed default: markdown.anchor is "Link to this section" (was "Link to section: {heading}"; {heading} is still passed).
Candraw editor: topbar.unsupportedFile takes {name}; new openNotes.repeated and the paperNotes.* namespace (one message per paper.js conversion note).
Prose (and so MarkdownProse) stops paragraphs, lists, quotes and headings at var(--pixxl-prose-measure, var(--pixxl-size-prose)) (68ch). Code blocks, tables and media stay full width. PageHeader descriptions are capped too.
For full-width text pass measure={false} or set --pixxl-prose-measure: none.
<Prose measure={false}>{wideText}</Prose>Markdown headings use MARKDOWN_HEADING_SIZES: h1 lg, h2 md, h3 sm, h4–h6 xs (they used Heading's defaults). Change them with createMarkdownComponents({ headingSizes }) or <MarkdownHeading size>.
The heading text is a link to its own id (a.pixxl-heading-link with a decorative #), so its name is the heading. A heading that already contains a link gets a separate # link named "Link to this section". Update CSS or tests that targeted .pixxl-heading-anchor inside every heading.
<h2 id="setup">Setup<a class="pixxl-heading-anchor" href="#setup">#<span>Link to section: Setup</span></a></h2><h2 id="setup"><a class="pixxl-heading-link" href="#setup">Setup<span aria-hidden="true">#</span></a></h2>ContentDetailPage renders its intro and body as sibling cards (PageBody > Stack > Card) instead of a Card nested in a card PageSection. Update selectors that relied on the wrapper.
A PageSection with title and id gives its heading an id (titleId, else the id plus -title) and is labelled by it, so it is a named region landmark. Pass aria-label or aria-labelledby to name it yourself.
Below 640 px, Card padding="lg" pads 24 px (was 32 px) and cards or card sections inside another surface pad 16 px.
modal defaults to false: on phones the sheet stays open when the page behind it is pressed, and the pressed control gets focus. Pass modal for the dimmed sheet that traps focus and closes on an outside press.
snapPoints default to [0.65, 0.92] (was the content height and 0.45), the chosen height is kept across close and reopen (snapPoint, defaultSnapPoint, onSnapPointChange), footer scrolls with the content, and viewports up to 480 px tall (landscape phones) also get the sheet.
<ResponsiveInspectorPanel
modal={false}
overlayProps={{ onInteractOutside: (event) => event.preventDefault() }}
snapPoints={[0.5, 0.92]}
title="Settings"
>
{controls}
</ResponsiveInspectorPanel><ResponsiveInspectorPanel title="Settings">{controls}</ResponsiveInspectorPanel>With keyboard="global", Enter after typed digits presses the pad’s Enter key; it no longer presses whichever key has focus (typing 180 and Enter recorded 26). Radios, checkboxes, switches and sliders outside the pad no longer keep Enter. Remove workarounds that intercepted Enter.
ToolStylesPanel colour palettes are one SwatchGrid listbox per palette (one Tab stop, arrow keys), named "{label} colors". Tests query option with aria-selected instead of button with aria-pressed.
ToolRail and CanvasToolRail names contain the visible label and a text badge ("Clear 3", was "Clear"); an element badge is named from its content. A development warning names an ariaLabel that does not contain the label. CanvasShellPresetPanel buttons include their description in the name.
AppMain and AuthShell take as, DashboardShell takes mainAs, so a page nested in another app’s <main> can render a div.
screen.getByRole("button", { name: "Fill color: Blue" });screen.getByRole("option", { name: "Fill color: Blue" }); // in the "Fill color palette" listboxThe option count is announced 300 ms after typing stops (it was announced on every keystroke) and repeated for a new query with the same count. While an error shows earlier options, the status adds "Showing earlier results". Tests that read the live region right after typing wait for it.
importPaperProjectJson returns notes ({ code, values, count, message }) next to warnings; PAPER_IMPORT_NOTE_MESSAGES, PaperImportNote and PaperImportNoteCode are exported from @pixxl-tools/candraw/legacy. Warning text uses typographic quotes and "Equals"; update code that matched the old strings.
File → Open names the rejected file and lists what it accepts (danger status). Full editor catalogs update topbar.unsupportedFile, which now takes {name}.
Changes from the last review before 0.3.0. The CSS entry points step above already lists the final groups (css/inspector.css, and Slider, InputStepper, Meter, ProgressBar and Stat in css/core.css).
ContentDetailPage takes date (a Date or an ISO string) and renders it under the title as a muted line with a calendar icon and <time dateTime>. dateLabel is the visible text; without it the date is formatted for the provider locale (long style, UTC). dateLabel alone no longer renders a badge next to the tags: it renders the same line without <time>.
Update selectors and tests that looked for the date in a Badge; the line has the class pixxl-content-detail-page-date.
<ContentDetailPage dateLabel="14 March 2026" title="Post" /><ContentDetailPage date="2026-03-14" dateLabel="14 March 2026" title="Post" />GameOverlay no longer renders role="status", so its text is not read twice next to an Announcer that reports the same state change. Pass announce to make the overlay itself the live region, or keep announcing through Announcer / useAnnouncement.
<GameOverlay role={undefined} title="Game over" />
<Announcer message={status} /><GameOverlay title="Game over" />
<Announcer message={status} />
// or let the overlay announce itself
<GameOverlay announce title="Game over" />CanvasPreviewGrid cards are named by their title and description (aria-labelledby), so the name matches what the button shows (WCAG 2.5.3). CanvasToolRail and ToolRail buttons have no aria-label unless you pass ariaLabel: the visible label (and badge) is the name.
Tests that matched the exact card title or selected button[aria-label=…] use a role query with a name prefix instead.
screen.getByRole("button", { name: "Bar chart" });
container.querySelector('button[aria-label="Style"]');screen.getByRole("button", { name: /^Bar chart\b/ });
screen.getByRole("button", { name: "Style" });When the element that opened a Dialog, Drawer, BottomSheet or Popover was removed by the update that opened it, focus goes to <main> when the overlay closes (it used to go to the next or previous control on the page). When it is removed while the overlay is open or by the update that closes it, focus goes to the next or previous control only if that control is in the trigger’s closest remaining container, so deleting a list row still focuses the next row; otherwise to <main>. Pass finalFocus to choose the target yourself.
VideoEmbed facade (click to load) adds the videoEmbed namespace (note, play; en and pl built in). Full custom catalogs typed as PixxlMessages must add it; partial catalogs fall back to English.
Every namespace of @pixxl-tools/components/locales/en and locales/pl is also a named export (import { notFoundPage } from "@pixxl-tools/components/locales/pl"); the en and pl catalogs are unchanged.
The full list of additions is in the changelog. If something broke that is not listed here, email contact@gtktsc.com with the component, the 0.2 code and what changed.