# @a4ui/core > A4ui — "Spatial Glass" design system & component library for SolidJS > (glassmorphism surfaces, starfield backdrop, light/dark themes). 90+ components > built on Kobalte (behavior/a11y), a Tailwind preset (visual), and > Motion (motion.dev, the `motion` package) for JS animation. Docs: https://a4ui.pages.dev/ · Repo: https://github.com/A4uikit/a4ui ## Install ```bash npm install @a4ui/core ``` Peer dependency: solid-js (>= 1.9). ## Setup ```ts // tailwind.config.ts — add the preset import a4ui from '@a4ui/core/preset' export default { presets: [a4ui], content: ['./src/**/*.{ts,tsx}', './node_modules/@a4ui/core/dist/**/*.js'], } ``` ```tsx // entry (once) import '@a4ui/core/styles.css' // anywhere — every component is a named export; props are fully typed with // JSDoc + @example in the shipped .d.ts. import { Button, Card, Modal } from '@a4ui/core' ``` ## Entry points Styling has two paths: **with Tailwind**, add the `@a4ui/core/preset` and import `styles.css` (tokens + motion); **without Tailwind**, import `@a4ui/core/full.css` (fully precompiled — tokens + every utility the components use). - `@a4ui/core` — all the components listed below (named exports). - `@a4ui/core/styles.css` — tokens + motion + starfield (needs the Tailwind preset for utilities). - `@a4ui/core/full.css` — self-contained precompiled CSS for use WITHOUT Tailwind. - `@a4ui/core/preset` — the Tailwind preset (semantic tokens + glass plugin). - `@a4ui/core/commerce` — commerce set: ProductCard, ProductGrid, PriceTag, QuantityStepper, CartLine, CartSummary, FilterGroup. - `@a4ui/core/charts` — charts: Sparkline, BarChart, DonutChart (native SVG). - `@a4ui/core/elements` + `@a4ui/core/elements.css` — framework-agnostic Web Components (``, ``, …) for React/Next.js, Vue, or plain HTML. The **Commerce** and **Charts** groups below import from `@a4ui/core/commerce` and `@a4ui/core/charts` respectively; everything else from `@a4ui/core`. ## The "Spatial Glass" look (recipe) To make a page actually look like A4ui (frosted glass over an ambient backdrop, a cursor light, restrained motion) — not flat cards on a flat background — follow this. Full guide: https://a4ui.pages.dev/#/guide-spatial-glass 1. **Backdrop first.** Render `` once at the top of the layout and keep the page root transparent (NO `bg-background` on the root — Aurora paints the base). It tints to your theme; `animated` = slow drift; `pointerGlow` (default on) = a glow that follows the cursor across the backdrop. Glass only reads if there is color behind it — this is what provides it. 2. **Surfaces are glass.** Use `` (not opaque `bg-card` divs) so the Aurora shows through the frosted blur. `glow` is on by default; add `spotlight` (inner cursor glow) + `tilt` to KEY cards only (hero/feature/product), not all. 3. **Theme via tokens.** Override the 15 CSS vars (`--primary`, `--accent`, radius) under `:root`; everything incl. Aurora recolors. Light glass ships slightly transparent so the frost reads. 4. **Motion, 4–6 tasteful touches** (reduced-motion aware): `ScrollProgress`, `Parallax` hero, `TextReveal` headings, `Magnetic` on the primary CTA, count-up `Stat`, `Carousel` swipe. Keep them off the critical path. 5. **Expand, don't modal:** use `Expandable` (shared-element FLIP) for galleries and "click to see the full thing". 6. **Structure** with `
` + full-bleed `bg-muted/30` bands. 7. **Ship-quality:** lazy images, ≥24px targets, labeled inputs, a robots.txt. Common mistakes: flat background (add Aurora), opaque cards (use `Card glass`), `spotlight`/`tilt` on every card (noisy), over-animating. ## Components ### Get started - **Themes** — Swap the whole color palette at runtime. Five built-in themes; apply one by name, restore the saved one on boot, or bring your own. Separate from the light/dark switch — a theme recolors under either mode. - **Icons** — A4ui already ships lucide-solid — 1500+ crisp, consistent icons, no extra install. Tree-shakeable too: import one icon and ONLY that icon ships (~0.3 kB), never the whole set. Size with h-/w-, color with text-*. - **Templates** — Complete, real company sites built with A4ui — each its own theme, live on Cloudflare Pages. Proof the system builds full pages, not just demos. Source: github.com/A4uikit/templates ### Actions - **Button** — Button with 4 variants. Defaults to type="button" so it never submits forms by accident. `ripple` bakes in a Material click ripple (engine-free). Pass `href` to render as an link (keeps the look + ripple). Try the controls ↓ - **Dropdown** — Actions menu (Kobalte). The trigger itself IS the button, so its children must be non-interactive. - **ContextMenu** — Context menu shown on right-click over the child element (the target). - **Toggle** — Two-state button (pressed / not) — ideal for toolbars. - **ToggleGroup** — Row of segmented buttons; the value can become null when deselected. - **SegmentedControl** — Single selection with an animated indicator that slides under the active option. - **FloatingActionButton** — Prominent circular primary action pinned to a corner of the viewport. `ripple` adds a Material press ripple. - **SpeedDial** — A FAB that fans out into multiple quick actions. The main button carries a Material press ripple. - **MoneyActionButton** — A prominent CTA reserved for value-moving actions — one accent, tightly scoped to money movement. - **MicroButton** — A button that fires a physically-tuned feedback effect — spin, shake, pulse, ring or sparkle on click, or a glare sweep on hover. Transform/opacity only, reduced-motion safe. Click the buttons ↓ - **IconMorphButton** — A two-state icon toggle whose glyph morphs — spring scale + rotate + fade — between states: copy→check, mute, theme. Click ↓ - **Morph presets** — Ready-made two-state buttons built on IconMorphButton — no need to wire the two icons yourself. Click them ↓ - **LikeButton** — Like / favorite / save toggle (heart · star · bookmark via one `icon` prop) with a spring pop and a staggered icon burst. Click ↓ - **SlideArrowButton** — A CTA where the label slides out and an arrow slides in from the opposite edge on hover — pure CSS transform. Hover ↓ ### Forms - **Switch** — Accessible on/off toggle (Kobalte). - **Input** — Controlled text field. Uses value/onInput (onInput receives the string, not the event). - **Textarea** — Controlled multi-line field, resizable vertically. - **Select** — Controlled native select (value/onChange receives the string). The
with a cross-fade between routes. - **SpaceBackground** — The "space glass" background: a fixed layer (z-0) with stars, nebula, planets, and shooting stars. Respects reduced-motion. - **ThemeToggle** — Button that toggles light/dark theme. The icon shows the CURRENT theme (🌙 dark, ☀️ light). - **EffectsToggle** — Turns visual effects on/off (glass + starfield + animations). Off = calm mode, opaque and motionless. - **Section** — Centered content container — max width (size) + vertical rhythm (py) + optional id anchor. The layout wrapper every page repeats. - **Aurora** — Ambient theme-tinted blurred-blob backdrop so glass surfaces read as glass. Fixed behind the page; keep the root transparent. The no-starfield alternative to SpaceBackground. - **PricingTable** — Tiered pricing cards with a highlighted "Popular" tier and an optional monthly/annual toggle. - **ActionBar** — Sticky action/emergency bar: a status slot + a prominent CTA (renders as for tel:/links). For urgent-service pages. - **NavGroup** — Collapsible sidebar category (native
). Open by default; the chevron rotates when collapsed. - **Kbd** — Inline keyboard-key indicator for shortcuts. - **Splitter** — Two resizable panes with a draggable divider (keyboard-resizable too). - **Collapse** — A single expand/collapse region with a rotating chevron and animated height. - **Affix** — Pins its content to the top of the viewport once you scroll past it. - **Marquee** — Seamless infinite scroller — pauses on hover, respects reduced motion. - **Portal** — Renders children into a detached DOM node (default ) — escapes overflow and stacking contexts. - **ArtifactPanel** — Inline right-side panel for AI-generated output next to a chat — reveals by animating width (not a portalled overlay). - **FloatingToolbar** — Fixed, centered glass toolbar that condenses as you scroll — a detached action bar (renders fixed-position over the page). - **MasterDetail** — List + detail-pane layout with keyboard navigation — like an inbox. Controlled or uncontrolled. - **Refractive glass** — A heavier glass surface with a specular sheen + bright top edge (the `.glass-refractive` utility). For hero/feature panels over a colourful backdrop like Aurora. - **BentoGrid** — A responsive bento layout — glass tiles that span columns/rows via BentoCard `colSpan`/`rowSpan`. ### Motion - **Stagger** — Cascade a group in with a per-item delay (stagger) and a spring. Motion (motion.dev) is the engine A4ui uses — the package re-exports animate / inView / scroll / stagger / spring, plus animateIn / revealOnScroll. - **Spring** — Physics-based spring — fling the ball and it settles with a natural bounce. - **Scroll reveal** — Reveal items the first time they scroll into view (Motion inView). Scroll the list ↓ - **Hover & press** — Springy scale on hover and a dip on press, driven by Motion animate. - **Count up** — Tween a number up with createCountUp (Motion under the hood). Replay to run it again. - **Scramble text** — Text that decodes from random glyphs — reusable as the component. Run on mount or on hover. - **Text reveal** — Reveal a line word-by-word (or char-by-char) with a staggered fade — the component. - **Hold to confirm** — Press and hold to confirm a weighty action — a fill sweeps and only fires at 100%. The component. - **Loaders** — Loading indicators: (staggered bounce) and (a band sweeping through text). - **Curtain transition** — Full-screen page/route wipe with seven variants (fade · doors · blinds · shutter · iris · clip · pixels) — one component. Pick a style and play it. - **Parallax** — Wrap anything in and it drifts at a fraction of scroll speed for depth. Scroll the panel ↓ - **Notification stack** — Stacked notifications that peek behind one another — click the stack (or "Show all") to expand the full list, "Show less" to collapse. The component. Add a few ↓ - **Multi-state badge** — A status pill that morphs color and swaps its icon as state changes (idle · loading · success · error) — the component. - **Add to cart** — The classic "fly to basket" — a ghost arcs from the product to the cart, which bumps. The flyToCart() helper. - **Now playing** — A compact media widget with a live equalizer that dances while playing — the component. - **Expandable (shared layout)** — A card that morphs into a dialog and back with a shared-element (FLIP) transition — the component. "dialog" mimics a family-photo modal, "full" the App-Store card expand. Click a card ↓ - **Typewriter** — Types a string out char-by-char (with a blinking caret), cycling through several — the component. - **Ripple** — Material-style click ripple you wrap around anything — the component. Buttons have it baked in: