Taster
£9 / month
One 250 g bag a month
Regular
£16 / month
Two bags, one of them a new lot
Roaster
£28 / month
Three bags and a tasting note
import { Button, SpotlightCard } from '@brand-studio/ui';
const plans = [
{ name: 'Taster', price: '£9', detail: 'One 250 g bag a month' },
{ name: 'Regular', price: '£16', detail: 'Two bags, one of them a new lot' },
{ name: 'Roaster', price: '£28', detail: 'Three bags and a tasting note' },
];
export default function SpotlightCardDemo() {
return (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))', gap: 16, width: '100%', maxWidth: 720 }}>
{plans.map(plan => (
<SpotlightCard key={plan.name} style={{ padding: 24 }}>
<h3 style={{ margin: '0 0 8px', fontSize: 16 }}>{plan.name}</h3>
<p style={{ margin: '0 0 4px', fontSize: 28, fontWeight: 600 }}>{plan.price}<span style={{ fontSize: 14, fontWeight: 400, color: 'var(--bs-muted)' }}> / month</span></p>
<p style={{ margin: '0 0 20px', color: 'var(--bs-muted)', fontSize: 14 }}>{plan.detail}</p>
<Button tone="secondary" style={{ width: '100%' }}>Choose {plan.name}</Button>
</SpotlightCard>
))}
</div>
);
}Installation
pnpm add @brand-studio/uinpm install @brand-studio/uiyarn add @brand-studio/uibun add @brand-studio/uiInstall the peer dependencies
npm install react react-domImport the stylesheet once
import '@brand-studio/ui/styles.css';Wrap your app in a brand theme
import { BrandTheme, SpotlightCard } from '@brand-studio/ui'; import brand from './brand.json'; <BrandTheme palette={brand.tokens} mode="system"> {/* your app */} </BrandTheme>
Usage
import { SpotlightCard } from '@brand-studio/ui';<SpotlightCard>
<h3>Regular</h3>
<p>Two bags a month</p>
</SpotlightCard>Accessibility
- The light is drawn with CSS and adds nothing for screen readers.
- Keyboard focus on anything inside lights the whole edge, so keyboard users see which card they are in.
- Only a mouse moves the light; touch and reduced motion see a plain card.
API Reference
| Prop | Type | Default |
|---|
Also accepts every HTMLAttributes<HTMLDivElement> attribute.