Skip to content

How to use animate-out? #57

@brunobely

Description

@brunobely

Should I be somehow hiding the element myself or does tw-animate-css do that for me? Based on the advanced usage example in the readme I didn't think I needed to hide it:

<div
  class="data-[state=show]:animate-in data-[state=hide]:animate-out fade-in slide-in-from-top-8 fade-out slide-out-to-top-8 duration-500"
  data-state="show"
>

But when I do that the div stays on screen, is that supposed to happen? If I add data-[state=hide]:hidden then it doesn't animate out as it hides before it has time to animate.

Tailwind Playground

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions