Single-page application (SPA)

Definition
A single-page application, or SPA, is a type of web application that loads a single HTML page and dynamically updates content as users interact with it. Instead of reloading entire pages, SPAs use JavaScript to fetch and render only the necessary data, creating smoother and faster user experiences.
Popular examples include Gmail, Trello, and Slack. These applications behave more like desktop software than traditional websites, offering interactive, app-like functionality within a web browser.
Advanced
At an advanced level, SPAs rely on frameworks such as React, Angular, or Vue to manage state, routing, and rendering. They often use REST APIs or GraphQL to retrieve backend data without refreshing the page.
Performance considerations include client-side rendering, caching strategies, and code splitting to optimise load times. Developers must also address SEO challenges with SPAs, as search engines traditionally rely on static HTML. Server-side rendering (SSR) or static site generation (SSG) is often used to overcome indexing limitations.
Why it matters
Use cases
Metrics
Issues
Example
A startup builds a project management tool as a single-page application using React. Instead of reloading pages when creating tasks or moving cards, the interface updates instantly. This responsiveness improves user satisfaction and increases retention compared to competitors with slower, multi-page sites.