Matinee

Sections

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.

bash
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.

css
@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.

html
<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,[email protected],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
<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.

json
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "hono/jsx"
  }
}
tsx
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 app

Colours

page
card
raised
sunken
line
line-strong
ink
ink-soft
muted
accent
accent-text
danger

Use the tokens as Tailwind classes

tsx
<div class="border border-line bg-card text-ink">
  <p class="text-muted">Secondary text</p>
</div>

Typography

type-display
Your films, rated
type-heading
Recently added
type-body
Quiet and devastating. The last shot stays with you.
type-label
Rating
type-hint
Up to 200 characters.
type-overline
Live preview
type-code
<Button variant="primary">Save</Button>

One class per piece of text

tsx
<h1 class="type-display">Your films, rated</h1>
<p class="type-hint">Up to 200 characters.</p>

ActionBar

Cancel

It takes the place of the bottom navigation on pages with a form.

Basic use

tsx
<ActionBar formId="settings" cancelHref="/settings" />

Own label

tsx
<ActionBar label="Save changes" />

Button

As a link

Basic use

tsx
<Button type="submit">Save</Button>

As a link, full width

tsx
<Button href="/films/new" fullWidth>
  Add film
</Button>

Avatar

SRSRSR
quiet-otter-1204quiet-otter-1204maple-fox-3381

Without a picture it shows the first letters of the name.

quiet-otter-1204

Basic use

tsx
<Avatar name="quiet-otter-1204" src="/a.jpg" size="lg" />

Next to the name

tsx
<Avatar name="quiet-otter-1204" decorative />
<span>quiet-otter-1204</span>

Badge

Drama1999MovieTVRemoved

Badges that link can act as filters. The selected one is solid.

Basic use

tsx
<Badge tone="accent">Movie</Badge>

As a filter

tsx
<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

tsx
<Card title="Account" padding="lg">
  <p>Settings go here.</p>
</Card>

As a section, floating

tsx
<Card as="section" floating>
  <p>A menu or popover.</p>
</Card>

Disclosure

What is a design system?
A shared set of colours, type and parts, so every page looks and behaves the same.
Does it need JavaScript?
No. It opens and closes with plain HTML.
Components9
A note on the right can show a count.

Basic use

tsx
<Disclosure title="Does it need JavaScript?">
  No. It opens and closes with plain HTML.
</Disclosure>

Open, with a count

tsx
<Disclosure title="Components" meta={9} open class="rounded-tile border border-line bg-card">
  ...
</Disclosure>

EmptyState

Your watchlist is empty

Films you want to see will show up here.

No results

Try a different search.

Nothing here yet

Basic use

tsx
<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

Your film list is private until you share it.

Saved

Your changes are live.

Basic use

tsx
<Notice tone="accent" title="Saved">Your changes are live.</Notice>

An error

tsx
<Notice tone="danger" title="Could not save">Check the highlighted fields and try again.</Notice>

Poster

Poster of Small
Poster of Medium
Poster of Large
Poster of One
Poster of Two
Poster of Four

Basic use

tsx
<Poster title="Night Train" src="https://example.com/night-train.jpg" size="lg" />

No poster, filling a grid cell

tsx
<Poster title="Night Train" size="fill" />

Stars

02.53.55

A 7 out of 10 rating, shown as 3.5 of 5 stars.

Basic use

tsx
<Stars value={3.5} showValue />

Own label

tsx
<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

tsx
<Stat label="Films seen" value={128} />

As a link

tsx
<Stat label="Watchlist" value={24} hint="Films to see" href="/watchlist" />

Checkbox

One email a month.

Tick this to continue.

Favourite genres

Edge of your seat.

Pick any you like.

Each row is at least 44px tall, so it is easy to tap.

Basic use

tsx
<Checkbox id="remember" name="remember" label="Remember me on this device" />

A group

tsx
<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

tsx
<CodeInput id="code" label="Verification code" name="code" hint="We sent a 6 digit code to your email." />

Own length

tsx
<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

tsx
<Field id="email" label="Email address" type="email" required hint="Used to sign in." />

With an error

tsx
<Field id="site" label="Website" type="url" error="Enter a full address, starting with https://" />

Fieldset

Your name

Shown on your public profile.

Contact

Add at least one way to reach you.

Basic use

tsx
<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

tsx
<FileInput id="picture" label="Profile picture" name="picture" accept="image/*" hint="PNG or JPG, up to 2 MB." />

Several files

tsx
<FileInput id="documents" label="Documents" multiple required />

RadioGroup

Layout

You can change this later.

Who can see your list

Choose who can see your list.

Basic use

tsx
<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

tsx
<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

tsx
<Select id="language" label="Language" placeholder="Choose a language" required options={languages} />

Slider

QuietLoud

Drag to change.

0100

Too bright for a dark room.

Basic use

tsx
<Slider id="volume" label="Volume" name="volume" value={40} minLabel="Quiet" maxLabel="Loud" />

In steps

tsx
<Slider id="steps" label="In steps of ten" step={10} />

Toggle

Basic use

tsx
<Toggle id="posters" name="posters" label="Show posters" hint="Shown above each film." checked />

BottomNav

On a phone it floats at the bottom of the screen. From wider screens up it is hidden, and the top bar takes over. Leave room at the bottom of the page so content is not hidden behind it.

Basic use

tsx
<BottomNav
  items={[
    { label: 'Home', href: '/', current: true },
    { label: 'Browse', href: '/browse' },
    { label: 'New', href: '/new', primary: true },
  ]}
/>

SegmentedControl

Each option is a link, so it works without JavaScript.

Basic use

tsx
<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

tsx
<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' }] }}
/>