Interlace Foundation

@interlace/ui — opt-in page-level styling: Inter and JetBrains Mono on font-sans / font-mono, the preflight (body colours, WCAG 2.2 focus ring, media reset, scrollbars), and the fumadocs colour bridge. Restyles the host app by design.

foundationserverstylev3.1.0
Visual examples + interactive variants
View Interlace Foundation on Storybook
No embeddable story for this item yet.
→

Install

Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.

Via shadcn URL
npx shadcn@latest add https://ds.interlace.tools/r/interlace-foundation.json
With the @interlace alias
npx shadcn@latest add @interlace/interlace-foundation

History

This component is at v3.1.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.

Unreleased3 entries

  • Breakingmajor

    The stylesheets are now four layers, one directory each, and your classes always beat them. Page preflight used to sit in a custom interlace.preflight cascade layer, which ranks above Tailwind's utilities: img { height: auto } beat a call-site h-10, and svg { display: block } beat inline. Preflight now sits in Tailwind's base layer, prose and animation classes in components, and the three named Interlace layers hold custom properties only. A new lock (css-layer-lock.test.ts) keeps each layer reading only the one before it.

    Migration

    Only deep imports move; styles/index.css and styles/base.css are unchanged. - styles/interlace-theme.css → styles/brand/interlace.css (values) and styles/semantics.css (bindings) - styles/themes/harbor.css → styles/brand/harbor.css - styles/tokens.css → styles/structure/motion.css - styles/foundation.css → styles/structure/type.css, structure/layout.css, structure/radius.css - styles/fonts.css, styles/preflight.css → styles/page/fonts.css, styles/page/preflight.css - styles/theme.css → styles/page/fumadocs.css and styles/page/shiki.css The layers interlace.primitives, interlace.foundation and interlace.preflight no longer exist. If you overrode one of them, move the rule into your own CSS; it no longer needs a layer to win.
  • Breakingmajor

    Adding a component no longer restyles your app. Every component used to depend on theme, which swapped your font-sans and font-mono for Inter and JetBrains Mono, set img { display: block }, drew an outline on every focusable element and recoloured body. Components now depend on interlace-base, which only adds tokens. A test compiles a stock shadcn globals.css with and without it and checks the app's own utilities come out the same. The Interlace look is now opt-in: theme is a registry:theme that writes shadcn cssVars into your :root and .dark, and interlace-foundation carries the fonts, the page preflight and the fumadocs bridge. Interlace's animate-accordion-down/up no longer replace tw-animate-css's versions.

    Migration

    Your globals.css decides how much of Interlace you get. 1. Components only, with your own look: @import "./styles/interlace/base.css"; after @import "tailwindcss";. This is what the CLI installs with every component. 2. Add the Interlace palette and radius: npx shadcn add @interlace/theme. The CLI writes the variables into your :root and .dark. 3. Keep the full Interlace page (what theme gave you before): npx shadcn add @interlace/interlace-foundation and import ./styles/interlace/index.css instead of base.css. Load Inter and JetBrains Mono yourself, as before.
  • Addedminor

    Three additions for content sites. A --highlight / --highlight-foreground colour pair (amber, AAA text in both schemes and in Harbor) with a highlight Button variant, for the warm call-to-action that is not the brand primary. Badge gains success, warning, info and highlight tones. And a --font-heading token: Typography h1–h6 and the hero headings read it, it falls back to --font-body, and --font-body now follows the app's own --font-sans, so a shadcn app's typeface reaches Interlace components with no setup. Set --font-heading: var(--font-serif) to give headings a serif without touching body text.

Accessibility

Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.

What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.

Focus + keyboard behaviour
Native element semantics — no interaction layer to get wrong.
Focus ring (WCAG 2.2 SC 2.4.13)
Drawn by the component's own focus-visible classes, so it holds with or without the opt-in preflight.
Reduced motion
Animation is gated on prefers-reduced-motion.
ARIA in the source
  • role="grid"

Dependencies

Base UI primitive
Native / no Base UI dependency
Lucide icons
none
NPM dependencies
none
Registry dependencies

Source

The full implementation — styles/interlace/index.css once installed.

22 lines · TypeScript
/*
 * @interlace/ui — the full CSS contract, as Interlace's own apps use it.
 *
 *   @import "tailwindcss";
 *   @import "@interlace/ui/styles/index.css";
 *
 * base.css (brand, semantics, structure: additive, what every component
 * needs) plus layer 4, the opt-in page styling. In the registry this is the
 * `interlace-foundation` item. See base.css for the layer model.
 */

@layer interlace.bridge, interlace.brand, interlace.semantics;

@import "./base.css";

/* 4. Page. Each file styles the page on purpose; none is needed by a
 * component. */
@import "./page/fonts.css";
@import "./page/preflight.css";
@import "./page/fumadocs.css";

…2 more lines…

Registry JSON

The raw registry record — what the shadcn CLI fetches.