A news reader app home screen in pure CSS and vanilla JavaScript, with section tabs, a top story card, a list of articles with thumbnails and read time, bookmark toggles and a bottom tab bar. Black Source Serif 4 headlines and a red accent give it a classic newspaper app UI. It is an HTML mobile template for mobile websites and PWAs and can be packaged as a native app with Capacitor.
How it works
The root .nrh-app is a 430 px app column. The sticky .nrh-top header holds the masthead (today's date is written into [data-nrh-date] by the script, so it never goes stale), search and notification buttons, and a horizontally scrolling role="tablist" of sections.
The feed #nrh-feed is the tab panel. It starts with the .nrh-lead top story (large photo, kicker, serif headline, summary, author and read time) followed by .nrh-list, where each .nrh-row has the text on the left and an 88 px thumbnail on the right. Every story carries a data-section value. Choosing a tab runs render(), which hides stories from other sections, renames the list heading and updates the story count; an empty state appears when nothing matches.
Each .nrh-save button toggles aria-pressed and swaps between the outline and filled bookmark icon, shows a short toast and updates the badge on the Saved tab. The bottom .nrh-tabbar uses aria-current="page": Home shows the full feed and Saved shows only bookmarked stories; Discover and Profile are placeholders for your other screens.
The photos come from Unsplash; replace them with your own article images.
Customization
--nrh-accentinstyle.css: kickers, active tab underline, bookmarks, badges and focus rings.--nrh-serifand--nrh-sans: the headline and interface fonts.- Add a section: add a
.nrh-tabbutton with a newdata-nrh-sectionvalue and give matching stories the samedata-section. TOAST_MSinscript.js: how long the "Saved to your reading list" message stays.- Change the
aspect-ratio(16 / 9) of.nrh-lead__media imgfor a taller or wider top story photo. - Remove
.nrh-livefrom the lead kicker when the story is not an analysis or live piece.
Use cases
- News and magazine apps: the main feed with sections and a featured story.
- Company or industry newsletters: a reading app for internal news on a PWA.
- Local news websites: a mobile home page that feels like an app.
- Blog and podcast networks: show the latest posts with read time and saving.
Accessibility
Section tabs follow the tabs pattern: aria-selected, roving tabindex, and arrow, Home and End keys. Bookmark buttons use aria-pressed and are described by their headline. The toast is a role="status" region, the tab bar is a labelled nav with aria-current, and every target is at least 44 px with a visible red focus ring. Headline text on white has strong contrast.