Skip to content

Customizing components

Adjust one component without forking it: pass utility classes, or retune the tokens a component reads.

The class input

Most components and directives take a class input and merge it with their own classes through cn(), which is exported from @atlas/components. cn() runs clsx and then tailwind-merge, so when two utilities conflict the last one wins: your classes override the defaults instead of fighting them.

template
<!-- rounded-full replaces the default button radius; w-full is added -->
<button atlasButton class="w-full rounded-full">Continue</button>
cn()
import { cn } from '@atlas/components/core';

cn('p-2 text-sm', isActive && 'bg-accent', 'p-4'); // → 'text-sm bg-accent p-4'

Surfaces

Card, data grid and the bordered accordion share one container recipe, the Tailwind utilities in the constant ATLAS_SURFACE_CLASS: a border, the --card colors, and a radius and shadow read from --surface-radius and --surface-shadow. Elevation is a theme decision, not a component input; override the two tokens on any element to retune every surface inside it.

src/styles.css
/* Flat, square surfaces inside the settings area only */
.settings-area {
    --surface-radius: 0;
    --surface-shadow: none;
}

Data grid hooks

atlas-data-grid reads a few extra variables, so one grid can differ from the theme: --atlas-grid-radius, --atlas-grid-shadow, --atlas-grid-header-bg, --atlas-grid-header-fg, --atlas-grid-footer-bg and --atlas-grid-row-height. For example, flatten a grid nested inside a card:

template
<atlas-data-grid class="[--atlas-grid-shadow:none]" [columns]="columns" [dataSource]="rows" />

Reduced motion

The Atlas stylesheet shortens animations and transitions to almost zero under prefers-reduced-motion: reduce. Overlay enter animations (animate-in, fade-in-0, zoom-in-95) come from tw-animate-css; without that import the command palette, dropdown menu, popover and tooltip open without animation.