shadcn.io is not affiliated with official shadcn/ui
Anonymous Posting Comments Block for Ark UI
A staff feedback thread where a Post as choice picks your name or a stable alias, alias posts wait for review, and a Moderator view switch shows the author on record with an Approve button.
Installation
Overview
Collect honest feedback without hiding who is accountable, with this anonymous comment thread for React with Ark UI. A compact header names the thread and holds a "Moderator view" Switch. The frame holds the feedback in a labelled scroll region that keeps its height; each comment shows an alias such as "Calm Otter" with initials, and the alias is the same every time for the same person in this thread. Under the thread a "Post as" pair of cells chooses your name or your alias (Quiet Heron), above the Textarea and the Shine Button. A comment posted under your name lands at once; one posted under the alias lands as "Waiting for review" and only you can see it. In Moderator view every comment shows the author on record ("Only moderators see this"), including one more that is waiting, and each waiting comment has an Approve button. A rules line says abuse is removed even when anonymous. It is built from Switch, Textarea, Field, Avatar, Badge, Button, Kbd and Guides, with a CSS entrance only. For staff surveys, community feedback and anywhere people speak more freely without a name.
FAQ
How do I set the aliases?
Edit PEOPLE, where each person has an id, a name and an alias, and START for the comments. The alias is stable for the thread because it is chosen once from a typed list and stored with the person, not drawn at random each time. A real app picks an alias per person and thread on the server, from a longer list, and keeps the pairing out of the page.
Is this really anonymous?
Not in the page. The moderator view reads the author from the same array, so a browser inspector would too. Treat the block as the interface only. A real anonymous thread keeps the author on the server, sends readers only the alias and the words, shows the author to moderators through a separate, logged call, and tells people plainly who can see them. If you promise full anonymity, do not store the author at all.
Why do alias posts wait for review?
Anonymous posts are the ones most likely to need moderation, so they wait for a person to approve them. The author sees their own waiting comment, marked "Waiting for review", and everyone else sees it only after Approve. Posts under a name land at once. Change the rule by setting approved in post.
What stays local?
Posting, approval and the moderator view live in the page, and the status line says "Posted under your alias in this demo. It waits for review. Nothing was sent." Wire post and approve to your API and return the saved comment.
Is it accessible?
The Post as choice is a native radio group in a labelled fieldset, so the arrow keys move between the two cells and the choice is visible without colour. Waiting comments say so in words, the moderator note is text with an icon, the thread is a scroll region you can reach with Tab, and the status line is present from load and is read out politely.