A news app topic picker onboarding screen built with Tailwind CSS: readers follow topics as chips with follower counts, search the list and continue once three interests are picked. It is an HTML mobile template for mobile news sites and PWAs and can be packaged as an app with Capacitor. Use it as the "choose your interests" step of a news, magazine or podcast app.
How it works
The root .ntp-app is a phone-width column with a sticky top app bar (back, step progress, Skip), the picker in [data-ntp-picker] and a sticky footer in [data-ntp-foot]. Topics are grouped in .ntp-group sections. Every .ntp-chip is a real <button> with aria-pressed; style.css swaps the plus icon for a check and fills the chip when it is pressed.
script.js counts the pressed chips on every click and updates [data-ntp-count] and the hint ("Pick 1 more to continue"). The Continue button uses aria-disabled instead of disabled, so it stays focusable; while too few topics are chosen a click only re-announces the hint. Typing in [data-ntp-search] filters chips by their .ntp-chip-label, hides empty groups and shows [data-ntp-empty] with a Clear search button when nothing matches. Escape clears the field.
When enough topics are chosen, Continue shows the [data-ntp-done] state. The script builds one .ntp-alert row per topic with an alert .ntp-switch (role="switch"). Edit topics and the back button return to the picker with the selection kept.
Customization
data-ntp-minon.ntp-app: the number of topics required before Continue unlocks (default 3).--ntp-accentinstyle.css: red used for chip icons, chip focus outlines and the alert switches; match it to thebg-red-600classes on.ntp-continue.--ntp-chip-oninstyle.css: background of a followed chip (near black by default).- Add a topic by copying an
.ntp-chipbutton; setaria-pressed="true"to preselect it. - Add a new
.ntp-groupsection with its ownh2; search and empty-group hiding pick it up automatically. font-familyon.ntp-app: replace Source Sans 3 and update the Google Fonts URL.
Use cases
- News and magazine apps: personalise the home feed on first launch.
- Podcast and newsletter apps: choose categories before recommendations load.
- Community and forum PWAs: follow channels or tags during sign-up.
- Learning apps: pick subjects of interest before the first lesson.
Accessibility
Chips are toggle buttons with aria-pressed, at least 44 px tall, and the follower count has a visually hidden "followers" suffix so it is read in context. The search field has a label, and the number of matching topics is announced through a polite live region. The selection hint is also a live region. Focus moves to the success heading on Continue and back to the Continue button on Edit topics. All controls show a visible focus outline, and colour transitions are removed under prefers-reduced-motion.
Usage notes
Send the selected labels to your API in the Continue click handler in script.js before showing the done state.