@astryx-svelte/core

Svelte 5 components for Astryx, Meta's open source design system.
View Components

Your bundler must run the StyleX compiler

This is the one setup fact that has no upstream counterpart, and getting it wrong fails without an error: the components render, and they render unstyled.
Astryx's own package ships pre-built CSS, so a consumer imports a stylesheet and is done. This one cannot. Components are styled with StyleX, and svelte-package — which builds this package — transpiles TypeScript but does not run StyleX. So dist/**/*.stylex.js is published uncompiled, and every consumer compiles it as part of their own build. That is the same property that makes the port verifiable: the compiler derives its class names from the source, so authoring against Astryx's token references emits byte-identical atomic CSS.
For Vite (and therefore SvelteKit), that is three things — the plugin, and two settings that exist because Vite has two ways to route a dependency around the plugin pipeline:
ts
// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import stylex from '@stylexjs/unplugin/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
stylex({
dev: process.env.NODE_ENV !== 'production',
runtimeInjection: false,
treeshakeCompensation: true,
useCSSLayers: true,
// Without explicit targets, lightningcss lowers `light-dark()` to a pair of
// `var(--lightningcss-*)` references that resolve to nothing, and every
// colour token silently goes empty.
lightningcssOptions: {
targets: { chrome: 123 << 16, firefox: 120 << 16, safari: (17 << 16) | (5 << 8) }
},
unstable_moduleResolution: { type: 'commonJS', rootDir: import.meta.dirname }
}),
sveltekit()
],
// Vite's dev-time pre-bundler runs esbuild outside the plugin pipeline, so anything
// it optimises never reaches the StyleX transform and `stylex.create` survives into
// the browser as a runtime no-op.
optimizeDeps: { exclude: ['@astryx-svelte/core'] },
// Same reasoning for the server build: an externalised dependency is imported from
// node_modules at runtime rather than transformed.
ssr: { noExternal: ['@astryx-svelte/core'] }
});
Both optimizeDeps.exclude and ssr.noExternal fail silently when missing. If a page renders with the right markup and none of the styling, check those two first.

Component Docs

Look up any component's full API — props, variants, examples, best practices, and theming — through the CLI:
bash
pnpm exec astryx-svelte component --list # every component, grouped
pnpm exec astryx-svelte component Button # full docs for one component
pnpm exec astryx-svelte util --list # the runes-based composables
pnpm exec astryx-svelte search button # components, utils, docs and templates at once
Everything is exported from the package root. There are no per-component subpath entrypoints — Astryx publishes one per component and this port publishes none, so @astryx-svelte/core is where Button lives and the barrel is tree-shaken by your bundler. The subpaths that do exist are for non-component surfaces:
SubpathWhat it is
@astryx-svelte/coreEvery component, every util, every props type
@astryx-svelte/core/themeTheme, useTheme, the token vars
@astryx-svelte/core/theme/definedefineTheme and its types, for authoring a theme
@astryx-svelte/core/theme/syntaxSyntax-highlighting themes for CodeBlock
@astryx-svelte/core/hooksThe composables, without the components
@astryx-svelte/core/utilsFramework-free helpers
@astryx-svelte/core/namingThe class-name helpers themes and integrations build against
@astryx-svelte/core/i18nThe message catalog runtime
@astryx-svelte/core/locales/*The shipped catalogs (en, fr-FR, pseudo)
@astryx-svelte/core/base.cssThe one stylesheet — see below

Page Layouts

Building a full page? Astryx's advice is to start from a template rather than composing from scratch, and the CLI has the command:
bash
pnpm exec astryx-svelte template --list # browse page and block templates
pnpm exec astryx-svelte template <id> --skeleton
Core contributes none of them yet. Astryx's 1,329 template assets are React source and are deferred, so template --list finds nothing from this package today. The command is not a stub — templates contributed by an integration package, or by any other installed package, are discovered and injected normally — but do not plan on scaffolding a dashboard out of core.
PackageDescription
@astryx-svelte/cliComponent docs, reference topics, themes, scaffolding, codemods
@astryx-svelte/theme-neutralThe default Astryx look — muted and minimal
@astryx-svelte/theme-butterWarm creamy yellows with a friendly blue accent
@astryx-svelte/theme-chocolateRich cozy browns with Fraunces headings
@astryx-svelte/theme-gothicDeep blue-grays and a display serif; dark-only
@astryx-svelte/theme-matchaEarthy greens, calm and organic
@astryx-svelte/theme-stoneWarm stone and slate, understated
@astryx-svelte/theme-y2kHot pinks, lime greens, and Poppins
@astryx-svelte/theme-liquid-glassmacOS translucent materials; no upstream counterpart