Nov 16, 2026
7 Views
0 0

UI edge cases: A reference guide

Written by

A practical reference guide for catching UI edge cases before they ship — organized by category, with how to test, how to detect them in the wild, and how to design a fix. With examples.

UI edge cases: A reference guide, a banner image.
UI edge cases: A reference guide, a banner image.

Introduction

One day my colleague and I were at a workshop in a client’s office about agentic workflows in UI Design and Development when suddenly the client asked us a very good question.

“If we, designers and developers, are left to check the AI’s code for all the small but important edge cases it might miss — why don’t we give a document or a list of UI edge cases to the AI to begin with?”

Indeed a very good question, so my colleague and I tasked ourselves with finding a document like this so we could send it to our client.

But we couldn’t find anything that was generic enough to fit every client and specific enough to include all the little cases we saw everyday. Between us we have more than 15 years of UI Design and Development background.

We did find a few documents that had some of the information we needed as well as some that were industry-specific like documents for the Military, Governments, Medical or Telecom.

In the end I was tasked with writing a comprehensive document and sending it to the client for approval and it did end up giving the agentic workflow better results in terms of code generation.

So in the name of sharing, I give here the full document paraphrased in human language with some of the more technical code left out to keep it as generic and readable as possible.

1. Content-Driven

Empty states

This can happen when there’s no data to show yet, zero search results, empty inbox, empty list — screen looks broken or unfinished with no explanation.

To test, load the page with a brand-new account or a filtered view that returns nothing, or manually clear a list’s data source.

The solution is to design and implement a dedicated empty state — icon / illustration, one-line explanation, a clear next action (e.g., “No projects yet — Create one”).

No results for my search. Source: X.
No results for my search. Source: X.

Text length extremes

Long names or titles that break the layout (overflow, wrapping into other elements), very short or single-character values might look off-balance.

We can use pseudo-localization or seed test data with a deliberately long string (e.g., “Supercalifragilisticexpialidocious International Holdings LLC”) and a 1 or 2 character string in every text field, like “I” or “OK”.

We can solve this by defining truncation rules per component (single-line ellipsis vs. multi-line clamp vs. wrap) and set max-widths.

Text length issues, notice how they use ellipsis everywhere. Source: GitHub.
Text length issues, notice how they use ellipsis everywhere. Source: GitHub.

Long unbroken strings

URLs, emails, or IDs don’t wrap, causing horizontal overflow or breaking the container. A user might paste a long URL or a 40+ character token into any field that renders user content.

We should decide whether to truncate mid-string (common for hashes / emails) with an ellipsis in the middle, or just allow wrapping.

Notice those middle truncations. Source: Mempool.
Notice those middle truncations. Source: Mempool.

Pluralization and zero counts

Wordings like “1 items” or “0 item” can read as broken or unpolished. Some languages have more plural forms than English (Russian, Arabic).

Force counts of 0, 1, 2, and a large number through any relevant component, test with a locale that has more complex plural rules if you plan to localize.

To solve this we need to explicitly copy-write the 0, 1, and many states rather than assuming one template covers all of them. On the development side, we can use an i18n library with proper pluralization.

Notice the “1 point / 2 points” and also the “discuss” (no comments) / “1 comment” / “15 comments”. Source: Hacker News.
Notice the “1 point / 2 points” and also the “discuss” (no comments) / “1 comment” / “15 comments”. Source: Hacker News.

Localization / i18n

Translated text can run up to 40% longer (German, Finnish) or even run shorter, breaking fixed-width buttons and labels. RTL languages (Arabic, Hebrew) often need mirrored layouts while dates, numbers and currency formats vary.

We can pseudo-localize the UI (wrap strings with padding characters) to simulate expansion using a toggle with dir=”rtl” and browse the whole flow, try switching OS and browser locale when possible.

Design components with flexible widths, not fixed pixel widths for text containers, RTL “mirrored” variants for directional icons (arrows, chevrons and more) and “mirrored” interactions if relevant.
On the development side use logical CSS properties (margin-inline-start instead of margin-left) so RTL can be flipped automatically.

