# Trigger reveal animations manually

> Play a reveal animation from your own state with the when option, replay it, hide content with hidden, and play the entrance of clipped content by hand.

By default, the viewport controls the entrance. The [`when`](/reference/options/#when) option of React, Vue and Astro gives the control to your own state. `@awesome-reveal/core` does not have `when`.

## Reveal from your state

Set `when` to `true` to reveal the element, and to `false` to reset the entrance. A reset has no exit animation. With no value or `null`, the viewport controls the entrance. A change from `true` to `null` keeps the element revealed.

In this example, a button shows and hides the details:

In Astro, the `when` prop sets the value in the server HTML. In a client script, pass the rendered tag to [`getReveal`](/reference/astro/#getreveal), and set the `when` property of the result.

A change to `when` applies immediately. If `when` becomes `false` during the [`delay`](/guides/timing/#delay-the-entrance), the entrance resets and does not play.

## Play the entrance again

The entrance plays one time. To play it again, set `when` to `false`, then to `true`.

## Hide the content

`when` does not show or hide content. With `false`, the element is transparent, but screen readers read it, and the keyboard can focus its controls. To hide content, also set [`hidden`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/hidden), or do not render it. The example above sets `hidden`.

[`inert`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/inert) does not hide content. It only blocks focus, clicks and assistive technology.

Reduced motion has priority over `when`. If the user asks for [reduced motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion), the element reveals, also when `when` is `false`.

For focus in an element with `when` set to `false`, see [Accessibility](/concepts/accessibility/#focus).

## Play clipped content by hand

If an ancestor with `overflow` clips the element fully, the element does not reveal. An example is a carousel slide that its track clips. In React, Vue and Astro, set `when` to `true` when the slide becomes visible.

`@awesome-reveal/core` has no manual trigger. To play a waiting entrance, play the paused animations of the element:

```js
import { reveal } from "@awesome-reveal/core";

reveal(".slide", { from: "left" });

export function playEntrance(slide) {
  for (const animation of slide.getAnimations()) {
    if (animation.playState === "paused") animation.play();
  }
}
```

For a cascade, call [`getAnimations({ subtree: true })`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations) on the container. The loop also plays your own paused animations of the element.
