@eliancodes/brutal-ui is a small Astro-first design system for loud, tactile interfaces: thick borders, hard shadows, bright surfaces, and simple composition.
- deterministic semantic variants instead of random colors
- shared design tokens for color, spacing, shadow, radius, and motion
- consistent component APIs with native HTML attribute passthrough
- better accessibility states for focus, active, disabled, and reduced motion
- exported configuration and types for easier theming
npm install @eliancodes/brutal-uiPeer dependency:
astro@^6
---
import { ActualButton, Button, Card, Pill } from '@eliancodes/brutal-ui';
---
<Card variant="accent" interactive>
<h2>Brutal UI</h2>
<p>Opinionated components for loud interfaces.</p>
<div style="display:flex; gap: 0.75rem; flex-wrap: wrap;">
<Button href="/docs" variant="primary">Read docs</Button>
<ActualButton variant="danger" size="sm">Delete</ActualButton>
<Pill variant="info">Astro</Pill>
</div>
</Card>Anchor-styled button for navigation.
Props:
- native anchor attributes like
href,target,rel,class, andaria-* variant?: 'primary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 'neutral'size?: 'sm' | 'md' | 'lg'color?: stringto override the resolved variant colorfullWidth?: boolean
Real <button> element for actions and forms.
Props:
- native button attributes like
type,disabled,name,value,class, andaria-* variant?: 'primary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 'neutral'size?: 'sm' | 'md' | 'lg'color?: stringfullWidth?: boolean
Surface container for grouped content.
Props:
- native div attributes like
class,id,style,data-*, andaria-* variant?: 'primary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 'neutral'color?: stringpadded?: booleaninteractive?: boolean
Compact label or status marker.
Props:
- native span attributes like
class,id, andaria-* variant?: 'primary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 'neutral'size?: 'sm' | 'md' | 'lg'color?: string
The package exports a configuration object and named tokens:
import { Config, brutalTokens, variantColors } from '@eliancodes/brutal-ui';Available semantic variants:
primaryaccentinfosuccesswarningdangerneutral
You can also override the font family globally:
:root {
--brutal-font-family: "Sanchez", Georgia, serif;
}And you can bypass variants entirely with a custom color:
<Card color="#d9f99d">Custom green card</Card>- Buttons include visible keyboard focus styles.
- Motion is reduced automatically when
prefers-reduced-motionis enabled. - Disabled buttons are styled distinctly.
Buttonsupportsaria-disabled="true"for non-interactive link states.
import {
Button,
ActualButton,
Card,
Pill,
Config,
brutalTokens,
variantColors,
} from '@eliancodes/brutal-ui';npm run check
npm run pack:check