How would you architect an application to support multiple devices
Responsive, mobile-first design with fluid layouts and breakpoints; a shared component library; adaptive (not just responsive) where capability differs; progressive enhancement; touch + pointer + keyboard input; performance budgets for low-end devices; and decide native vs web vs PWA per requirements.
"Multiple devices" spans phones, tablets, desktops, maybe TVs/watches — varying in screen size, input method, capability, and network. The architecture handles all four axes.
1. Responsive, mobile-first layout
- Mobile-first CSS — design for the smallest screen, layer enhancements up via
min-widthmedia queries. - Fluid layouts — flexbox/grid, relative units (
rem,%,fr,clamp()), not fixed pixels. - Breakpoints driven by content, not specific devices.
- Responsive images (
srcset/<picture>), fluid typography.
2. Responsive vs adaptive — know the difference
- Responsive — one layout that flexes to any size. The default.
- Adaptive — different layouts/components for different device classes when they genuinely diverge (a complex desktop data table vs. a mobile card list — the same component squished doesn't work). Use adaptive where the UX should differ, responsive everywhere else.
3. A shared component library
A design system of components that are themselves responsive and accessible. Build once, compose per device. This is the core of not maintaining N codebases.
4. Input methods, not just screen size
Devices differ in input: touch, mouse, keyboard, stylus, remote, voice. Design for all — adequate touch targets (~44px), hover that doesn't break on touch (@media (hover: hover)), full keyboard navigation, pointer events that cover mouse + touch + pen.
5. Capability & performance — progressive enhancement
- Progressive enhancement — a baseline that works everywhere, enhanced where supported (
@supports, feature detection). - Performance budgets for the low end — low-end phones on slow networks are the constraint, not your dev machine. Code splitting, lazy loading, smaller bundles, image optimization.
- Adaptive loading — optionally serve lighter experiences on low-end devices / save-data.
6. The platform decision
Decide deliberately: responsive web, PWA (installable, offline — one codebase, near-native), or native (deepest OS integration). Or web + native sharing a logic layer. Drive it by requirements (offline? device APIs? app-store reach?), not fashion.
7. Architecture & testing
- Shared logic layer (data, business rules) reused across surfaces.
- Test on real devices across the matrix, not just browser resize.
The framing
"Devices vary on four axes — size, input, capability, network — so I'd architect for all four. Mobile-first responsive layouts with fluid units and content-driven breakpoints as the baseline; adaptive — genuinely different components — only where the UX should diverge, like a desktop table vs a mobile card list. A shared responsive, accessible component library so it's one codebase, not N. Design for every input method, not just width — touch targets, keyboard nav, hover guards. Progressive enhancement plus performance budgets aimed at low-end devices. And a deliberate web/PWA/native decision driven by requirements, with a shared logic layer underneath."
Follow-up questions
- •What's the difference between responsive and adaptive design?
- •Why design for input method, not just screen size?
- •When would you choose a PWA over native?
- •How do you ensure good performance on low-end devices?
Common mistakes
- •Treating it as only a CSS/breakpoint problem, ignoring input and capability.
- •Desktop-first, then trying to cram into mobile.
- •Squishing a desktop component into mobile instead of an adaptive layout where needed.
- •Testing only via browser resize, not real devices.
- •Budgeting performance for a dev machine, not a low-end phone.
Performance considerations
- •Low-end devices on slow networks set the performance ceiling — bundle size, code splitting, image optimization, and adaptive loading matter most there. Responsive images avoid shipping desktop-sized assets to phones.
Edge cases
- •Foldables and unusual aspect ratios.
- •Touch + mouse hybrid devices.
- •Very large screens (TVs) and very small (watches).
- •Offline / intermittent connectivity.
Real-world examples
- •A design system powering responsive web + a PWA from one component library.
- •Adaptive layouts: a data grid on desktop becoming a card list on mobile.