The UI Element Catalogue: Buttons to Toasts, Their Jobs, States and shadcn/ui Names
A tour of the building blocks almost every app is made of: buttons, badges, inputs, selects, cards, tables, tabs, navigation, dialogs, drawers, toasts and empty states, with their states and their shadcn/ui names.
What you will learn
- Name the common UI elements and the job each one does
- Check the states of an element: hover, focus, error, disabled, loading and empty
- Choose between tabs and navigation, and between a dialog and a drawer
- Ask AI for the exact shadcn/ui component by name
Before you start
- Basic HTML and CSS
Almost every app is built from the same dozen pieces. A button, a field, a card, a table, a dialog, a little message in the corner. When you know these pieces by name, two things get easier: you can judge a screen quickly, and you can ask AI for exactly the element you want.
For each element below you get what it is for, which states it can be in, and which shadcn/ui component builds it. Every element in the pictures is rendered from a small gallery page in the project files, index.html with gallery.css.
Buttons and badges

A button is the thing you click to do something. There are five variants. Default is the main action, like Save. Secondary and outline are quieter. Destructive is red, for Delete. Ghost is almost invisible, for small actions like Skip. Then the states: normal, hover, disabled and loading.
A badge is a tiny label that shows a status: Active, Pending, Overdue, Draft, New. The colour tells you the meaning before you even read the word.
Keep one primary button per screen. And when a button is disabled or loading, the user knows the click was understood.
Inputs and selects
Every form is made of these two. An input is where you type a value. Here is the gallery markup for its four states:
<div class="col" style="gap:1em">
<div class="field"><label>Email</label><div class="input ph">[email protected]</div></div>
<div class="field"><label>Email, focused</label><div class="input focus">emma@exam</div></div>
<div class="field"><label>Email, with an error</label><div class="input err">emma@</div><div class="help err">Enter a valid email address.</div></div>
<div class="field"><label>Email, disabled</label><div class="input dis">[email protected]</div></div>
</div>

Focused has a blue ring, so you know where you are typing. Error is red, with a message that says exactly how to fix it. Disabled is greyed out, because you cannot change it right now. And the label above it always stays. A field without a label is a guess.
A select is for picking one value from a short list. In the gallery the priority is Medium, and the open menu shows Low, Medium, High and Urgent with a tick on the current one.
Every field needs a label, a focus ring and an error message that helps.
Cards and tables

A card groups one idea. This one has a title, a short description, a big number, a badge and two buttons. Weekly orders, 1,284, up 12%. You look at it for one second and you get the point.
A table is for many rows that you want to compare: order, customer, status and total. Notice the badges inside the status column and the totals aligned to the right, so the numbers line up. One row is highlighted, because the mouse is over it.
Tabs and navigation
They look alike but do different jobs. Tabs switch the view inside the same page: Overview, Orders, Settings. Click one and only the panel below changes.
Navigation moves you to a different page. The gallery has a top bar with the logo, the links and the active link underlined, a breadcrumb that shows where you are, and a sidebar for apps with many sections.
The rule: tabs stay inside a page, navigation goes to another page.
Dialogs and drawers
Two elements that appear on top of the page. A dialog darkens the page behind it and asks a short question: "Delete this task?", Cancel or Delete. The user must answer before doing anything else, so use it only when a decision really matters.
A drawer, which shadcn/ui calls a sheet, slides in from the side and holds a longer form. In the gallery it edits a student, with a name, an email and a Save button. The page stays visible behind it, so the user keeps the context.
A dialog asks a short question. A drawer holds a longer form without leaving the page.
Toasts and empty states

A toast is a quick message in the corner after an action. Order saved, with Undo. Could not save, with Retry. Success is green, a problem is red, and after a few seconds the toast fades away by itself. In shadcn/ui this one is called Sonner.
An empty state is what you see when there is nothing to show yet: an icon, a clear message and one button that says what to do next. Without it, the user sees a blank page and wonders if something broke.
Element, job and component
| Element | Its job | shadcn/ui |
|---|---|---|
| Button, Badge | Act, and show a status | Button, Badge |
| Input, Select | Collect a value | Input, Label, Select |
| Card, Table | Group and compare | Card, Table |
| Tabs, Navigation | Switch view, change page | Tabs, Sidebar |
| Dialog, Drawer | Ask, or edit on the side | Dialog, Sheet |
| Toast, Empty state | Confirm, and guide | Sonner, Empty |
Use the names in the right-hand column when you ask AI. The project's PROMPT.md ends with this one:
Rewrite these elements using shadcn/ui components in a React and Tailwind project: Button, Badge, Input, Label, Select, Card, Table, Tabs, Dialog, Sheet, Sonner and Navigation Menu.
If you want to see how those components land in a real project, read shadcn/ui: components you own.
Common mistakes
- Only designing the happy state. Check the error, disabled, loading and empty states too. States and feedback goes further on this.
- A dialog for everything. A dialog blocks the page. If it is not a real decision, use a toast or a drawer.
- Tabs that change the URL and page. That is navigation. Users expect tabs to keep them on the same page.
- Dropping the label. A field without a label is a guess. Keep the label above it in every state.
Recap
Pick by job: act, collect, group, ask, confirm. Check every state: hover, focus, error, disabled, empty. Use the right name, the shadcn/ui component, in your AI prompts. These are the foundations of almost every app, and with them AI can generate the rest.
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
The Python Architect Masterclass: Full Stack to AI Engineer
Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)Related posts
One Request, Two Answers: the Same Post as an HTML Page and as JSON
Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.
A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.
How a Web Page Works: HTML Tags, Elements and Attributes
A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.
Semantic HTML: header, nav, main, aside and footer as Page Landmarks
The same page written as div soup and with semantic tags looks identical, but only one gives screen readers and search engines landmarks and an outline. Plus tables, div, span and the one-main rule.
