shadcn.io is not affiliated with official shadcn/ui
No Announcements Empty State Block for React
A company news page with no announcements: a composer with an audience toggle group, a title, details and a pin switch, a Post button that counts who it reaches, and a feed with a drawn scroll.
Installation
Overview
Start a company's news feed with its first post, with this no announcements empty state for React with Base UI. A header and one framed panel for Tidingbell, a company news tool, in two cells. At the start the composer: a Toggle Group for who sees it (Everyone 48, Admins 6 or Engineering 14), a Field with a title, a Textarea for the details and a Switch that pins the announcement to the top. At the end the feed, with a drawn unrolled scroll and one dashed line where the news will go. The Shine Button, the only colored control, counts who it reaches ("Post to 14 people"). Pressing it adds a card to the top of the feed with the author, the date, the audience and "Pinned to the top" in words when it is, turns the dashed line solid and clears the form. The frame is ruled by Guides, and everything moves with CSS only. For an intranet, a team update page or any feed whose posts have an audience.
FAQ
What stays in the page, and how do I make it real?
The announcements stay in the page's state, listed in the feed: nobody is sent anything and a reload empties it, while Start over empties it without one. To wire it for real, send the audience, title, details and pin to your API where the code says so, add the card from the response, and show a failure in the status line of the foot.
How is the number in the button worked out?
It is the size of the audience you picked, typed in the file next to the group's names (48, 6 and 14), so the button, the group and the card all read from the same number. Change the audience and the button follows. In your app read the count from your directory instead.
What does Pin to the top do?
A pinned announcement stays above the rest of the feed and the card says "Pinned to the top"; the others follow, newest first. The demo's feed holds two cards, so it never changes the panel's height, and at two the button says the feed is full and Start over clears it.
What if I press Post with no title?
Nothing is posted: the field says "Add a title to post" and takes focus. The details are optional; a card without them says "No details added". Titles are limited to 60 characters and details to 280.
Is it usable with a keyboard and a screen reader?
The audience is a group named Who sees it, with the arrow keys between its three choices, and the button's name changes with it. The switch is named Pin to the top. The feed is a region that scrolls and takes focus, so its cards can be read with the arrow keys, and the foot's polite status line says what changed. The drawing is hidden from assistive technology.
Related
- Pro
No Comments Empty State
Activity and updatesA document reviewer's comments sheet shown open in place at the end of a drawn page: a sticky margin note drawing, a field with a 0 / 500 counter and a Comment button that stacks comments with a Delete button on each.
- Pro
No Posts Empty State
Social and feedbackA social feed's first post with a live preview: a field with a 0 / 280 counter, a card that mirrors the text as you type, a paper plane on a trail, and a feed of two places that the post lands in.
- Pro
No Threads Empty State
Inbox and chatA discussion board's first thread: three starter cards with drawn thread sketches, a title and details, one Start thread button and a list of the threads you start.
- Pro
No Messages Empty State
Inbox and chatA mail app's empty inbox: tabs with their counts, a drawn letter tray with a dashed envelope, and a Compose button, or the C key, that opens a dialog whose Send fills the Sent tab.
- Pro
No Notifications Empty State
Activity and updatesAn activity inbox's bell popover shown open in place: You're all caught up, a cup of tea whose three wisps of steam turn solid as Mentions, Replies and Updates are switched on, and a Save preferences button that says Saved in this demo.
- Pro
No Activity Log Empty State
Activity and updatesA personal activity feed with nothing recorded yet: four tick cards for the kinds of event beside a vertical timeline of dashed nodes that turn solid and write a first-person sample line as each kind is ticked.