RTL language website (in Hebrew), notice how everything is flipped. Source: Wikipedia.
RTL language website (in Hebrew), notice how everything is flipped. Source: Wikipedia.

Missing media

Broken image links, users with no avatar, videos that failed to load — leaves a broken-image icon or an unintended blank space.

You can point an <img> src at a 404 URL (an address you know that doesn’t exist) to test this. Also test a user record with a null avatar field, a throttled network to successfully fail media loads.

Design a fallback state — initials-based avatar when image fails to load, or a generic placeholder image, a poster frame for a failed video.

Missing images — notice the broken-image icons, achieved by throttling the network in dev tools. Source: Wikipedia.
Missing images — notice the broken-image icons, achieved by throttling the network in dev tools. Source: Wikipedia.

2. State-Driven

Loading states

A blank screen or jarring pop-in while data loads — unclear if the app is frozen or if loading takes too long.

We can throttle network to “Slow 3G” in devtools and artificially delay API responses in a staging environment.

Design skeleton screens that match final content’s shape (not just generic spinners) for anything that takes >300ms and define a timeout state (“This is taking longer than usual”).

Loading is taking long, notice the skeleton screen. Source: Twitch TV.
Loading is taking long, notice the skeleton screen. Source: Twitch TV.

Error states

Network failures, validation errors, or partial failures (some data loaded, some didn’t) show up as a blank screen, console-only error, or generic “Something went wrong.”

Kill the network mid-request, mock a 500 / 403 / timeout response, simulate a request where only some of several parallel calls fail.

We should design distinct states per error type (network vs. permission vs. validation) with actionable recovery (a retry button, send bug report etc).

Validation error, the page does exist but you’re not logged in so you can’t see it. Source: GitHub.
Validation error, the page does exist but you’re not logged in so you can’t see it. Source: GitHub.

Interim / optimistic states

The gap between user action and server confirmation is either invisible (user might be unsure if it worked) or the UI update is later reverted, thus confusing the user.

We can add artificial latency and watch what the UI displays between click and response, we can force the server call to fail after an optimistic update to see the rollback behavior. Review any “like / save / delete” style interaction.

Define a clear pending visual, such as: subtle dimming, spinner on a specific element (not the whole page) and a clear rollback / error treatment if it fails / succeeds.

Pending states on buttons. Source: MUI.
Pending states on buttons. Source: MUI.

Permission / auth states

Logged-out views, session expiring mid-action, or insufficient permissions leads to silent failures or confusing redirects.

We can expire a session token manually and attempt an action, log in as a lower-permission role and attempt a restricted action, test deep-linking to a protected page while logged out.

Design a “session expired” interstitial that preserves the user’s in-progress work where possible, also design disabled / hidden variants for restricted actions with an explanation on hover or on tap.

A permission issue. Source: Wikipedia.
A permission issue. Source: Wikipedia.

Stale data

User might leave a tab open for hours, underlying data changes (deleted by someone else or otherwise updated elsewhere) and the UI still reflects the older state, leading to conflicting edits.

To test this — try to open the same record in two sessions, edit in one, then act on the other without refreshing.

We should design a “this has changed” banner with a refresh or merge actions rather than silently overwriting the tab, which can be jarring.

Stale data banner presented to the end user. Source: Python org.
Stale data banner presented to the end user. Source: Python org.

3. Input-Driven

Focus states

Keyboard-only users can’t tell what’s in focus. Focus can get trapped or lost when opening / closing modals or menus.

Try unplugging the mouse and navigate the entire flow with Tab / Shift+Tab / Enter / Space / Escape only.

Design a visible, high-contrast focus ring as a first-class state for every interactive element (don’t rely on browser defaults, but don’t remove it completely either).

Focus states, notice how they’re not the browser defaults. Source: GOV.UK.
Focus states, notice how they’re not the browser defaults. Source: GOV.UK.

Disabled / readonly variations

