The building blocks of a news front page. FeaturedPosts is the lead grid under the masthead (one large story, three smaller, optional slider arrows). PostBlock is a section module — heading with “View all”, then the stories in one of seven layouts — with pager arrows or numbered pagination (“Page 1 of 17”). Both lay out by their own width (container queries), so a module works in a wide main column, a narrow one or a sidebar. Server components; the arrows and pagination are small islands.
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { FeaturedPosts, PostBlock, NewsPagination } from "@vamos-ui/react/blocks";
<FeaturedPosts posts={lead} label="Top stories" slider />
<PostBlock title="City" href="/city" layout="lead-list" posts={city} />
<PostBlock title="Economy" layout="big-2" posts={economy} pages={[olderEconomy]} />
<PostBlock title="Latest" layout="list" posts={latest}
pagination={{ page, total: 17, hrefTemplate: "/latest?page={page}" }} />Each module is a section named by its heading; every story is an article. Use one h1 per page (the masthead or a visually hidden one).
Examples
Quad lead (section front)
A wide lead with three stacked beside it. Under 48rem both layouts become a 4:3 lead, a 16:9 story and two 4:5 cards.
Category layouts
lead-list (lead with excerpt + four thumbnail rows), big-2 with pager arrows, grid with excerpts. Also: lead-grid, featured-list, trio, list.
City
View allThe night tram returns: council votes to run the coast line until 2 a.m.
A twelve-month trial starts in March. Shift workers at the hospital and the port pushed for it for three years.
Economy
View allCulture
View allHousing
Rents near the waterfront rose 31 per cent in a year. Who still lives there?
We knocked on 140 doors on three streets to find out.
Music
The warehouse festival sells out in nine minutes
Organisers promise a second weekend and a ballot for residents.
Industry
A sensor plant in the free zone will hire 400 engineers
Production of marine sensors starts in the spring.
Schools
Six schools will open their yards to the neighbourhood at weekends
A pilot with caretakers on extra pay and a booking sheet for clubs.
Latest with numbered pagination
NewsPagination wraps the kit Pagination (real links, compact under 640px) and adds “Page 1 of 17”; page 1 drops ?page=1.
Latest
- Transport
The night tram returns: council votes to run the coast line until 2 a.m.
A twelve-month trial starts in March. Shift workers at the hospital and the port pushed for it for three years.
- The port
Port orders four electric cranes and a shore-power berth
The 61-million-euro package is the largest since the container terminal opened.
- Sea & coast
Seagrass meadows are back in the bay, divers count
Volunteer surveys find twice the cover of 2021 along the eastern shore.
- Football
Late header settles the coast derby in front of a record crowd
Liman Spor climb to second after a 2–1 win under the new floodlights.
Page 1 of 17
API
FeaturedPosts
| Prop | Type | Default |
|---|---|---|
postsFour per page; with slider, every further four make a page. | NewsPost[] | — |
layoutmosaic: lead on the start half, a wide story and two squares. quad: wide lead, three stacked. | "mosaic" | "quad" | "mosaic" |
sliderPrevious / next arrows and a polite “1 of 2” counter. Hidden pages stay in the DOM. | boolean | false |
labelAccessible name of the region and slider. | string | — |
headingLevelCard title level. | 2 | 3 | 2 |
priorityEager lead image. | boolean | true |
PostBlock
| Prop | Type | Default |
|---|---|---|
title / href / hrefLabelSection heading and its “View all” link. Omit title inside PostTabs. | ReactNode / string | — |
layoutSee the examples. | "lead-list" | "lead-grid" | "big-2" | "featured-list" | "trio" | "list" | "grid" | "lead-list" |
posts / pagespages adds pager arrows through further sets. | NewsPost[] / NewsPost[][] | — |
columnsgrid columns on wide containers. | 2 | 3 | 2 |
excerptsgrid / trio / list excerpts (list: default on). | boolean | — |
paginationNumbered pagination + “Page x of y”. | { page; total; hrefTemplate? } | — |
headingSizesm for sidebars. | "lg" | "sm" | "lg" |
headingLevelCard titles go one level deeper. | 2 | 3 | 2 |
footerAfter the stories (an ad, a load-more). | ReactNode | — |
PostLayout
| Prop | Type | Default |
|---|---|---|
layout, posts, columns?, excerpts?, level?, common?, empty?Just the arrangement, without a heading — for PostTabs panels. | PostLayoutProps | — |
NewsPagination
| Prop | Type | Default |
|---|---|---|
page, total, hrefTemplate?, onPageChange?Client island; hrefTemplate is a string so server components can pass it. newsPageHref(template, page) is exported. | NewsPaginationProps | — |