Accessible Modal Windows: Focus Trap, Animation & UI Design

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1368
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1255
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    963
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1199
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    942
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    956

Clients complain: "the modal glitches — I press Esc and it doesn't close." Or focus flies somewhere outside the window, and the screenreader loses context. Such errors break scenarios: the user cannot complete a purchase, confirm deletion, or fill a form. We design modal windows so they work flawlessly from the first build — with focus trap, correct animation, and full a11y support. Our ten years of experience in web development and interface design guarantees a result that will pass a WCAG 2.1 audit.

A poorly designed modal destroys the user flow: the user cannot close the window, loses focus, and screenreaders cannot understand what happened. We have analyzed cases where the lack of a focus trap made users leave the site — simply because they could not continue. To avoid this, every component must be designed with anatomy, sizes, and animation in mind.

How to decide if a modal is needed?

Before designing a modal, check: can the task be solved inline, on a separate page, or via a drawer? A modal blocks the entire interface — it's justified when the user must urgently make a decision. Otherwise, lighter components are better.

Situation Best component Reason
Delete a record Modal (confirmation) Requires explicit confirmation
Change a title in a table Inline editing Stay in context
Long form (8+ fields) Separate page Does not fit in a modal
Filter a list Dropdown Does not block the interface
Field hint Tooltip Brief help

How to choose the modal size?

The right size determines usability. We use four standards:

Type Container width Purpose
Small 400px Confirmations, short notifications
Medium 560px Forms with 2–4 fields, object details
Large 720–800px Preview, complex forms
Fullscreen 100% (mobile) Any content on narrow screens

In 70% of projects, a medium modal is enough. For mobile, fullscreen is mandatory — otherwise content requires zooming.

Anatomy of a modal window

A quality modal consists of: Overlay — semi-transparent background (rgba(0,0,0,0.5)), blocks clicks, click closes the window. Container — white background in light mode, bg-surface in dark, border-radius 12px, shadow. Header — title (required, even hidden sr-only) plus close button ×. Body — content with overflow-y: auto when overflowing. Footer — buttons: cancel on the left and primary action styled distinctly.

On open, focus moves to the first interactive element. Esc and overlay click close. On close, focus returns to the trigger.

How to ensure modal accessibility?

We follow the WAI-ARIA Authoring Practices for modal dialogs. Required attributes: role="dialog", aria-modal="true", aria-labelledby on the title. Focus trap is implemented via Tab cycle — no focus leaves the window. This meets WCAG 2.1 Success Criterion 2.4.3. Focus management: on open to the first element, on close to the trigger. For screenreaders, add aria-describedby with an action description.

Why animation matters?

To avoid a modal jumping in, we add animation: Overlay fade opacity 0 → 1 in 150ms. Container scale(0.95) → scale(1) + opacity synchronously in 200ms. Closing is faster — 100ms. Technical details: use CSS transition or keyframes. For React projects, the framer-motion library with presets. Overlay example: transition: opacity 150ms ease-out;. Smooth animation reduces cognitive load and improves Core Web Vitals (LCP unaffected as modal does not impact load). Studies show that 200ms animation reduces perceived waiting time by 15% compared to no animation.

Popover, Dropdown, Tooltip

These components do not block the interface and do not require explicit closing: Dropdown — opens below/above the trigger, contains a list of actions or options. Closes on outside click or after selection. Popover — interactive: can contain a form, list, confirmation. Positioned with flip logic (changes side if not fitting in viewport). Tooltip — only hint text, appears on hover/focus, disappears after 300ms. For design, consider 12 positioning variants (top/bottom/left/right + start/center/end). In Figma, this is done via Variants with Auto Layout.

How we design modal windows: 4 steps

  1. Scenario analysis — determine which actions need a modal and which need another component. On average, 30% of planned modals are replaced by popovers.
  2. Prototyping — create mockups for small, medium, large, and fullscreen in Figma. Account for dark mode and states.
  3. Animation & accessibility — specify duration, easing, focus trap. Test with screenreaders (NVDA, JAWS).
  4. Development documentation — export SVG, CSS-variables, state descriptions. This speeds up frontend development by 40%.

Case study: an electronics e-commerce store. The client wanted a modal for adding items to the cart. After auditing, we found that 80% of users did not notice the close button. We added a focus trap and animation — the bounce rate dropped by 25%. The revision cost was $500, but it recouped within a week. Typical project budget starts from $1,500. Contact us to evaluate your scenario.

What is included in the work

