shadcn.io is not affiliated with official shadcn/ui
Announcement Board CRUD Block for Radix UI
A notice board with a composer card over the notices: Publish or Save draft, a two-pin limit that unpins the oldest, edit in place, and Retract with a same-height Undo card.
Installation
Overview
Give a team one place to post what everyone should know, with this notice board for React with Radix UI. A composer sits over the board: a Field with a title Input, a body Textarea with a character count, and an audience Select that drops under the body on a phone. Publish is the one Shine Button and Save draft is outline. Each notice is a card with its audience and date, a pin Toggle, Edit and Retract. The board keeps two pins: pinning a third unpins the oldest and the foot says so ("Unpinned Fire drill to keep two"). Edit turns the card into the same composer in place, Retract swaps it for a quiet card of the same height with an Undo, and a draft carries a dashed outline and the word Draft and is left out of the audience line. For intranets, office notice boards and any feed where a few posts must stay on top.
FAQ
How do I load my own notices?
Edit NOTICES: each has an id, a title, a body, an audience (one of the four in AUDIENCES), a posted ISO day, a draft flag, a pinned number (0 is not pinned, a higher number was pinned later) and a retracted flag. The board sorts pinned notices first, newest pin on top. Everything counted, such as the live count per audience, is derived from the list.
How does the two-pin limit work?
Pinning stamps the notice with the next pin number. When two are already pinned, the one with the lowest number is unpinned in the same step and the foot names it. Retracting a pinned notice keeps its place, and Undo restores its pin unless two others have taken them meanwhile, in which case it comes back unpinned and says so.
What does Retract do, and can I undo it?
Retract does not remove the notice at once. The card swaps to "Retracted" with an Undo, in the same box, so nothing below moves. Undo brings the card back with its text. A draft says Discard instead. Retractions live in this tab only.
What is required to publish or save a draft?
A title and a body, both. A failed press shows the reason under the field in a slot that is always there, focuses the first empty field and says so in the status line. The body stops at 160 characters, with a count.