Essential UI components
Buttons, forms, cards, modals, dropdowns and more — best practices for designing each component
UI components are the building blocks of any digital interface. A button, a form field, a card or a modal may seem like simple elements, but each carries critical design decisions that affect usability, accessibility and conversion.
This guide walks through the most widely used components in web and mobile interfaces, with concrete best practices for each. The focus is not on how to build them technically but on how to design them so they fulfil their purpose effectively.
Buttons: the most important component
Buttons are the component that most directly impacts conversion. A well-designed button system has a clear hierarchy: primary (main action), secondary (alternative actions) and tertiary or ghost (low-priority actions). Each tier should be immediately distinguishable visually.
A primary button should have a solid background in the brand’s accent colour, contrasting text and a minimum size that invites clicking or tapping. Secondary buttons typically use an outline with no solid fill. Ghost buttons appear as linked text with no border or fill. Every button must have visible states: default, hover, active, focus and disabled.
- Clear hierarchy: primary (filled), secondary (outline), tertiary (ghost)
- Visible states: default, hover, active, focus, disabled, loading
- Minimum tap target size: 44×44 pt on mobile
- Specific action text: "Create account" instead of "OK"
- One primary button visible per context
Forms: minimising friction
Forms are the point where most users drop off. Each additional field increases friction, so the first rule is to ask only for information that is strictly necessary. A contact form with name, email and message converts significantly better than one with 10 fields.
Fields should have permanently visible labels (not just placeholder text, which disappears on input), clear validation states (real-time when possible), specific error messages ("The email format is invalid" rather than "Field error") and a single-column vertical layout on mobile.
- Only ask for strictly necessary fields
- Use permanently visible labels, not just placeholders
- Real-time validation with specific error messages
- Single column on mobile; two columns only for related fields (first + last name)
- Enable autocomplete (autocomplete attribute) for common fields
- Submit button with descriptive text and loading state
Cards: grouped, scannable content
Cards are visual containers that group related information: a product, an article, a user profile. Their strength lies in scannability: users can scan a grid of cards quickly and decide which one interests them without reading all the content.
An effective card has a clear internal hierarchy: image or visual element on top, prominent title, brief description and action (button or link) at the bottom. The most common mistake is packing too much content into a card — if it needs internal scrolling, the card is too complex and should be a separate page.
- Internal hierarchy: visual → title → description → action
- Consistent sizing within the same card grid
- No internal scrolling inside a card
- Make the entire card clickable if it has a single associated action
- Subtle shadow or border to delineate without excessive contrast
Modals: interrupt with purpose
A modal is an overlay window that blocks interaction with the background content. It is intrusive by nature, so it should only be used when the action requires immediate attention: confirming a deletion, accepting terms, completing a process that cannot be postponed.
The most common modal mistakes are using them for content that should be a page, nesting modals inside modals (confusing experience) and not allowing closure with the Escape key or by clicking the overlay. Every modal must be keyboard-accessible and have a focus trap to prevent users from tabbing outside it.
- Use only for actions that require immediate attention
- Allow closure via Escape, close button and overlay click
- Focus trap: keyboard focus must not escape the modal
- Never nest modals inside modals
- On mobile, consider bottom sheets as a more ergonomic alternative
Dropdowns: option selection
Dropdowns (select, combobox, context menu) are one of the most problematic interface components. The native HTML select has styling that varies across browsers and is difficult to customise. Custom dropdowns offer full visual control but require manually implementing accessibility: arrow-key navigation, type-ahead search, screen reader support.
For lists of fewer than 5–7 options, radio buttons or segmented controls are usually better than a dropdown because they make all options visible without extra interaction. Dropdowns are justified when there are more than 7 options or when space is limited.
- Fewer than 5–7 options → consider radio buttons or segmented controls
- More than 7 options → dropdown with built-in search
- Accessibility: arrow navigation, type-to-filter, ARIA roles
- Positioning: the dropdown must not clip outside the viewport
Tables: structured data with clarity
Tables are the best component for displaying comparative or tabular data: product listings, user records, financial transactions. On desktop, a well-designed table with aligned columns, alternating row colours and sticky headers is extremely efficient for scanning data.
The challenge lies in responsiveness. Tables with many columns do not work on mobile. The most common strategies are: horizontal scroll with a fixed first column, card layout (each row becomes a card), or showing only essential columns with a "view more" button for details.
- Sticky headers for long tables
- Alternating row colours to aid horizontal reading
- On mobile: horizontal scroll with fixed first column, or card layout
- Allow column sorting when the data warrants it
- Pagination or infinite scroll for large datasets
Tooltips and popovers: information on demand
Tooltips are small text boxes that appear on hover over an element to provide additional context. They are useful for explaining unlabelled icons, showing keyboard shortcuts or clarifying form fields without cluttering the interface with permanent text.
The main problem with tooltips is that they rely on hover, which does not exist on touch devices. The mobile alternative is a popover, which is activated on tap and stays visible until dismissed. Tooltips should contain only brief text; if you need richer content (images, links, forms), a popover or modal is more appropriate.
- Use for brief contextual information, not critical content
- On mobile, replace with tap-activated popovers
- Smart positioning: the tooltip must not overflow the viewport
- Appearance delay of ~300 ms to prevent accidental triggers
- Accessibility: associate with aria-describedby and allow focus activation
Key Takeaways
- Buttons need a clear hierarchy (primary, secondary, ghost) and all states
- Forms should ask only for essentials, with visible labels and real-time validation
- Cards work when they group minimal information with clear internal hierarchy
- Modals are intrusive — reserve them for actions that demand immediate attention
- Dropdowns are justified from 7+ options; for fewer, use radio buttons
- Tooltips need a touch alternative (popovers) on mobile
Need a coherent component system?
We design reusable, accessible and documented UI component systems that accelerate development and guarantee consistency.