Skip to main content

Your First Component

Get from zero to a rendered Primus UI component in under 2 minutes.

1. Install​

npm install primus-react-ui @primus/ui-core

2. Import styles​

// main.tsx
import '@primus/ui-core/dist/primus-ui.min.css';
import 'primus-react-ui/styles.css';

3. Render your first component​

// App.tsx
import { PrimusStatCard, Badge } from 'primus-react-ui';

export default function App() {
return (
<div style={{ padding: '2rem', display: 'grid',
gridTemplateColumns: 'repeat(3, 1fr)', gap: '1rem' }}>

<PrimusStatCard
title="Monthly Revenue"
value="$98.2k"
change={{ value: 12, type: 'increase' }}
description="vs last month"
/>

<PrimusStatCard
title="Active Tenants"
value="142"
change={{ value: 8, type: 'increase' }}
description="this month"
/>

<PrimusStatCard
title="Churn Rate"
value="1.8%"
change={{ value: 0.2, type: 'decrease' }}
/>

</div>
);
}

What you just used​

ElementWhat it does
PrimusStatCard / primus-stats-cardKPI card with value, delta, and trend arrow
card stat@primus/ui-core HTML card with metric layout
card-delta up / downAuto-coloured change indicator (green / red)
badge successColoured status badge — no JavaScript
row / col-412-column responsive grid
hstackHorizontal flex row with automatic gap
<button>Primary button — no class needed

Next steps​

You have Primus UI rendering. Here is where to go next: