Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Content Preferences Account Block for React

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.

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

Let people correct what a product thinks of them, with this content preferences panel for React with Base UI. A hairline frame with a plus mark on each corner opens with a master Switch, "Use my reading to personalise", and a sentence that changes with it: on, the front page puts the person's topics first; off, every reader sees the same order and the topics are kept but not used. Under it a band holds up to three topics the person types themselves, as chips, with a field and the Shine Button that adds one. Below that the topics the product inferred sit in four groups (Cooking, Trail running, Jazz, Budget travel), each with one sentence on the reading that led to it, such as "You opened 12 recipes and saved 4 in the last 30 days", and its topics as chips with a button that removes them. Reset what we inferred asks first in an Alert Dialog and leaves the person's own topics alone. A line at the foot says what happened and Undo walks back one change at a time. It's built from Switch, Alert Dialog, Input, Field, Button, Shine Button and Guides, with a CSS entrance only. For a news reader, a feed, a store or any product that learns tastes from behavior.

FAQ

How do I load the real inferences?

Edit CLUSTERS for the groups, each with an id, a name and the one why sentence, and GUESSED for the topics, each with its cluster, an id and a name. Write the sentence from the real signal (how many recipes, which days) rather than a guess, since the point is that the person can see why a topic is there. The count line and the groups are worked out from the list, so nothing else needs editing; keep topic names short, because each chip holds one line.

What stays local, and how do I make removing real?

Everything: removing a topic, adding one, flipping the switch and resetting only change this page's state, and the status line says so. To make it real, call your preferences service in remove, add, setSwitch and reset, change the list only when it answers and show a failure in the same status line. Removing a guess should also stop the ranking from using it and, ideally, stop the model from inferring it again; say which in the sentence. Undo then needs a reverse call, or should be removed.

What are the limits on adding my own topics?

The field refuses an empty entry, one that is already on the list (compared without regard to case or accents, across every group) and a fourth topic, and says why in the slot under it, which is always there so nothing moves. Topics are limited to 14 letters and three in this demo so that every group keeps the same height; raise OWN_LIMIT and OWN_LENGTH and the reserved chip box together if your product allows more.

Does the panel change height?

No. Each group's chips sit in a box tall enough for two rows on a phone and one row from the small breakpoint, and a group with no topics says so in the same box. Chips are two to a row on a phone, so every chip name is cut to its width instead of wrapping. The switch's sentence reserves its longest wording, and the foot with the status line and Undo stays pinned to the bottom of the screen on a phone.

What does turning personalising off do?

It keeps every topic and stops using them, which the sentence says in words; the chips turn to a faint tint with their text at full strength, so the state is never only a tint, and each can still be removed. Turning it on again puts the same topics back to work. Both directions are single Undo steps.

Is it accessible?

The groups are a real list, each chip list is named for its group ("Cooking topics") and every remove button names its topic ("Remove Fermenting"). When a chip goes, focus moves to the next chip in its group, then the previous, then Undo. The reset dialog is an alert dialog with focus on Keep them. The status line is a polite live region present from the start.

  • Pro

    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.

  • 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

    Privacy Settings

    Privacy and consent

    A 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 setup panel split in two: twelve topic chips on one side and a five-story feed on the other that re-orders as topics are picked, with the matches first, marked and counted.

  • Pro

    An account's two-factor methods as rows with their role, history and a Test that opens a code field in place, Make primary, a guarded Remove, and a Set up that opens a QR code, a key name or a number.