---
name: "up.Layer.prototype.peel"
area: "API"
kind: "Instance method"
parent: "up.Layer class"
url: "https://unpoly.com/api/up.Layer.prototype.peel"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.Layer class](https://unpoly.com/api/up.Layer.md)</nav>

# up.Layer.prototype.peel([options])

[Dismisses](https://unpoly.com/api/up.Layer.prototype.dismiss.md) all descendant overlays, making this layer the [frontmost layer](https://unpoly.com/api/up.layer.front.md) in the [layer stack](https://unpoly.com/api/up.layer.stack.md).

Descendant overlays will be dismissed with value `':peel'`.

Listeners to [`up:layer:dismiss`](https://unpoly.com/api/up:layer:dismiss.md) or [`up:layer:accept`](https://unpoly.com/api/up:layer:accept.md) cannot keep a descendant overlay open.

---

## Parameters {#parameters}

### Closing {#parameters-closing}

#### [options.value=":peel"] {#options.value}

(optional)

The [result value](https://unpoly.com/learn/closing-overlays.md#result-values) for the descendant overlays.

Type: any

#### [options.intent="dismiss"] {#options.intent}

(optional)

The [close intent](https://unpoly.com/learn/closing-overlays.md#intents) for the descendant overlays.

By default descendant overlays will be dismissed.
You can pass `{ intent: "accept" }` to accept them instead.

Type: string

### Animation {#parameters-animation}

#### [options.animation] {#options.animation}

(optional)

The [animation](https://unpoly.com/api/up.animate.md) to use for closing descendant overlays.

Defaults to the close animation [configured](https://unpoly.com/api/up.layer.config.md) for the respective layer modes.

Type: string | Function([Element](https://developer.mozilla.org/en-US/docs/Web/API/Element), [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects))

#### [options.duration] {#options.duration}

(optional)

The duration for the close animation in milliseconds.

Type: number

#### [options.easing] {#options.easing}

(optional)

The [timing function](https://developer.mozilla.org/en-US/docs/Web/CSS/transition-timing-function) that controls the acceleration of the close animation.

Type: string

