UI Elements for AI Coders
Every user interface component you need to know. Learn the name, see the example, and know exactly what to ask AI for. Also see: CSS Concepts, Colors, Sections Gallery.
In this chapter
- The basic building blocks every UI is made of
- Buttons, inputs, cards, modals, and toasts explained
- How to name UI elements so AI builds the right one
- Patterns to keep your interface consistent
Buttons
Buttons trigger actions. Different styles communicate different levels of importance.
Floating Action Button (FAB)
A circular button that floats above content, usually in a fixed position. Common in Material Design.
Form Inputs
Input elements let users enter data: text, email, password, dropdown, textarea, and more.
Toggles, Checkboxes & Radios
Binary or multiple-choice selection controls.
Breadcrumbs
A navigation aid showing the user's current location in the site hierarchy.
Progress Bars
Visual indicators showing how much of a task or process is complete.
Badges, Tags & Chips
Small labels used to categorize, label, or show status.
Alerts & Notifications
Messages that provide feedback: success, warnings, errors, or informational notices.
Modals & Dialogs
Overlay windows that appear on top of main content for confirmations, forms, or important messages.
This is a modal dialog. It overlays the page and requires user interaction before returning to the main content.
Tabs
Allow users to switch between different views within the same page.
This is the Overview tab content. Tabs help organize content into logical sections.
This is the Features tab. Users can switch between tabs without reloading the page.
This is the Pricing tab. Each tab panel contains its own content.
Accordion / Collapsible
Expandable content sections. Great for FAQs, settings, or content hidden by default.
What is an accordion?
When should I use one?
How do I ask AI for one?
Avatars
Small circular images or initials representing a user.
Tooltips
Small popups on hover providing extra information.
Tables
Structured data in rows and columns for lists, comparisons, and data-heavy interfaces.
Cards
Self-contained content containers. The most common way to group related information.
Cards group related content. They can contain text, images, buttons, or any other elements.
Commonly used to showcase features, products, team members, or pricing plans.
Skeleton Loaders
Placeholder content that mimics the shape of real content while loading.
Spinners / Loading Indicators
Animated indicators telling the user something is loading.
Pagination
Navigation for moving between pages of content.
Hero Section
The large, prominent area at the top of a landing page with headline, subtitle, and CTA.
Search Bar
An input specifically for searching content, usually with a magnifying glass icon.
Navigation Bar (Navbar)
The horizontal bar at the top of every page with logo, links, and actions. The most essential page element.
Header
The top section of a page combining the navbar with a page title, subtitle, or breadcrumbs. Different from a navbar, a header wraps the nav and adds context.
Footer
The section at the very bottom of every page with links, copyright, and contact info.
- Features
- Pricing
- Changelog
- About
- Blog
- Careers
- Help Center
- Contact
- Status
- Privacy
- Terms
- Cookies
Sidebar
A vertical navigation panel on the left (or right) side of the page. Common in dashboards and admin panels.
Main content area goes here. The sidebar stays visible while the content scrolls.
Hamburger Menu
The three-line icon (☰) that opens a mobile navigation menu. Essential for responsive websites.
Dropdown Menu
A menu that appears when clicking a button, showing a list of options or actions.
Options
Mega Menu
A large dropdown that spans multiple columns, showing categories and sub-links. Used on complex sites like e-commerce.
- T-Shirts
- Jeans
- Jackets
- Dresses
- Phones
- Laptops
- Headphones
- Cameras
- Furniture
- Kitchen
- Decor
- Lighting
- Running
- Yoga
- Cycling
- Swimming
Bottom Navigation
A fixed bar at the bottom of mobile screens with 3–5 icon tabs. Think Instagram or TikTok.
Stepper / Wizard
A multi-step progress indicator showing where the user is in a process. Used for sign-up flows, checkouts, and forms.
Back to Top Button
A floating button that scrolls the user back to the top of the page. Appears after scrolling down.
Carousel / Slider
A component that cycles through items (images, cards, testimonials) one at a time with arrows or dots.
Timeline
A vertical or horizontal sequence of events in chronological order. Great for changelogs, histories, or process flows.
Pricing Table
Side-by-side plan comparison cards showing features and prices. A landing page staple.
- 1 project
- Basic support
- 1 GB storage
- 10 projects
- Priority support
- 50 GB storage
- Unlimited
- 24/7 support
- 500 GB storage
Testimonials
Quotes from happy customers or users. Builds trust and social proof on landing pages.
“This tool saved me 20 hours a week. I can't imagine going back.”
“The easiest onboarding I've ever experienced. Beautiful UI too.”
Stats / Counters
Big numbers that highlight achievements: users, downloads, uptime. Common in hero sections and about pages.
CTA Section
A prominent Call-to-Action block urging users to sign up, start a trial, or take the next step.
Join thousands of creators building amazing things. Free for 14 days.
Feature Grid
A grid of icons + short descriptions showcasing your product's features. A landing page essential.
Banner / Announcement Bar
A thin strip at the very top of the page with a promotional message or important notice.
Toast Notifications
Small, auto-dismissing messages that slide in to confirm an action. Different from alerts, they disappear on their own.
Popover
A small floating panel triggered by clicking (not hovering) on an element. More content than a tooltip.
Click me
A popover shows more detail than a tooltip. It can contain links, buttons, and formatted text.
Slide-over / Sheet
A panel that slides in from the side of the screen. Used for filters, settings, or detail views without leaving the page.
This panel slides in from the right. It's perfect for filters, settings, or viewing details without navigating away.
Command Palette
A search-driven overlay (usually Cmd+K or Ctrl+K) for quickly navigating or running actions. Popular in dev tools and modern apps.
Empty State
What users see when there's no content yet: no search results, no items, no messages. A chance to guide them.
Create your first project to get started. It only takes a minute.
Error Page (404 / 500)
Custom pages shown when something goes wrong: page not found (404) or server error (500).
The page you're looking for doesn't exist or has been moved.
Rating (Stars)
A star-based input letting users rate something from 1 to 5. Used in reviews, feedback, and product pages.
List Items
Structured rows of content: emails, notifications, settings, or any repeated data.
File Upload / Dropzone
An area where users can drag-and-drop or click to upload files. Essential for any app that handles media or documents.
Drop files here or click to upload
PNG, JPG, PDF up to 10MB
Date Picker
A calendar popup that lets users select a date. Used in booking, scheduling, and form fields.
Divider / Separator
A simple horizontal (or vertical) line separating sections of content.
OR
Section 2
Dark Mode Toggle
A switch that lets users flip between light and dark themes. Usually a sun/moon icon.
Cookie Consent Banner
A banner (usually at the bottom) asking users to accept cookies. Required by GDPR in many countries.
We use cookies to improve your experience. By continuing to browse, you agree to our use of cookies.
Social Share Buttons
A row of icons letting users share content to Twitter/X, Facebook, LinkedIn, etc.
Sticky Header
A header that stays fixed at the top as you scroll. Keeps navigation always accessible.
Frequently Asked Questions
What UI elements does every website need?
At minimum: a navbar, buttons, and a footer. Most sites also need cards (for displaying content), forms (for user input), and some kind of feedback element (toast notifications or alerts). Start with these basics and add more as your project grows.
How do I ask AI to build a specific component?
Use the component's real name, like 'modal', 'dropdown', 'accordion', or 'toast'. AI tools recognize these terms and will build exactly what you mean. Add details like 'with a close button' or 'that closes when clicking outside' for better results.
Should I build components from scratch or use a library?
Use a library like shadcn/ui. It gives you pre-built, accessible components that look professional. Building from scratch teaches you more, but a component library gets you to a polished result much faster, especially when paired with AI tools.