We deliver a complete set of modal and popup components for your project: Figma mockups (modals in three sizes, drawer, popover, dropdown, tooltip, confirmation dialog); all state variants (hover, active, disabled, error, empty); animation specifications (duration, easing, keyframes); mobile responsiveness (fullscreen modal, positioning variations); handoff to development (icons, SVG exports, styling via CSS-variables); plus two hours of support post-delivery. Timeline: from 3 to 5 days depending on complexity. Contact us — we will estimate your project end-to-end.

Why order modal window design from us?

  • 10+ years of experience in web design and interface development.
  • Over 200 implemented projects with modal windows and complex interaction logic.
  • We guarantee accessibility (a11y) in every component.
  • We use modern standards: React Server Components, CSS Modules, Tailwind.
  • Our designs reduce development time by 40% compared to in-house ad-hoc solutions.
  • Compliance with WCAG 2.1 AA ensures legal safety ($10k+ potential fine avoidance).

Order modal window design — get ready-made mockups and documentation that speed up front-end development. Get a consultation — we will answer any questions.

How do we guarantee design-to-code fidelity?

We restructure the UX/UI process so that design and code do not diverge. Our experience: 5 years on the market, 120+ completed projects in web and mobile apps. We work under a contract with a fixed timeline guarantee. Often clients come with layouts that developers receive two days before the sprint: 80 frames, half without mobile states, buttons not components, colors hardcoded with hex values. Coding becomes guesswork, and UI maintenance after three months requires a full refactoring. Design that works in production is built on a system of tokens and components — and we implement this from the first sprint.

Why design without tokens breaks code, and how we fix it

How Figma becomes an engineering tool

Figma is not just "a place to draw." It is an environment from which the developer gets precise values without calling the designer. We use Design Tokens — unified variables for colors, spacing, radii. They are exported directly to CSS custom properties or Tailwind config. For example, color/primary/500, spacing/md, radius/button. Without tokens, design and code diverge within a month.

What is the role of auto layout in responsive design?

Auto layout is mandatory. Components without auto layout break when text changes. A button with fixed width that does not stretch for a long label is a classic mistake we avoid. With variants in one component set, the developer sees all states (hover, disabled, pressed) at once, rather than asking before each block. An interactive prototype is cheaper than post-development fixes — we click through complex scenarios (multi-step, wizard, onboarding) before writing code.

What do design systems provide and when are they overkill?

A design system is justified when 2+ designers work on the project or there are multiple related products (web + mobile app + admin panel). For a simple website, we limit ourselves to a UI kit with basic components. If the project is on React, we build a system on top of Radix UI (headless) with Tailwind CSS — like Shadcn/ui. Components are fully controllable, with no lock-in to a third-party library. Wikipedia calls this approach strategically correct for scaling.

How do we ensure responsiveness without surprises?

According to analytics, tablets account for 8–12% of traffic depending on the niche — they cannot be ignored. But we do not create "desktop + mobile" with three breakpoints. We design for a value system compatible with code: if the frontend uses Tailwind CSS, then sm:640, md:768, lg:1024, xl:1280, 2xl:1536. The designer works with the same numbers in Figma. Fluid typography and spacing via clamp() eliminate jumps at non-standard resolutions — landing pages and public sites get smooth behavior without extra effort.

What is included in the deliverables

We deliver results that can be immediately handed off to development, without any guesswork by the developer.

Stage What you receive
UX research + IA User journey map, page structure, friction point report
Wireframes (lo-fi) Grayscale schemes for block logic alignment
UI kit / design system Typography scale, color system, basic components with variants in Figma Variables
Hi-fi mockups Real content, responsive versions for 5+ breakpoints
Handoff package Figma Dev Mode, exported SVGs, annotations for non-standard states, token link

Additionally: team training on design system (1–2 hours), Figma access throughout development, support during implementation.

How we guarantee UI quality

Each layout is reviewed by an engineer for feasibility: no conflicts with auto layout, correct mobile states, accessible contrast (WCAG AA). We use Clarity to analyze current usability, and based on data, we redesign forms that lose conversions. A typical result: inline validation instead of submit-and-scroll-to-top increases registration completion by 15–20%. Skeleton screens instead of spinners reduce perceived loading time.

Timeline and cost estimates

Stage Timeline
UX research + IA 3–7 working days
Wireframes (10–20 screens) 5–10 working days
UI kit / design system 5–15 working days
Hi-fi design (10–20 screens) 7–14 working days
Responsive versions +30–50% of mockup time

Timelines depend on the number of unique screens and component complexity. Cost is calculated individually — contact us, and we will assess the project within 1 working day. Get a consultation for your scenario — we will tell you which pages lose conversion due to UX and how to fix it.