shadcn.io is not affiliated with official shadcn/ui
Blocked and Muted People Account Block for React
The people a person has blocked or muted, as two tabs of rows with initials, handle and date, an Unblock or Unmute that can be undone, and a handle field that adds someone from four typed accounts.
Installation
Overview
Let people see and undo who they have shut out, with this blocked and muted panel for React with Base UI. A hairline frame with a plus mark on each corner opens with a strip that says what each choice does: a blocked person cannot find you, message you or see your posts, and a muted one is only hidden from you. Under it a Tabs list shows Blocked and Muted with their counts, and each tab is a fixed-height scroller of rows: the person's initials in an Avatar, their name, their handle in mono and the day it began. Unblock and Unmute take the row out at once and the foot's Undo, always there, puts the last change back. Below the list a handle field with an at sign adds someone from four typed accounts; the Shine Button reads Block or Mute to follow the open tab, a person who is already on the other list moves over, and a handle nobody has is refused in words. A line in the foot says what happened. It's built from Tabs, Avatar, Badge, Input Group, Empty, Button, Shine Button and Guides, with a CSS entrance only. For a social app, a forum, a messenger or any product where people can shut other people out.
FAQ
How do I fill it with real people?
Edit START for the two lists and FINDABLE for the accounts the handle field can find. Each person has an id, a handle without the at sign, their initials, a name and an ISO since day. The day is written as "Blocked on 2 Mar" or "Muted on 18 Jun" from that value, and a person added in the demo gets the one AS_OF constant. Nothing reads the clock, so the same page renders on the server and in every time zone. Replace EVERYONE with a lookup against your own accounts.
What stays local, and how do I make it real?
Every change: unblocking, unmuting, adding and moving only change this page's state, the status line says "in this demo" and nobody is told. To make it real, call your block and mute endpoints in remove and in add, update the lists from what the server answers and show a failure in the same status line. Undo then needs a reverse call of its own, because the server has already acted; if you cannot reverse an action, remove the Undo button and keep the confirmation in words.
How does the handle field decide?
The typed text is trimmed, a leading at sign is dropped and the rest is compared without regard to case. An empty field says "Type a handle first." A handle that no account has says so and points at the four chips below; pressing a chip fills the field. A person who is already on the open tab's list says so, and one who is on the other list moves across, with a line that says "Moved … from Muted to Blocked". After a successful add the tab follows, the new row comes first and focus lands on its Unblock or Unmute button.
How does Undo work, and where does focus go?
Each change pushes the lists as they were onto a stack, and Undo pops it, so it walks back one change at a time and says "Undid blocking Linnea Fairweather". It also returns to the tab where the change was made. Undo is never hidden: with nothing to undo it stays in place, marked as unavailable, and answers "Nothing to undo." When a row leaves, focus moves to the next row's button, or to Undo when the list is empty, so keyboard users never land on the page's top.
Does the panel change height?
No. Each list is a scroller four rows tall, so removing the last person, adding a fifth or switching tabs leaves everything below in place; a list with more than four people scrolls inside itself, and the scroller takes focus so the arrow keys work. An empty list fills the same box with a short message. On a phone the three lines of a row (name, handle, date) get a little more height than on a wide screen, and the foot with the status line and Undo stays pinned to the bottom of the screen.
Is it accessible?
The tabs are a real tab list with their counts in the name, each list is a named region holding a real list, and every button names its person ("Unblock Hollis Verhaeghe"). The result of each action is spoken once through a polite status line that exists from the start. Handles and dates keep their reading order in a right-to-left page.
Related
- Pro
Privacy Settings
Privacy and consentA privacy panel with three presets that set five switches, a sentence that adds them up, and a row per setting that says in words what it means for you and what it shares.
- Pro
A person's record of who their data went to: a row per recipient with the kinds of data it received, the day it last did and why, and a switch that stops the sharing where consent is the reason.
- Pro
A person's consent choices as an accordion of purposes with switches beside a consent receipt, an ordered log that gains a line for each choice and saves as a real PDF or JSON file.
- Pro
The interests a news reader guessed from a person's reading, as removable chips in groups with the activity that led to each, a switch for personalising, a field to add their own and a reset that asks first.
- Pro
Social Profiles Account
VerificationVerify the handles you claim: a framed card per network with its handle and state, a code to put in your bio and a Check now, a verified mark on the profile line, and a form that adds another network.
- Pro
Activity Log Account
Sessions and devicesWhat changed on an account as a vertical timeline grouped by day: icon nodes on a rail, a filter with counts for sign-in, security and data events, and a Details button that opens the device, place and address of each.