Getting started
Matinee needs Hono for the components and Tailwind v4 for the styles. Five steps and you have a page.
1. Install
Matinee is not on npm yet. Until it is, install it from GitHub. Hono comes with your app.
pnpm add github:ayonkhan/matinee
2. Load the theme
Add the theme to your main CSS file. The last line matters most. It tells Tailwind to look inside Matinee for class names. Without it the components load with no styles.
@import "tailwindcss"; @import "matinee/theme.css"; @source "../node_modules/matinee/src";
3. Load the fonts
The fonts are not bundled. Add these to the head of your page, or host the files yourself.
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700&family=Inter:wght@400;500;600&display=swap" />
4. Choose a theme
Light is the default. For dark, set data-theme on the html element. Matinee does not pick for you, so read the choice from a cookie or a setting on the server.
<html lang="en" data-theme="dark">
5. Build a page
Set your JSX to Hono in tsconfig.json, then use the components in a route.
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
}
}import { Hono } from 'hono'
import { Button, Card } from 'matinee'
const app = new Hono()
app.get('/', (c) =>
c.html(
<html lang="en">
<head>
<link rel="stylesheet" href="/styles.css" />
</head>
<body class="bg-page font-sans text-ink">
<Card title="Hello">
<Button href="/films">Browse films</Button>
</Card>
</body>
</html>,
),
)
export default appColours
Use the tokens as Tailwind classes
<div class="border border-line bg-card text-ink"> <p class="text-muted">Secondary text</p> </div>
Typography
One class per piece of text
<h1 class="type-display">Your films, rated</h1> <p class="type-hint">Up to 200 characters.</p>
ActionBar
It takes the place of the bottom navigation on pages with a form.
Basic use
<ActionBar formId="settings" cancelHref="/settings" />
Own label
<ActionBar label="Save changes" />
Avatar
Without a picture it shows the first letters of the name.
Basic use
<Avatar name="quiet-otter-1204" src="/a.jpg" size="lg" />
Next to the name
<Avatar name="quiet-otter-1204" decorative /> <span>quiet-otter-1204</span>
Badge
Basic use
<Badge tone="accent">Movie</Badge>
As a filter
<Badge href="/films?type=movie" selected>Movies</Badge>
Card
Default
The standard surface for a block of content.
Floating
A shadow lifts it above the page. Use it for menus and popovers.
Large padding
More room for forms and settings sections.
No padding, so an image or banner can reach the edges.
Basic use
<Card title="Account" padding="lg"> <p>Settings go here.</p> </Card>
As a section, floating
<Card as="section" floating> <p>A menu or popover.</p> </Card>
Disclosure
What is a design system?
Does it need JavaScript?
Components9
Basic use
<Disclosure title="Does it need JavaScript?"> No. It opens and closes with plain HTML. </Disclosure>
Open, with a count
<Disclosure title="Components" meta={9} open class="rounded-tile border border-line bg-card"> ... </Disclosure>
EmptyState
No results
Nothing here yet
Basic use
<EmptyState title="Your watchlist is empty" action={{ label: 'Add a film', href: '/films/new' }}> Films you want to see will show up here. </EmptyState>
Notice
Saved
Could not save
Basic use
<Notice tone="accent" title="Saved">Your changes are live.</Notice>
An error
<Notice tone="danger" title="Could not save">Check the highlighted fields and try again.</Notice>
Poster
Basic use
<Poster title="Night Train" src="https://example.com/night-train.jpg" size="lg" />
No poster, filling a grid cell
<Poster title="Night Train" size="fill" />
Stars
A 7 out of 10 rating, shown as 3.5 of 5 stars.
Basic use
<Stars value={3.5} showValue />
Own label
<Stars value={3.5} label="Rated 7 out of 10" />
Stat
- Films seen
- 128
- Average rating
- 3.8
- out of 5
- Top genre
- Drama
A tile with a link lights up on hover and takes you to where the number comes from.
Basic use
<Stat label="Films seen" value={128} />
As a link
<Stat label="Watchlist" value={24} hint="Films to see" href="/watchlist" />
Checkbox
One email a month.
Tick this to continue.
Each row is at least 44px tall, so it is easy to tap.
Basic use
<Checkbox id="remember" name="remember" label="Remember me on this device" />
A group
<CheckboxGroup id="genres" legend="Favourite genres" name="genre" options={[ { value: 'drama', label: 'Drama', checked: true }, { value: 'comedy', label: 'Comedy' }, ]} />
CodeInput
We sent a 6 digit code to your email.
That code is wrong.
Basic use
<CodeInput id="code" label="Verification code" name="code" hint="We sent a 6 digit code to your email." />
Own length
<CodeInput id="pin" label="PIN" length={4} />
Field
Shown on your public profile.
Used to sign in. Never shown on your profile.
Enter a full address, starting with https://
Shown on your profile. Up to 200 characters.
Basic use
<Field id="email" label="Email address" type="email" required hint="Used to sign in." />
With an error
<Field id="site" label="Website" type="url" error="Enter a full address, starting with https://" />
Fieldset
Basic use
<Fieldset id="name" legend="Your name" hint="Shown on your public profile."> <Field id="first" label="First name" /> <Field id="last" label="Last name" /> </Fieldset>
FileInput
PNG or JPG, up to 2 MB.
You can choose more than one.
That file is too big.
Basic use
<FileInput id="picture" label="Profile picture" name="picture" accept="image/*" hint="PNG or JPG, up to 2 MB." />
Several files
<FileInput id="documents" label="Documents" multiple required />
RadioGroup
Basic use
<RadioGroup id="layout" legend="Layout" name="layout" value="comfortable" options={[ { value: 'comfortable', label: 'Comfortable' }, { value: 'compact', label: 'Compact', hint: 'Fits more on screen.' }, ]} />
Select
Used for dates and times.
Choose a country to continue.
Basic use
<Select id="zone" label="Time zone" name="zone" value="america/regina" options={[ { value: 'america/regina', label: 'Regina' }, { value: 'america/toronto', label: 'Toronto' }, ]} />
With a placeholder
<Select id="language" label="Language" placeholder="Choose a language" required options={languages} />
Slider
Drag to change.
Too bright for a dark room.
Basic use
<Slider id="volume" label="Volume" name="volume" value={40} minLabel="Quiet" maxLabel="Loud" />
In steps
<Slider id="steps" label="In steps of ten" step={10} />
Toggle
Basic use
<Toggle id="posters" name="posters" label="Show posters" hint="Shown above each film." checked />
SegmentedControl
Each option is a link, so it works without JavaScript.
Basic use
<SegmentedControl label="View" options={[ { label: 'List', href: '?view=list', selected: true }, { label: 'Grid', href: '?view=grid' }, ]} />
TopBar
The account menu opens from the avatar. It is open below.
Basic use
<TopBar brand={{ name: 'Matinee', href: '/' }} links={[{ label: 'Home', href: '/', current: true }]} action={{ label: 'New', href: '/new' }} user={{ name: 'swift-raven-5065', menu: [{ label: 'Settings', href: '/settings' }] }} />