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

# The shape of the API

Most of Unpoly's features share one shape: the common case is an HTML attribute, the same feature is also available as a JavaScript function, and its defaults can be changed through a global configuration. Learn the pattern once, and every feature in the reference will look familiar.

## Every attribute has a JavaScript counterpart {#javascript-counterparts}

The quickest way is an attribute in your HTML. This link swaps the [main fragment](https://unpoly.com/api/main.md) with an animated transition:

```html
<a href="/path" up-follow up-transition="cross-fade">Click me</a>
```

The same feature exists as a JavaScript function, for when your own code triggers the behavior. Attributes become camel-cased options:

```js
up.follow(link, { transition: 'cross-fade' })
```

When your whole app should behave that way, set a configuration default instead of repeating the attribute:

```js
up.fragment.config.navigateOptions.transition = 'cross-fade'
```

All three **set the same option**. They differ in scope: one element, one call, or every navigation in your app.

<nav aria-label="Reading order">

- [Previous: Enhance an element](https://unpoly.com/learn/start/elements.md)
- [Next: Where to go from here](https://unpoly.com/learn/start/next.md)

</nav>