Disabled and readonly states might look identical, or aren’t visually distinguishable enough from enabled states, this can confuse users about why they can’t interact with some elements.

Try Placing a disabled, readonly, and enabled version of the same component side by side, or next to a simliar looking component, and see if a new user can tell them apart without any documentation (for example a primary disabled button next to an enabled secondary button).

Give the disabled and readonly states a distinct, documented visual treatment (for example: disabled = grayed + no cursor change. Readonly = normal color + lock icon).

Input fields in different states, notice how read-only look. Source: MUI.
Input fields in different states, notice how read-only look. Source: MUI.

Rapid / repeated input

Users might double-click a submit button and it shouldn’t fire duplicate requests (double charge, duplicate record, etc.), spamming a button or rapid resize / scroll causes jank or race conditions.

Try rapidly double-click and triple-click every button, hold down a resize handle and drag erratically, scroll-flick a long list repeatedly.

Show an immediate disabled / loading / read-only state on the button or input field the instant it was clicked.

A button that change its state to “loading” when clicked. Source: Loading.io.
A button that change its state to “loading” when clicked. Source: Loading.io.

Copy-paste

A pasted text can carry unexpected formatting, emojis, or control characters that break layout, validation, or storage.

Try to copy rich text from a Word doc or a webpage and paste it into every text input or text area. Paste emoji-heavy text and right-to-left text. Paste a string with null bytes or control characters.

Decide whether inputs even should accept formatting (a rich text field) or strip it (a plain text field) and be consistent per field type or style.

4. Layout / Responsive

Extreme viewport sizes

Very narrow screens (folded phones, for example) or very wide monitors (ultrawide, 3440px+) can break layouts designed for a “typical” resolution range.

Resize the browser window to its minimum and to full ultrawide width, you can use devtools device emulation for specific devices or screen sizes.

Design with min-width / max-width content in mind, don’t let a single-column layout stretch to a full-width column on an ultrawide display. Don’t let content collapse below a usable minimum either.

Extreme small-width display, notice the centered content isn’t centered anymore. Source: Apple.
Extreme small-width display, notice the centered content isn’t centered anymore. Source: Apple.

Zoom levels

Try zoom the browser to 200% or use OS text-scaling to break the layout, this can create overlapping texts and cut-off buttons.

Zoom browser to 200% (a WCAG requirement) and navigate the full flow. Increase or decrease OS-level text size setting.

Design with relative units in mind so text scaling doesn’t require pixel-perfect fixed layouts, otherwise near-sighted users may be unable to use your website.

Same website at 100% and 200%, notice how no element stays small. Source: GitHub.
Same website at 100% and 200%, notice how no element stays small. Source: GitHub.

Dynamic content changing dimensions

A component resizing based on content (for example: an accordion, a comment with a long reply) can push neighboring elements around unexpectedly, causing a layout shift.

Try to trigger the resize (expand accordion, load async content, change dynamic content) and watch for neighboring elements jumping, you can also check Lighthouse’s Cumulative Layout Shift score.

To accomodate this, please reserve space or use smooth height transitions rather than instant jumps. Consider whether the expanding element should overlay instead of pushing the content.

Expanding accordions example. Source: GOV.UK.
Expanding accordions example. Source: GOV.UK.

Nested scroll containers

Scroll-within-scroll creates ambiguous scroll targeting (users might scroll the page when they meant scrolling the inner panel, or vice versa).

Sticky elements can overlap or conflict, horizontally-scrollable components (carousels, tables) nested in a vertically-scrolling page can hijack diagonal trackpad / touch gestures, or unintentionally introduce page-level horizontal scrolling if content overflows without being contained.

We can scroll with our cursor at the boundary between inner and outer scrolling areas. We can test using a trackpad, a mouse wheel, and touch input separately (they can behave differently).

Also check for an unexpected horizontal scrollbar on the page itself by resizing the viewport narrower than the widest nested element.

Minimize nested scroll where possible. If necessary, give the inner scroll area a clear visual boundary so users can know which scroll will be captured. Avoid mixing scroll axes in adjacent / nested regions where possible.

