---
area: "Learn"
parent: "Learn"
url: "https://unpoly.com/learn/start/overview"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [Learn](https://unpoly.com/learn.md)</nav>

# How Unpoly works

Unpoly lets your links and forms update fragments of the current page, instead of loading full new documents. Screens update without a full page load and keep their state. Your app stays on the server, rendering HTML with any language and any framework.

<nav aria-label="Contents">

#### Contents

- [Updating fragments](#updating-fragments)
- [The server stays in charge](#the-server-stays-in-charge)
- [Strong defaults](#strong-defaults)
- [Your first thirty minutes](#your-first-thirty-minutes)

</nav>

## Updating fragments {#updating-fragments}

Here is a link enhanced with an Unpoly attribute:

```html
<a href="/messages" up-target=".messages">Messages</a>
```

When the user clicks, Unpoly fetches `/messages` without leaving the page. Your server handles the request like any other, and responds with a full HTML page. Unpoly extracts the `.messages` fragment from the response and swaps it into the current page.

The rest of the page is left untouched: scroll positions, focus, unsaved form fields and running scripts **all survive the update**.

[Diagram: How Unpoly uses a server response](https://unpoly.com/learn/start/overview#fragment-updates-diagram)

Three requests, each shown across four columns. The server always responds with a complete page. Unpoly uses only the fragments that changed, leaving the rest of the screen in place. A server may optionally respond with those fragments alone.

Because the server renders full pages, each screen remains a page of its own. When the user opens the link in a new tab, or when JavaScript is unavailable, the browser makes a regular full page load.

## The server stays in charge {#the-server-stays-in-charge}

To your backend, requests from Unpoly **look like any browser request**. There is no JSON API to build and no client-side templates to maintain. You keep rendering HTML on the server, with the routes and templates you already have.

You also don't need separate fragment endpoints: Unpoly takes the fragment it needs and discards the rest of the response. A server [can choose](https://unpoly.com/learn/optimizing-responses.md) to render only the requested fragment, but that is an optional optimization. Most screens never need it.

## Strong defaults {#strong-defaults}

When a link or form updates the main fragment of the page, Unpoly treats the interaction as a [navigation](https://unpoly.com/learn/navigation-defaults.md) and **mimics what a full page load would have done**:

- The browser URL and history are updated, so the Back button keeps working.
- The page scrolls to the top, as after a full page load.
- Focus moves to the new fragment, so keyboard and screen reader users don't get lost.
- Responses to links are [cached](https://unpoly.com/learn/caching.md) and revalidated, so revisits render instantly.

Each of these defaults can be changed, per element or globally.

## Your first thirty minutes {#your-first-thirty-minutes}

The rest of this chapter is hands-on. After [installing Unpoly](https://unpoly.com/learn/install.md), you will make one basic move in each area:

- [Link to a fragment](https://unpoly.com/learn/start/links.md): Enhance a link to update a fragment.
- [Submit a form](https://unpoly.com/learn/start/forms.md): Submit a form in place and show validation errors.
- [Open an overlay](https://unpoly.com/learn/start/overlays.md): Open an existing screen in a modal overlay.
- [Enhance an element](https://unpoly.com/learn/start/elements.md): Pair your own JavaScript with HTML elements.

You will then learn [the shape of the API](https://unpoly.com/learn/start/api.md): one pattern that all of Unpoly's features follow. Each step works on its own, so you can stop after any of them.

<nav aria-label="In this chapter">

## In this chapter {#children-index-title}

- [Installation](https://unpoly.com/learn/install.md)
- [Link to a fragment](https://unpoly.com/learn/start/links.md)
- [Submit a form](https://unpoly.com/learn/start/forms.md)
- [Open an overlay](https://unpoly.com/learn/start/overlays.md)
- [Enhance an element](https://unpoly.com/learn/start/elements.md)
- [The shape of the API](https://unpoly.com/learn/start/api.md)
- [Where to go from here](https://unpoly.com/learn/start/next.md)

</nav>

<nav aria-label="Reading order">

- [Next: Installation](https://unpoly.com/learn/install.md)

</nav>

