Sub topic 13
Search and filters on small screens
Assume you know basic web or mobile interface patterns, forms, and TypeScript or HTML. This chapter focuses on adapting search and filtering interactions to narrow screens, where space, touch accuracy, and keyboard behavior affect the design.
Preserve the main finding task
On a small screen, search should remain easy to find and use. Keep the search field near the top of the page. Let it expand to the full available width instead of placing several controls beside it.
Filters need less permanent space. A common pattern is a Filters button that opens a separate view or bottom sheet. The button should show the number of active filters, such as “Filters (3)”. Users can then understand the current state without opening the panel.
Browsing, searching, and filtering still have different purposes:
| Task | Small-screen pattern | Important detail |
|---|---|---|
| Search by known words | Full-width search field | Keep the submit action clear |
| Narrow a result set | Filters button and sheet | Show active filter count |
| Explore categories | Horizontal category row or list | Make horizontal scrolling discoverable |
Do not hide essential results behind a filter panel. The results page should remain visible when possible, and applying a filter should return the user to the updated results.
Use a filter sheet carefully
A filter sheet is a panel that slides up from the bottom or opens as a full-screen page. It works well when filters contain several controls, because the panel can use the entire screen.
For a short filter list, changes can apply immediately. For complex filters, provide explicit Apply and Cancel actions. Keep temporary choices separate from applied choices until the user selects Apply. This prevents accidental changes when the user dismisses the panel.
Place the primary action where it is easy to reach. A sticky footer can keep Apply visible while the user scrolls. It must not cover the last control, and it should respect the device’s safe area.
<button type="button" aria-controls="filter-panel" aria-expanded="false">
Filters (2)
</button>
<section id="filter-panel" hidden aria-labelledby="filter-title">
<h2 id="filter-title">Filter results</h2>
<fieldset>
<legend>Category</legend>
<label><input type="checkbox" name="category" value="boots"> Boots</label>
<label><input type="checkbox" name="category" value="shoes"> Shoes</label>
</fieldset>
<div class="filter-actions">
<button type="button">Clear all</button>
<button type="submit">Apply filters</button>
</div>
</section>The control that opens the panel must update its expanded state. When the panel opens, move focus into it. When it closes, return focus to the opening button. A modal sheet also needs a focus trap, a clear close button, and a way to close with the Escape key.
Design for touch and keyboard changes
Touch targets should be large enough to activate without precision. Use generous spacing around checkboxes, sort controls, and close buttons. Do not rely on hover to reveal descriptions or actions.
The on-screen keyboard can reduce the visible result area. Keep the search query when the keyboard closes, and avoid replacing the page unexpectedly while the user is typing. Suggestions should be short, readable, and selectable with either touch or keyboard input.
Test narrow layouts and recovery
Test at common phone widths and with larger text. Check that long filter names wrap without hiding their controls. Verify that a user can open filters, change a choice, apply it, inspect results, and return without losing the query.
Measure whether users complete searches, apply filters, and recover from empty results on mobile. Compare completion time and filter abandonment with the desktop experience.
Exercise
A phone screen shows a search field, a sort control, six filter groups, and the results list. What should you change first?
Show answer
Keep the search field visible, move the filter groups into a filter sheet, and keep a visible Filters button with the active-filter count. Test whether sorting belongs beside the results rather than inside the filter sheet.