Nested scrolls, notice what happens when a user scroll the sidebar to the end. Source: Tailwind.
Nested scrolls, notice what happens when a user scroll the sidebar to the end. Source: Tailwind.

Safe areas

Take into consideration notches, browser chrome, and virtual keyboards covering content or inputs, especially on mobile.

Test on an actual notched device (or simulator) in both orientations, also focus a text input near the bottom of the screen and check if the keyboard covers it or shifting the view to reveal it.

Try to keep critical content and actions out of the extreme edges. Design for a keyboard-visible state on forms when possible.

The importance of testing on a real device. Source: WebKit.
The importance of testing on a real device. Source: WebKit.

5. System / Environment

Dark mode / forced-colors / high contrast

Custom-styled components (checkboxes, radio buttons, focus rings) lose their custom styling or become invisible in forced-colors / high-contrast modes. Dark mode might reveal hardcoded colors that don’t adapt.

Toggle OS-level dark mode and Windows High Contrast Mode. Test with devtools prefers-color-scheme: dark / light.

Define a full dark-mode palette (not just an inverted light mode) and verify contrast ratios in both modes.

A dark-mode made with custom colors. Source: GitHub Docs.
A dark-mode made with custom colors. Source: GitHub Docs.

Reduced motion preference

Some users have stated preference for reduced motion and they still get full animations, which can cause discomfort or eye strain.

Try to enable “Reduce Motion” in OS accessibility settings and revisit all animated interactions in your site, does it still animate or do you see a fallback instead?

We should design a reduced-motion variant for key animations like cross-fading instead of slides and zooms, or instant state changes instead of complex movement.

AirPods Pro 3 animation, default on the left and reduced motion on the right. Source: Apple.
AirPods Pro 3 animation, default on the left and reduced motion on the right. Source: Apple.

Font-loading flash (FOUT / FOIT)

FOUT is the Flash of unstyled text and FOIT is the Flash of invisible text, both can happen while custom web fonts load, often times with a layout shift when the font swaps.

Throttle your network in devtools and reload the page. Compare fallback font metrics to the final font. Lighthouse flags font-display issues and layout shift from font swap.

We can try and choose a fallback font with similar x-height / width to the custom font to minimize the layout shift, or we can choose to hide the text itself until the font loads.

Same website before the font loads and after. Source: GOV.UK.
Same website before the font loads and after. Source: GOV.UK.

Offline / flaky connectivity

When a user is on a flaky network, the app might appear frozen or throws unhandled errors when the network drops or is intermittent.

Please use the devtools to simulate “Offline” mid-session. Use a network-throttling proxy to simulate packet loss or a flaky connection.

Design an offline banner / indicator and, if feasible, an offline-capable mode (view cached data, queue actions, local host etc).

YouTube’s “offline mode”, to be fair it can still play downloaded videos. Source: YouTube.
YouTube’s “offline mode”, to be fair it can still play downloaded videos. Source: YouTube.

Closing thoughts

I hope this list can be the bare-minimum standard of UI edge cases that are checked and taken care of, from localization to error states to offline mode, there’s no reason to leave them out anymore.

Next year I’m sure we’ll have more edge cases that will pop up once those are already fixed, I have high hopes for this industry that with the emergence of AI the standard for good software will only get higher.

If this list made you, or your AI, spit out more usable code or a better thought out product overall, please share this article online.

Thanks for reading, and I’d love to hear your experience in the comments, also if I missed any edge cases — please tell me and I’ll roll it into the next version of this article.

Sources

Apple Human Interface Guidelines — Patterns
Thinking like a developer, part II: design the edge cases
Edge Cases in UX/UI Explained
UX Edge Cases
Designing for Edge Cases: UX That Works When Things Go Wrong
20 Edge Case Examples in Software That Product Teams Miss


UI edge cases: A reference guide was originally published in UX Collective on Medium, where people are continuing the conversation by highlighting and responding to this story.

Article Categories:
Technology

Leave a Comment