Components and states
The names of the parts of a page and of the components it's built from, such as buttons, forms and dialogs, and of the states each one needs, so that you can ask for the screens a mockup forgets.
The parts of a page
Most sites share the same anatomy, and each part has a name. The header is the band at the top of every page. It holds the logo, which usually links back to the home page, and the navigation bar, or navbar: the row of links to the main sections of the site. A menu is any list of links or actions that you choose from. On a phone, the navigation often hides behind a hamburger menu, a button with three lines that opens the menu. On a wide screen, a hamburger menu that hides three links makes visitors click for nothing.
Under the header, the hero is the large first section of a page. It holds the main title, a short text, often a photo, and the main button. On your portfolio, the hero says who you are and what you do. Breadcrumbs are a line of links that shows where the page sits in the site, such as "Home › Exhibitions › Monet". Visitors use them to go up one level. A museum or a shop with many levels needs them. A portfolio with three pages doesn't.
A sidebar is a column beside the main content, with filters, a table of contents or related links. On a computer, Vinted shows its search filters in a sidebar. The footer is the band at the bottom of every page, with the contacts, the social links and the legal notice.
The example below is a small portfolio page with a header, a hero, three project cards and a footer. The header holds the logo, the navigation bar and a call to action, "Contact me". In the code, the header, the navigation, the main content and the footer each have their own HTML tag: header, nav, main and footer. Screen readers announce these parts by name, as in the lesson "Structure and meaning". Try changing the names of the three projects, or the text of the hero.
Swipe sideways to see the whole figure.
A page and its named parts
Camille Laurent
Robotics engineer, looking for an internship.
Robot
Drone
Rocket
The style rules it uses
.ex-page { font-size: 14px; color: #18181b; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
padding: 10px 16px; border-bottom: 1px solid #e4e4e7; }
.logo { font-weight: 800; font-size: 18px; color: #18181b; text-decoration: none; }
nav { display: flex; gap: 14px; margin-left: auto; }
nav a { color: #3f3f46; }
.cta { padding: 6px 12px; border-radius: 6px; background: #1d4ed8;
color: #fff; font-weight: 600; text-decoration: none; }
main { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
.hero { grid-column: 1 / -1; padding: 22px 20px; border-radius: 8px; background: #eef2ff; }
.hero h1 { margin: 0 0 4px; font-size: 24px; }
.hero p { margin: 0; color: #3f3f46; }
.card { padding: 44px 12px 12px; border-radius: 8px; background: #f4f4f5; }
.card h2 { margin: 0; font-size: 15px; }
footer { padding: 10px 16px; border-top: 1px solid #e4e4e7; color: #52525b; }
footer a { color: #1d4ed8; }
Cheat sheet
- Page headeren-tête
- the band at the top of every page, with the logo, the navigation and sometimes a search bar.
- Logologo
- the symbol or the name of the organisation, usually in the header, which links to the home page.
- Navigation bar or navbarbarre de navigation
- the row of links to the main sections of a site, usually in the header.
- Menumenu
- a list of links or actions that you choose from, such as the main sections of a site.
- Hamburger menumenu burger
- a button with three lines that opens the menu, used on small screens.
- Linklien
- an element that goes somewhere, to another page or another place on the same page, with an address you can share.
- Herobannière principale, section héro
- the large first section of a page, with the main title, a short text and the main button.
- Breadcrumbsfil d'Ariane
- a line of links that shows where a page sits in the site, such as "Home › Exhibitions › Monet".
- Sidebarbarre latérale
- a column beside the main content, with filters, a table of contents or related links.
- Footerpied de page
- the band at the bottom of every page, with contacts, social links and the legal notice.
Components and buttons
A site is built from components: reusable pieces such as a button, a project card, a form field or the navigation bar. Each one is designed once and reused everywhere. When the designer changes the card, every project changes at once. A component can have variants, which are versions of the same component for different uses, such as a large and a small button, or a card with or without a photo.
Buttons come in a few standard variants. The primary button is for the main action of the screen, such as "Prendre rendez-vous" on Doctolib. It has the strongest look, often filled with the primary colour, and each screen should have only one. A secondary button is for the other actions, such as "See it on GitHub" next to "Download my CV". It's more discreet, with an outline or a light background. An icon button shows only an icon, a small picture that stands for an action, such as a heart, a cross or a share arrow. It needs a hidden text label for screen readers, and often a tooltip.
A call to action, or CTA, is any element that asks visitors to act: "Book a ticket", "Contact me", "Download my CV". The main call to action of a page is usually its primary button. When every button calls for action, visitors don't know which one matters.
Affordance is what an element suggests you can do with it. A filled button says "press me". Underlined blue text says "this is a link". Grey text with no border, used as a button, has poor affordance: visitors don't see that they can press it.
Pictures have names too. An illustration is a drawing, used to explain or decorate. AI design tools add generic 3D illustrations to most pages, so ask what each one tells the visitor. An avatar is a small picture that stands for a person, often a round photo or initials, such as the profile pictures on Vinted.
Cheat sheet
- Componentcomposant
- a reusable piece of a page, such as a button or a card, designed once and used everywhere.
- Variantvariante
- a version of a component for another use, such as a small button or a card without a photo.
- Call to action or CTAappel à l'action
- an element that asks visitors to act, such as "Book a ticket" or "Contact me".
- Primary buttonbouton principal
- the button for the main action of a screen, with the strongest look.
- Secondary buttonbouton secondaire
- a more discreet button for the other actions of a screen, often with an outline.
- Iconicône
- a small picture that stands for an action or an idea, such as a heart or a magnifying glass.
- Icon buttonbouton icône
- a button that shows only an icon, with a hidden text label for screen readers.
- Affordanceaffordance
- what an element suggests you can do with it, such as a filled button that looks pressable.
- Illustrationillustration
- a drawing used to explain or decorate a page, as opposed to a photo.
- Avataravatar
- a small picture that stands for a person, often a round photo or their initials.
Forms
A form is a group of fields that visitors complete and send: a contact form, a sign-up page, a booking on Doctolib. Each kind of field has a name. A text field, also called an input, is a box where you type one line, such as a name or an email. A label is the text that says what a field is for, such as "Email". It stays visible above or next to the field. A placeholder is the grey hint inside an empty field, such as "camille@example.com". It disappears as soon as you type.
AI design tools and many designers use the placeholder as the label, because it looks cleaner. Once a visitor has typed, the hint is gone, and nobody can check what each field was asking for. Placeholders are also often too pale to read. Ask for a real label on every field.
When visitors choose instead of typing, the field depends on the choice. A checkbox is a small square that you tick, for a yes or no question, or for several choices in a list. Radio buttons are small circles for one choice among a few, such as "Reply by email" or "Reply by phone". Choosing one clears the others. A toggle, or switch, turns a setting on or off at once, like the dark mode switch in Deezer's settings. A dropdown, or select, opens a list of choices when you click it. It suits long lists, such as a list of countries. A search bar is a text field for searching, usually with a magnifying glass icon.
A long form is easier in several steps. A stepper shows the steps and where you are, such as "1 Journey, 2 Passengers, 3 Payment" when you book a train.
The example below shows the same contact form twice. On the left, placeholders replace the labels. The first field is already filled in: can you tell what it asks for? The two radio buttons have no question either. On the right, every field has a label that stays. Type something in the "Email" field on each side, and compare.
Placeholders instead of labels
Email Phone
A label on every field
Reply by
The style rules both versions share
.ex-page { padding: 12px 20px; font-size: 14px; color: #27272a; }
.form { display: grid; gap: 8px; max-width: 300px; }
label { display: grid; gap: 2px; }
p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; }
label:has([type=radio]), label:has([type=checkbox]) { display: flex; align-items: center; gap: 6px; }
input:not([type]), select { padding: 5px 10px; font: inherit; color: #18181b;
border: 1px solid #71717a; border-radius: 8px; background: #fff; }
input[type=radio], input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
Cheat sheet
- Formformulaire
- a group of fields that visitors complete and send, such as a contact form.
- Text field or inputchamp de saisie
- a box where a visitor types one line, such as a name or an email.
- Labellibellé
- the text that says what a field is for, such as "Email", which stays visible next to the field.
- Placeholdertexte indicatif
- a grey hint inside an empty field, which disappears as soon as the visitor types.
- Checkboxcase à cocher
- a small square that a visitor ticks, for a yes or no question or for several choices.
- Radio buttonbouton radio
- a small circle for one choice among a few, where choosing one clears the others.
- Toggle or switchinterrupteur
- a control that turns a setting on or off at once, such as dark mode.
- Dropdown or selectliste déroulante
- a field that opens a list of choices when you click it.
- Search barbarre de recherche
- a text field for searching a site, usually with a magnifying glass icon.
- Stepperindicateur d'étapes
- a line that shows the steps of a long form and where the visitor is.
Things that open on top of the page
Some components appear on top of the page, on their own layer. A modal, or dialog, is a box that opens over the page and darkens everything behind it. You must answer it or close it before you can do anything else, as when a site asks "Delete this project?". It needs a visible close button, and it must close with the Escape key. A toast, or snackbar, is a short message that slides in at the edge of the screen for a few seconds, then disappears by itself, such as "Added to your favourites" on Vinted. Since it disappears, use it only for messages that visitors can safely miss. A tooltip is a small label that appears when you point at an element or reach it with the keyboard, such as "Share" over an icon.
A banner is a wide strip across the top of a page or a section, with a message for everyone, such as a strike warning on SNCF Connect. A badge is a small coloured label or number on another element, such as "New" on a card, or the number of unread messages on an icon.
Other components show content in turn. Tabs are labels in a row, and each one shows a different panel in the same place, such as "Description", "Reviews" and "Delivery" on a product page. An accordion is a list of titles that open and close to show their content, as in a list of questions and answers. A carousel shows one slide at a time, with arrows to see the next one. Few visitors go past the first slide, so an important offer on the third slide is almost invisible.
A transition is the short change from one state to another, such as a modal that fades in. An animation is any movement on the page. Short ones help visitors see what changed. Long or constant ones tire them, and some visitors ask their system for less motion.
The example below shows three of them side by side: a modal over a darkened page, a toast at the bottom of a screen, and a tooltip over an icon button. On a real site, scripts make them appear and disappear. Here, they're drawn in place so that you can compare them. Try changing the text of the toast.
From left to right: a modal, a toast and a tooltip
Delete this project?
✓ Message sent
The style rules it uses
.ex-page { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; font-size: 14px; }
.screen { position: relative; flex: 1 1 180px; height: 170px; overflow: hidden;
display: grid; place-content: center; justify-items: center; gap: 8px;
border: 1px solid #d4d4d8; border-radius: 10px; background: #f4f4f5; }
.dim { background: #52525b; }
.modal { padding: 14px 16px; border-radius: 10px; background: #fff;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.modal p { margin: 0 0 12px; }
button { padding: 6px 12px; font: inherit; border: 1px solid #a1a1aa;
border-radius: 6px; background: #fff; color: #18181b; }
.modal button:last-child { border-color: #b91c1c; background: #b91c1c; color: #fff; }
.toast { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0;
padding: 10px 14px; border-radius: 8px; background: #18181b; color: #fff; }
.tip { position: relative; padding: 5px 10px; border-radius: 6px;
background: #18181b; color: #fff; font-size: 13px; }
.tip::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -6px;
border: 6px solid transparent; border-top-color: #18181b; }
.icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px; }
Cheat sheet
- Modal or dialogfenêtre modale, boîte de dialogue
- a box that opens over the page and blocks it until the visitor answers or closes it.
- Toast or snackbarnotification éphémère, toast
- a short message that appears at the edge of the screen and disappears after a few seconds.
- Tooltipinfobulle
- a small label that appears when you point at an element or reach it with the keyboard.
- Bannerbandeau
- a wide strip across a page or a section, with a message for every visitor.
- Badgepastille, badge
- a small coloured label or number on another element, such as "New" or a count of messages.
- Tabsonglets
- a row of labels, each one showing a different panel in the same place.
- Accordionaccordéon
- a list of titles that open and close to show their content, as in a list of questions.
- Carouselcarrousel
- a component that shows one slide at a time, with arrows to see the next one.
- Transitiontransition
- the short, smooth change from one state to another, such as a box that fades in.
- Animationanimation
- any movement on a page, such as a slide that moves or an icon that turns.
States
A mockup shows each component once, and every other state it can be in needs a design too.
Each component has states: the ways it looks, depending on what's happening. The default state is how it looks when nothing is happening. Hover is when the mouse pointer is over it. Phones have no hover, so nothing important can depend on it. Focus is when the keyboard has reached it with the Tab key. A component in focus needs a visible outline, so that keyboard users can see where they are. Active, or pressed, is the moment it's clicked or tapped. Selected is for a choice that is currently on, such as the "Projects" link in the navbar while you're on the projects page. Disabled is when it can't be used for now, such as a "Pay" button before the form is complete. It looks faded, and visitors should be able to see why.
These changes are visual feedback: the page answers each action, so visitors know that it worked. A button that doesn't change when pressed makes people press it again. A micro-interaction is a small designed moment around one action, such as the heart that fills and grows for a moment when you like a song on Deezer.
An inline error is a message shown right next to the field it's about, which says what's wrong and how to fix it: "This email address has no @ sign." It's a state of the field, and it needs a design too.
The example below shows one button from a contact form in each of its states, with the style rules for each one. Point at the first button with the mouse: it gets darker. Click inside the result and press the Tab key: the first button gets a light blue outline, which shows keyboard users where they are. The disabled button is skipped, because it can't be used. Under them, you can see the loading state, and a field in its error state with its message. Someone has to design each of these states.
A contact form's button and field
Normal
Disabled
Loading
Error
This email address has no @.
The style rules it uses
.ex-page { padding: 12px 20px; font-size: 15px; }
p { margin: 0 0 10px; display: flex; gap: 12px;
align-items: center; color: #52525b; }
input { padding: 7px 10px; font: inherit; border-radius: 8px;
border: 1px solid #a1a1aa; width: 12em; }
Cheat sheet
- Component stateétat
- one of the ways a component looks, depending on what's happening, such as hover or disabled.
- Default stateétat par défaut
- how a component looks when nobody is using it.
- Hoversurvol
- the state of an element while the mouse pointer is over it, which phones don't have.
- Focusfocus
- the state of the element that the keyboard has reached, shown by a visible outline.
- Active or pressedactif, enfoncé
- the state of a button at the moment it's clicked or tapped.
- Selectedsélectionné
- the state of a choice that is currently on, such as the tab or the menu link of the page you're on.
- Disableddésactivé
- the state of an element that can't be used for now, usually shown faded.
- Visual feedbackretour visuel
- a visible change that answers a visitor's action, so they know that it worked.
- Micro-interactionmicro-interaction
- a small designed moment around one action, such as a heart that fills when you like a song.
- Inline errorerreur en ligne
- an error message shown right next to its field, saying what's wrong and how to fix it.
What to ask
Ask these questions whenever you receive a mockup, before it goes to the people or the agent who will build the site. A mockup shows the moment when everything goes right. Visitors spend part of their visit in the other moments, and those screens need a design too.
Ask for the loading state: what a list or a page shows while its content arrives. A spinner is a small turning circle that means "wait". A skeleton screen shows grey shapes where the text and pictures will appear, like the first second of a playlist on Deezer. It feels faster than a spinner. Ask for the empty state: what a list shows when it has nothing in it, such as a search with no results on Vinted. A good empty state says why it's empty and what to do next. Ask for the error states: a field with a wrong value, a page that can't load, a payment that fails. Ask for the confirmation, the message that says an action worked, such as "Your appointment is booked" on Doctolib, with what happens next.
Then ask how the design is organised. A component library is the set of all the components, each with its variants and states, ready to reuse. A design system adds the design tokens, for colours, type and spacing, and the rules for using them. Many teams build it in Figma, the online design tool that most designers use.
The handoff is the moment the designs go to the developers or to a coding agent. Ask what it includes: every state of every screen, the phone and desktop versions, the components, and the tokens as named values. A coding agent that receives the tokens uses the same values, instead of guessing them from a picture. For example: "The mockup shows the contact form only when everything is correct. Before the handoff, can we see it while sending, with a wrong email, and once the message is sent?"
Cheat sheet
- Loading stateétat de chargement
- what a screen or a list shows while its content arrives.
- Spinnerindicateur de chargement, spinner
- a small turning circle that tells visitors to wait.
- Skeleton screenécran squelette
- grey shapes shown where text and pictures will appear, while they load.
- Empty stateétat vide
- what a list or a page shows when there is nothing in it yet, with what to do next.
- Error stateétat d'erreur
- what a field, a list or a page shows when something has failed, with how to fix it.
- Confirmationconfirmation
- the message that tells visitors an action worked, such as "Your appointment is booked".
- Component librarybibliothèque de composants
- the set of all the components of a site, each with its variants and states.
- Design systemdesign system
- the shared tokens and reusable blocks, such as buttons and cards, that a site's designers and developers both use.
- FigmaFigma
- the online design tool that most designers use to draw mockups and components.
- Handoffpassation
- the moment the designs go to the developers or a coding agent, with everything they need to build.
Practise this strand
These questions put you in the situations this lesson describes. You answer in your own words, and you get a level, feedback and a full answer.