Layout
Transition
A <div> with ready-made Alpine enter and leave transitions, for content shown with x-show: fade, zoom, slide in any direction. The popovers, menus, dropdowns and toasts use it for their animation.
Nothing to show
The paragraph fades in over half a second when the button is clicked, and fades out faster when it is clicked again.
Sliding #
The alert slides down a short distance, half its height, as it fades in, and back up when it leaves; slide-down-full brings it from fully above its place.
Nothing to show
Default animation #
Without animation, content shown with x-show grows in from half its size, and shrinks back when hidden. Click the button to toggle it.
Nothing to show
Animations #
animation picks the effect: fade, zoom, slide-up, slide-down, slide-left, slide-right, the same with -full for the whole height or width, or none.
Nothing to show
Slide from the position #
slide comes from the side given by the data-position of an ancestor with the group class, as popovers and toasts use it.
Nothing to show
Bound to Livewire #
x-show can read a Livewire property through $wire, so the server state drives the transition.
Nothing to show
Customization #
Classes and attributes, x-show included, go to the <div>.
Nothing to show
Reference
tk:transition
| Prop | Type | Default | Description |
|---|---|---|---|
animation |
string | scale | fade; zoom; slide, which comes from the side given by the data-position of an ancestor group; slide-up, slide-down, slide-left, slide-right (a short distance) and the same with -full (the whole height or width); none for no transition. By default it grows from half its size. |
Slots
| Slot | Description |
|---|---|
| default | The content. |
Customization
Classes and attributes, x-show included, go to the <div>.
Accessibility
Only the appearance changes; showing and hiding is up to x-show. Tailwind's motion-reduce: variants are not added, so for large movements consider animation="fade" for users who prefer reduced motion.