Skip to main content
@ekanos/ui is the set of Ekanos-styled components available to integrations: the same components the SDK’s widgets are built from, so your UI matches the rest of Ekanos.

Installation

Peer dependencies

You provide these at runtime:
react-hook-form and @hookform/resolvers are only needed for form usage, and next-intl for Trans. Everything else the components need at runtime (Base UI, class-variance-authority, clsx, tailwind-merge, cmdk, nanoid) is a declared dependency.

Quick start

Option 1: Use the compiled stylesheet (no Tailwind)

styles.css is self-contained: Tailwind Preflight, design tokens, light and dark mode, and every utility class the components emit. No build step; it works in Next.js, Vite, CRA, a plain <link>, anything. It does not contain utilities for classes you write yourself (p-8, grid-cols-3), and its Preflight is a global reset.

Option 2: Integrate with your Tailwind build

This registers the token map, theme values, base rules, the dark: variant, and an @source pointing at the package’s bundles so your Tailwind build generates the components’ utilities. You then get Ekanos tokens in your own classes too. Pick one path: loading both means two copies of every utility. See Styling for the full paths and trade-offs.

What’s exported

One subpath per component (24 in total), plus four stylesheets: See Components for the full list and import paths.

No drag and drop, on purpose

@ekanos/ui has no drag-and-drop primitive: no sortable list, no draggable card, no drop target. A widget is a summary of something, and a board that people rearrange belongs on a page, or in the provider’s own app. A widget that needs to reorder or move items should link to such a page instead.

Design tokens

Every component emits Tailwind class strings bound to Ekanos’s semantic design tokens (bg-primary, text-muted-foreground, border-border, shadow-ring, …), so something has to define those — that is what the stylesheets are for. tokens.css and theme.css carry Ekanos’s full semantic token set — surfaces, brand, status, chart, sidebar, the elevation scale, radius, and fonts — for both themes, so utilities like bg-chart-1 or shadow-ring resolve in your own markup on the Tailwind path. The compiled styles.css is pruned to what the package’s own components use. See Styling for how to control dark mode and page backgrounds.

Light and dark mode

Dark mode resolves in this order:
  1. .dark or [data-theme='dark'] ancestor — dark
  2. .light or [data-theme='light'] on :root — light
  3. @media (prefers-color-scheme: dark) — dark
  4. Default — light
So a page with no theme toggle respects the OS setting, and one with a toggle (next-themes, or custom) works by setting a class. To adopt Ekanos’s page surface (which makes dark mode look right rather than dark cards on white):

Icon handling

Icon draws Phosphor icons (MIT). The fonts ship inside this package and styles.css declares them, so there is nothing to load. Name icons as phosphoricons.com does (house, caret-down); a name that matches no icon draws shapes. See Fonts & Icons for the full setup.

Runtime notes

  • Base UI, not Radix — popups use @base-ui/react; no asChild prop, use render instead
  • Trans needs next-intl — renders against the host’s messages; must run under a NextIntlClientProvider
  • Spinner is self-contained — draws an SVG, no icon font needed
  • Client components are marked — 'use client' is preserved in each client entry’s bundle
  • Server-safe entries — alert, badge, button, card, input, textarea, skeleton, if, spinner, and utils carry no directive
See Runtime Notes for details.

Next steps