You search for a room for New Year's Eve, and the app shows a single grey line: "No results." No suggestion, no way out. It feels like a door shut in your face.
Compare that with the "Full" sign Mrs. Sri hangs on the homestay door when every room is taken. It shows a little house under the moon, drawn with the same green marker as the facilities board. Under it is written: "Full tonight. The Terrace Room is free on the 27th, please ask." The picture stops guests from feeling unwelcome. But what really helps is the writing. If the picture were as big as the door so the writing couldn't be read, the sign would fail.
The house on that sign is called an illustration: a drawn picture, not a photo, that sets a mood and helps explain something. Every image file a page uses (illustrations, icons, photos, logos) is called a visual asset.
When illustration helps
Illustration helps in moments that are rare and need explaining:
- Empty state (an empty page): a search with no results, a favourites list not filled yet.
- Onboarding (a first introduction): three steps the first time Mrs. Sri opens her dashboard.
- Error page: a 404 "page not found", a service under maintenance.
- Landing page: the opening section of a promotional page.
On pages used again and again and full of data, illustration is a distraction. Examples are Mrs. Sri's 16-booking dashboard, or a form, where the guest is busy filling things in.
Empty state: picture, message, action
Like Mrs. Sri's "Full" sign, a good empty state has three parts, and the most important one isn't the picture. Here is the empty state on the booking page when every room is full:
<section class="empty">
<svg class="art" viewBox="0 0 240 160" aria-hidden="true">...</svg>
<h2>Every room is booked 24 to 26 Dec</h2>
<p>Mrs. Sri's three rooms are booked for those dates.
From 27 to 29 Dec, the Terrace and Garden Rooms are still free.</p>
<button class="book">See 27 to 29 Dec</button>
</section>
- Message (the
<h2>heading and the<p>paragraph): what happened (every room is booked), why (the three rooms are taken), and what can be done (the nearest free dates). "No results, try again later" answers none of them. - Action: a button that takes the guest straight to the way out.
- Illustration: decoration, because the message already explains everything. So the
<svg>getsaria-hidden="true", oralt=""if the illustration is placed as an<img>. An illustration that carries information (an onboarding step diagram, for example) needs a text alternative that explains it.
One style with the icons and the page
Like an icon set, an illustration must share its page's style. Mrs. Sri's empty-state illustration is drawn by the facility icons' rules: a stroke of 2 with round ends, flat with no shadow, and colours from the page's palette. This table compares it with a generic stock illustration (a ready-made picture made for any site):
| The page's style | Generic stock | |
|---|---|---|
| Line | 2, round ends, like the icons | no line, heavy shapes |
| Colour | 6, all from the page's palette: green #15803d, #bbf7d0, #dcfce7, #f0fdf4, grey #94a3b8, white |
6, five of which appear nowhere on the page: purple #a855f7, light purple, orange #f97316, yellow, cyan |
| Effects | flat | a gradient and a shadow |
| Subject | a house under the moon and mist, about this homestay | a sad face that could be on any site |
Generic stock illustration is a weak choice because the same picture is used on many other sites. It says nothing about Mrs. Sri's homestay, and next to green line icons it looks pasted in. If you use a stock pack (a set of stock illustrations in one style), pick one pack, recolour it to the page's palette, and use that pack everywhere.
Display size: the action must be visible
A search for 24 to 26 Dec finds nothing, and a 240px tall illustration sits above the message. On a 360 × 640 phone, is the "See 27 to 29 Dec" button still whole on the first screen (what you see before you scroll)? Guess first, then look at the table.
On that phone, the page starts with the site title, two date fields and the search button. This table holds the position of the "See 27 to 29 Dec" button from the top edge of the screen, measured in Chrome:
| Illustration height | Button | On a 640px screen |
|---|---|---|
| none | 345 to 393px | whole |
| 80px | 441 to 489px | whole |
| 160px | 521 to 569px | whole |
| 200px | 561 to 609px | whole |
| 240px | 601 to 649px | cut off by 9px |
So the answer to the guess: no. With a 240px illustration, only the top 39px of the button fit on the screen. The rest has to be scrolled to. The picture is bigger than its message needs. On a phone, 120 to 160px is enough to set the mood.
File size: SVG for line drawings
The empty-state illustration, 240 × 160, can be stored in a few formats. SVG stores its lines and shapes, while PNG and WebP store the picture as dots of colour (pixels). The "after gzip" numbers are the file sizes after the server compresses the file before sending it:
| Format | The page's style | Generic stock |
|---|---|---|
| Inline SVG | 555 bytes (305 bytes after gzip) | 736 bytes (408 bytes after gzip) |
| PNG 2x (480 × 320, for sharp screens) | 10,559 bytes | 29,165 bytes |
| WebP 2x, quality 80 | 5,000 bytes | 3,922 bytes |
- Line drawings and flat areas are smallest as SVG. An SVG picture also stays sharp at any DPR, because the browser draws it again from its shapes.
- Gradients and shadows make the PNG much bigger (29,165 bytes). For a picture like that, WebP is actually far smaller: 3,922 bytes, even smaller than the WebP of the page-style illustration. So don't guess: measure.
- A very detailed illustration (hundreds of shapes) can be bigger as SVG than as WebP. For a picture like that, use an
<img>with WebP,width,height, andloading="lazy"if it sits further down.
⚠️ A pretty picture, and the guest is still stuck
- An illustration without a helpful message. A friendly picture plus "No results" still leaves the guest stuck. Write what happened, why, and what next.
- An oversized illustration. A 240px illustration pushes the button off a 640px screen. The picture supports the message, it doesn't replace it.
- Mixed styles. A purple stock illustration with a shadow next to green line icons. Use one style, one palette.
- Illustration on work pages. Dashboards and forms don't need pictures.
TL;DR: Illustration (a drawn picture, not a photo) works in moments that are rare and need explaining: empty states (empty pages), onboarding (a first introduction), error pages and landing pages (promotional pages). Not on data-heavy dashboards or forms. An empty state has three parts: the illustration (decoration, so aria-hidden="true" or alt=""), a message that says what happened, why, and what next, then its action button. The illustration must share a style with the icons and the page (the same line, the same palette). Generic stock illustration (ready-made pictures for any site) is used on many other sites, so it says nothing about the brand (the business that owns the page). Watch its size: on a 360 × 640 phone, a 240px illustration pushes the action button off the screen, 160px is still safe. Line drawings are smallest as SVG (555 bytes against 10,559 for a 2x PNG). But measure first, because a picture with gradients can be far smaller as WebP than as PNG.
⚡ When illustration helps
Meaning: Illustration (a drawn picture, not a photo) works best in moments that are rare and need explaining: empty states (empty pages, such as a search with no results), onboarding (a first introduction), error pages and landing pages (promotional pages). On data-heavy dashboards and forms it is a distraction.
⚡ Picture, message, action
Write:
<section class="empty">
<svg class="art" viewBox="0 0 240 160" aria-hidden="true">...</svg>
<h2>Every room is booked 24 to 26 Dec</h2>
<p>Mrs. Sri's three rooms are booked for those dates.
From 27 to 29 Dec, the Terrace and Garden Rooms are still free.</p>
<button class="book">See 27 to 29 Dec</button>
</section>
Meaning: This is the empty state when every room is full. The message (<h2> and <p>) says what happened, why, and what next. The button opens the way out: the dates that are still free. The illustration (<svg>) is only decoration, so it gets aria-hidden="true" and screen readers skip it.
⚡ Keep the picture small
Guess first: a 240px tall illustration above that message, on a 360 × 640 phone. Is the date button still whole on the first screen?
No. In the lesson's measurement it's cut off by 9px at the bottom of the screen. With a 160px illustration, the button stays whole.
Meaning: The picture supports the message, it doesn't replace it. It should also share a style with the icons and the page's palette. Line drawings are smallest when stored as SVG (an image format that stores lines and shapes).