The Ocean Cleanup Project Achieves Its Most Ambitious Goal Yet
Three major ocean garbage patches have reduced in size simultaneously for the first time in recorded history.
optimists — Component Library
Live previews, prop tables, and usage guides for every component in the @optimists/ui package. Figma design file: LmuR42ZKVVmfysQRtJXQAb
@optimists/ui is an open-source React component library built for publishers who want to surface good-news stories with clarity and style.
Install
Quick start
import { CardHero, StatHero, PullQuote } from '@optimists/ui';
export default function NewsPage() {
return (
<CardHero
headline="Scientists discover ocean cleans itself faster than thought"
deck="New research shows micro-organisms breaking down plastic at record rates."
sectionTag="Environment"
readTime="3 min read"
/>
);
}13 components — live previews, props, and usage guides.
Half-page 360px story card with an optional image area, author metadata, and a category accent strip. Use for secondary feature stories in a 2–3 column grid.
Preview — Science
Teal accent with default white background.
📸 Photo
SCIENCE
·
Mon 25 May
4 min read
New Research Confirms Why Your Coffee Actually Makes You More Productive
MIT researchers have pinpointed the exact neural pathway caffeine activates to boost sustained concentration.
M
Marcus Chen
Code
<CardFeature
headline="New Research Confirms Why Your Coffee Actually Makes You More Productive"
description="MIT researchers have pinpointed the neural pathway caffeine activates."
author="Marcus Chen"
date="Mon 25 May"
readTime="4 min read"
category="SCIENCE"
accentColor="#A2CFD0"
categoryTextColor="#192A56"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| headline | string | yes | — | Story headline |
| description | string | yes | — | Short standfirst / teaser |
| author | string | yes | — | Author display name |
Usage
import { CardFeature } from '@optimists/ui';Designed at approximately 360px height. The author avatar uses the first character of `author`.
Top-5 ranked infographic list with flag/icon emoji, item labels, and value pills. Use for "best of" rankings, league tables, or fact-check comparisons.
Preview — Happiness Index
Green header with alternating teal row stripes.
TOP 5 HAPPIEST COUNTRIES
World Happiness Report 2024 ranking
1
🇫🇮
Finland
7.74
2
🇩🇰
Denmark
7.58
3
🇮🇸
Iceland
7.53
4
🇸🇪
Sweden
7.34
5
🇮🇱
Israel
7.34
Source: UN World Happiness Report, 2024
Code
<RankList
title="TOP 5 HAPPIEST COUNTRIES"
subtitle="World Happiness Report 2024 ranking"
entries={[
{ flag: '🇫🇮', item: 'Finland', value: '7.74' },
{ flag: '🇩🇰', item: 'Denmark', value: '7.58' },
{ flag: '🇮🇸', item: 'Iceland', value: '7.53' },
{ flag: '🇸🇪', item: 'Sweden', value: '7.34' },
{ flag: '🇮🇱', item: 'Israel', value: '7.34' },
]}
source="Source: UN World Happiness Report, 2024"
headerBgColor="#153B2E"
titleColor="#C1ECC6"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| title | string | yes | — | Header label, e.g. "TOP 5 COFFEE PRODUCERS" |
| subtitle | string | yes | — | Subheading beneath the title |
| entries | RankListEntry[] | yes | — | Ranked rows — each has flag, item, and value |
Usage
import { RankList } from '@optimists/ui';Vertical 4-entry timeline infographic with year badges, event titles, and detail sentences. Use for historical context panels or process flows.
Preview — Internet History
Default styling — grey header, alternating white rows.
THE INTERNET — A TIMELINE
1969
ARPANET goes online
The first message is sent between UCLA and Stanford University
1991
World Wide Web is born
Tim Berners-Lee creates HTML and launches the first website
2004
Social media era begins
Facebook launches, permanently changing how billions of people connect
2023
AI reshapes the web
Large language models transform search, content and creative work forever
Source: Computer History Museum, 2024
Code
<Timeline
title="THE INTERNET — A TIMELINE"
entries={[
{ year: '1969', event: 'ARPANET goes online', detail: 'First message sent between UCLA and Stanford' },
{ year: '1991', event: 'World Wide Web is born', detail: 'Tim Berners-Lee creates HTML' },
{ year: '2004', event: 'Social media era begins', detail: 'Facebook launches' },
{ year: '2023', event: 'AI reshapes the web', detail: 'Large language models transform creative work' },
]}
source="Source: Computer History Museum, 2024"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| title | string | yes | — | Header label, e.g. "THE INTERNET — A TIMELINE" |
| entries | TimelineEntry[] | yes | — | Timeline rows — each has year, event, detail, and optional badge colour |
| entries[].year | string | yes | — | Year or era label shown in the circular badge |
Usage
import { Timeline } from '@optimists/ui';Full-width side-by-side A vs B comparison card with large stats, descriptions, and icon badges. Use for fact-check or "did you know?" infographic comparisons.
Preview — Medical
Default navy header with white columns.
ISCHEMIC STROKE
VS
HEMORRHAGIC STROKE
87%
of all strokes are ischemic
Occurs when arteries are blocked by blood clots or gradual build-up of plaque. Most common — and most treatable.
13%
of strokes, yet 30%+ of deaths
Occurs when a blood vessel breaks. Less common than ischemic but far more likely to be fatal.
Code
<CompareBlock
labelA="ISCHEMIC STROKE"
labelB="HEMORRHAGIC STROKE"
statA="87%"
statALabel="of all strokes are ischemic"
descA="Occurs when arteries are blocked by blood clots or gradual build-up of plaque."
statB="13%"
statBLabel="of strokes, yet 30%+ of deaths"
descB="Occurs when a blood vessel breaks."
emojiA="🧠"
emojiB="🩸"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| labelA | string | yes | — | Left column header label, e.g. "ISCHEMIC STROKE" |
| labelB | string | yes | — | Right column header label |
| statA | string | yes | — | Large stat value for the left column, e.g. "87%" |
Usage
import { CompareBlock } from '@optimists/ui';2×2 stat grid infographic with emoji badges, large values, and descriptive labels. Use for "key numbers" data panels with exactly 4 stats.
Preview — Default
Navy header with white cells and coloured emoji badges.
BIG DATA — KEY NUMBERS
90%
Fortune 500 have big data initiatives underway
1.5M
data-savvy jobs needed in the next 5 years
$97K
average annual salary for data analysts in the US
3/4
executives are increasing their use of analytics
Code
<DataGrid
title="BIG DATA — KEY NUMBERS"
cells={[
{ value: '90%', label: 'Fortune 500 have big data initiatives underway', emoji: '🏢' },
{ value: '1.5M', label: 'data-savvy jobs needed in the next 5 years', emoji: '💼' },
{ value: '$97K', label: 'average annual salary for data analysts in the US', emoji: '💰' },
{ value: '3/4', label: 'executives are increasing their use of analytics', emoji: '📊' },
]}
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| title | string | yes | — | Header label, e.g. "BIG DATA — KEY NUMBERS" |
| cells | [DataGridCell, DataGridCell, DataGridCell, DataGridCell] | yes | — | Exactly 4 cells laid out in row-major 2×2 order |
| cells[].value | string | yes | — | Large stat value, e.g. "90%" |
Usage
import { DataGrid } from '@optimists/ui';The `cells` prop is typed as a 4-tuple `[DataGridCell, DataGridCell, DataGridCell, DataGridCell]` — TypeScript will error if you pass fewer or more.
Full-width hero stat block with a giant display value, unit, context sentence, decorative rings, and an emoji badge. Use as a section opener for data-led stories.
Preview — Sky Blue
Bright sky blue background for a data-positive feel.
DATA & SOCIETY · SPECIAL REPORT
1.5 MILLION
data-savvy managers and analysts
will be needed in the next 5 years to drive decisions globally
Code
<StatHero
sectionTag="DATA & SOCIETY · SPECIAL REPORT"
value="1.5 MILLION"
unit="data-savvy managers and analysts"
context="will be needed in the next 5 years to drive decisions globally"
emoji="📈"
bgColor="#8CD0ED"
sectionTagColor="#192A56"
valueColor="#192A56"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| sectionTag | string | yes | — | Overline category label, e.g. "DATA & SOCIETY · SPECIAL REPORT" |
| value | string | yes | — | Giant hero number/stat, e.g. "1.5 MILLION" |
| unit | string | yes | — | Unit label below the value |
Usage
import { StatHero } from '@optimists/ui';Full-width featured story card with author byline, deck, and optional hero image. Use as the primary headline story on a page or section.
Preview — Climate
Peach background with green climate category chip.
Three major ocean garbage patches have reduced in size simultaneously for the first time in recorded history.
Code
<CardHero
headline="The Ocean Cleanup Project Achieves Its Most Ambitious Goal Yet"
deck="Three major ocean garbage patches have reduced in size simultaneously."
author="Sarah Okafor"
role="Environment Correspondent"
date="Wed 27 May 2026"
readTime="6 min read"
category="CLIMATE"
categoryColor="#C1ECC6"
categoryTextColor="#0F3B22"
cardBgColor="#F4C1AE"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| headline | string | yes | — | Primary story headline |
| deck | string | yes | — | Short standfirst / teaser sentence |
| author | string | yes | — | Author display name |
Usage
import { CardHero } from '@optimists/ui';The author avatar uses the first character of `author` as its initial. If `imageSrc` is supplied, it displays in a right-side image panel on md+ screens.
Editorial pull quote with a large decorative quotation mark, accent pill, and attribution line. Use between paragraphs to break up long articles.
Preview — Peach
Warm peach background — suits lifestyle and opinion pieces.
The sexy job in the next 10 years will be statisticians. The ability to take data, to understand it, to process it, to extract value from it, to visualise it and communicate it is going to be enormously important.
— Hal Varian, Chief Economist at Google
Code
<PullQuote
quote="The sexy job in the next 10 years will be statisticians. The ability to take data, understand it, and communicate it is going to be enormously important."
attribution="— Hal Varian, Chief Economist at Google"
bgColor="#F4C1AE"
quoteColor="#192A56"
accentColor="#FCE29A"
attributionColor="#192A56"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| quote | string | yes | — | Pull quote text — aim for 100–200 characters for best layout |
| attribution | string | yes | — | Attribution line — include an em dash, e.g. "— Hal Varian, Chief Economist at Google" |
| bgColor | string | no | — | Component background override |
Usage
import { PullQuote } from '@optimists/ui';Compact accent card led by a large display statistic. Use in grids of 2–3 to surface key numbers alongside a supporting description.
Preview — Community (Sky Blue)
Sky blue background with navy category chip.
3,456
volunteers
COMMUNITY
Joined the coastal clean-up this weekend — a record turnout across 14 counties.
Code
<CardNumberLead
number="3,456"
unit="volunteers"
description="Joined the coastal clean-up this weekend — a record turnout across 14 counties."
category="COMMUNITY"
bgColor="#8CD0ED"
stripColor="#8CD0ED"
categoryBgColor="#192A56"
categoryTextColor="#FFFFFF"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| number | string | yes | — | Large display stat, e.g. "3,456" or "94%" |
| unit | string | yes | — | Label beneath the number, e.g. "volunteers" |
| description | string | yes | — | Supporting body sentence |
Usage
import { CardNumberLead } from '@optimists/ui';Designed at 220px height. Works best in a `grid-cols-2` or `grid-cols-3` container.
Compact ranked story list card with numbered badges. Use for "top stories" or "most read" sidebars with 3–5 entries.
Preview — Default
Standard list with per-row category chips in different accent colours.
1
Global Coffee Prices Hit Five-Year Low as Supply Chains Recover
BUSINESS
4h ago
2
WHO Issues New Treatment Protocol for Faster Stroke Recovery
HEALTH
5h ago
3
Open-Source AI Model Outperforms Commercial Systems on Key Benchmarks
TECH
6h ago
Code
<CardListItem
items={[
{ headline: 'Global Coffee Prices Hit Five-Year Low', time: '4h ago', category: 'BUSINESS', categoryColor: '#FCE29A', categoryTextColor: '#192A56' },
{ headline: 'WHO Issues New Treatment Protocol', time: '5h ago', category: 'HEALTH', categoryColor: '#F4C1AE', categoryTextColor: '#192A56' },
{ headline: 'Open-Source AI Outperforms Commercial Systems', time: '6h ago', category: 'TECH', categoryColor: '#A2CFD0', categoryTextColor: '#192A56' },
]}
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| items | CardListItemRow[] | yes | — | Array of story rows — each has headline, time, and optional category |
| items[].headline | string | yes | — | Story headline |
| items[].time | string | yes | — | Relative time label, e.g. "4h ago" |
Usage
import { CardListItem } from '@optimists/ui';The component renders as many rows as supplied in `items` — no upper limit enforced, but 3–5 rows work best visually.
Compact 220px brief card with no image, carrying headline, teaser, time, and an optional read-more link. Use in tight multi-column news grids.
Preview — World (Periwinkle)
Light blue background with periwinkle category accent.
WORLD
1h ago
UN Climate Summit Reaches Historic Fossil Fuel Phase-Out Agreement
140 countries sign a landmark accord to phase out coal by 2040 — the most ambitious commitment yet.
→ Read more
Code
<CardBrief
headline="UN Climate Summit Reaches Historic Fossil Fuel Phase-Out Agreement"
description="140 countries sign a landmark accord to phase out coal by 2040."
time="1h ago"
category="WORLD"
accentColor="#B9C7FF"
categoryTextColor="#192A56"
bgColor="#EDF1FF"
/>Props reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| headline | string | yes | — | Story headline |
| description | string | yes | — | Short teaser sentence |
| time | string | yes | — | Relative or absolute time label, e.g. "1h ago" |
Usage
import { CardBrief } from '@optimists/ui';Designed at 220px height — pair with CardNumberLead in the same row for visual variety.