Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Disclosed Sponsored Posts Blog Block for React

Four sponsored posts, each labelled Sponsored with the sponsor's typographic monogram, a Why am I seeing this popover on editorial independence, and a closing band that sets sponsored apart from editorial with a strip of twelve issues.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A sponsored-posts section for React with Base UI, written for Gitmoor Weekly, a developer newsletter. A start-aligned header carries a "Why am I seeing this?" outline button that opens a popover on editorial independence. Four rows follow, newest first: a typographic monogram for the sponsor (two letters in display type with one rule placed differently for each), a "Sponsored" badge and the sponsor's name, the title as the row's one link, a one-line dek, the issue's date and the reading time. A closing band sets sponsored apart from editorial in two columns and draws the last twelve issues as ticks, hollow for an issue that carried a sponsored post. The counts and the share are worked out from the typed issues. The sponsors are invented. It's built from Guides, Badge, Button and Popover. For newsletters, magazines and blogs that run sponsored content and say so.

FAQ

How do I use my own sponsors and issues?

Edit ISSUES at the top of the file: each issue has a fixed sent date, the number of editorial posts and a sponsored post (or null) with its sponsor, two-letter monogram, mark (where the rule sits), title, dek and minutes. The rows are the issues that have a sponsored post, newest first; the counts, the percentage and the tick strip are calculated from the list.

What does the popover say, and can I use it without a mouse?

It explains how sponsorship works (one labelled post in one issue, no drafts shared, no reviews for sale), how many of the last twelve issues carried one, and links to a sponsorship policy. It opens from a real button, closes with Escape and returns focus to the button.

How is the sponsored label kept honest?

Every row carries the visible word "Sponsored" in a badge next to the sponsor's name, not only a colour or an icon, and the closing band repeats the rule in plain words. The monograms are drawings, hidden from assistive technology, and the sponsor's name is text.

What changes on a phone?

The dek drops out, the date and reading time move under the title, and the monogram sits beside the label and title. The band's two columns stack and the tick strip keeps its twelve ticks.

Does it work right to left?

Yes. The rows and columns mirror, dates and counts are isolated with bdi, and the tick strip stays in issue order from oldest to newest because it is a timeline.

  • Pro

    A newsletter's back issues as rows with large mono issue numbers, subject lines, dates and an open-rate bar, with a Select that sorts them by newest, best opened or oldest.

  • Pro

    A guest post on an outdoors blog: a header with the one Pitch a guest post button, an article under a Guest post badge, and an About the author frame with a bio and three icon links that carry tooltips.

  • Pro

    Three editor's picks as split rows: the post with a numeral tile at the start and, in a tinted margin cell at the end, the editor's note with a hanging quote mark and a marked reason.

  • Pro

    A studio blog's posts that first ran elsewhere: an Only syndicated Switch with a live count, rows with an outlet monogram and Read here and Read original links, and a canonical-link note.

  • Pro

    Tabbed Inbox Notification Blog

    Subscribe and alerts

    A post-alert inbox: All and Unread tabs with counts, rows with an unread dot that clears when opened, a Mark all read button and an unread count in the header, all derived from the rows.

  • Pro

    Period Toggle Stats Blog

    Stats and drafts

    A blog's own numbers: a 7, 30 or 90 day toggle swaps a strip of four figures and five ranked top posts with bars; the rows stay in place and take whichever post holds each rank.