shadcn.io is not affiliated with official shadcn/ui
Custom Fields Onboarding Block for React
A setup panel that turns a pasted spreadsheet header into typed fields, with a list of eight places and a live New customer record that shows the right control for each type.
Installation
Overview
Let a new user build the fields of their first record from the spreadsheet they already have, with this fields step for React with Base UI. It is a setup panel of Slatemoor, a lightweight database app, ruled by Guides in bands. The first band is a Textarea holding the header row (Name, Email, Company, Renewal date, Plan, Seats); Read columns turns each column into a field and guesses its type from its name with a short typed list of rules (a date, a number, an email, a choice or text). The second band is a list beside a preview: the list has eight places, each field in one with its name, a type you can change in a Native Select, a Required Switch and a Remove, and the preview is the “New customer” record the fields make, with the matching control for each type, changing as you edit. Remove can be undone. Save fields is the one Shine Button, quiet until something changed, with Discard beside it.
FAQ
How is a type guessed, and how do I change the rules?
kindOf splits the column's name into lower-case words and takes the first rule in RULES that has one of them: email (email, mail), date (date, day, due, deadline, renewal…), number (seats, count, qty, amount…) and choice (plan, status, tier, stage…); anything else is text. The options a choice field shows come from CHOICES by a word in its name, and an unknown choice shows two placeholders. Edit those lists to fit your product; the type select always lets the visitor override the guess.
What happens when I read the columns again?
Each column that is already a field keeps the type and the Required setting it had (the name is compared ignoring capitals); only new columns are guessed. The status says how many were new and how many kept (“Read 7 columns: 1 new, 6 kept as set.”), and Undo brings the old list back. A header of more than eight columns uses the first eight and says so.
What does it refuse?
An empty header, a name longer than 24 characters and two columns with the same name, each in words under the text area (the line is always reserved, so nothing moves) with focus put back in the text area. Saving with no fields is refused the same way.
How is the record previewed?
Each field becomes a labelled control in order: a text box, an email box, a number box, a date box or a choice, with a star and “required” for screen readers on required ones. The controls are real, so you can try them, but nothing is saved. A field that changes type is replaced by the control for its new type.
What stays local in the demo, and how do I wire it?
Everything: the header is pasted text, no spreadsheet is opened or uploaded, and Save fields only says the fields were kept in this demo. In your app create the fields on your server where save says so, and replace the guess with a look at the first rows of a real upload if you accept one.
Related
- Pro
A setup panel with a tree of categories beside a drawn sidebar that mirrors it live, with rename, add, move up, move down, delete and undo for the picked category.
- Pro
A setup panel with a tags input that starts with five tags, refuses a repeat or a thirteenth in words, offers three suggestions as buttons and has Clear all with an Undo.
- Pro
A project step split in two: a name with the key its tasks will carry and a three-way choice of how to start, beside a drawn board that follows the choice.
- Pro
A setup panel with three sample sets as radio rows beside the picked set's first five rows and counts, a Load sample data button and a Remove that takes the samples out again.
- Pro
Achievement Trail Onboarding
Milestones and recapsA language-learning app's first-run trail: eight milestones along a winding path drawn from hairlines, three reached, a you-are-here ring, a hover card per node, a rolling count and progress, and a button that previews the next unlock.
- Pro
AI Assistant Introduction Onboarding
Welcome and toursA research notebook's assistant introducing itself: a popover over a drawn notebook with a greeting, three capability buttons that fill the box with a sample prompt, a field with Send, and replies typed in advance.