Pill
Small labels for short facts: a language, a section, a status.
import { Pill } from '@iffday/ui';Example
Pill is a 12px label, grey by default. tone="accent" is red text on a pale red ground, for things the reader should notice, such as a screening with a guest Q&A or an unread notification. tone="warning" is Signal yellow and only warns, for example of a cancelled screening. Put a row of pills in .pill-row, which handles wrapping and spacing.
English한국어Guest Q&ACancelled
import { useT } from '@iffday/i18n';
import { Pill } from '@iffday/ui';
/** The pills on a screening page: subtitles, guest Q&A and the status. */
export default function Example() {
const t = useT();
return (
<div className="pill-row">
<Pill>English</Pill>
<Pill>한국어</Pill>
<Pill tone="accent">{t('screening.guestQA')}</Pill>
<Pill tone="warning">{t('screening.cancelled')}</Pill>
</div>
);
}Usage
- Pills hold a word or two: a language, a section, a status. A sentence does not belong in one.
- The stylesheet also has a
newtone, 10px and bold; no page uses it yet.
Props
| Prop | Type | Default |
|---|---|---|
children* | ReactNode | |
tone | string | '' |
- src/pages/cms.tsx8
- src/pages/editorial.tsx7
- src/pages/schedule.tsx6
- src/pages/festivals.tsx5
- src/pages/film-entry.tsx5
- src/pages/programme.tsx5
- src/film-media.tsx4
- src/pages/personal.tsx4
- src/pages/festival-directory.tsx3
- src/pages/screening.tsx3
- src/film-facts.tsx2
- src/pages/cms-festivals.tsx2
- src/pages/planner-settings.tsx2
- src/pages/profile.tsx2
- src/pages/wallet-extras.tsx2
- src/pages/account-settings.tsx1
- src/pages/archive-tools.tsx1
- src/pages/catalog-drafts.tsx1
- src/pages/cms-film-reviews.tsx1
- src/pages/cms-translations.tsx1
- src/pages/general-movie.tsx1
- src/pages/list-page.tsx1
- src/pages/plan-page.tsx1
- src/pages/social.tsx1
- src/pages/sticker-board.tsx1