Effects Fancy Stable

Presence

Mounts and unmounts content with a real entrance and exit through one direction-aware Svelte transition, tracking opening/open/closing state, marking the panel inert while it closes, and firing lifecycle callbacks

Preview

Installation

pnpm add fancy-ui-svelte
import { Presence } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { Presence } from 'fancy-ui-svelte';
</script>

<Presence />

Examples

Basic Usage

Presets

Switch between the entrance/exit looks.

Props

PropTypeDefaultDescription
open *boolean-Whether the content is mounted and, once the entrance settles, visible
preset "fade" | "fade-up" | "fade-down" | "fade-left" | "fade-right" | "scale" | "blur" | "zoom""fade"The entrance/exit look
duration number300Entrance duration in ms
exitDuration number200Exit duration in ms — shorter than the entrance by default; leaving reads faster than arriving
delay number0Delay in ms before the entrance starts; applied to the exit too
distance number16Entrance travel distance in px for the four directional presets — the exit travels half as far
inert booleantrueWhether the panel is inert while closing (Svelte already does this natively for any transitioning element — false is an explicit opt-out)
onEnterEnd () => void-Fires once the entrance transition settles (onintroend)
onExitEnd () => void-Fires once the exit transition settles (onoutroend) — not guaranteed if the component is destroyed mid-exit
class string-Additional CSS classes, merged onto the root
ref HTMLDivElement | nullnullBindable reference to the root element — null while closed

Slots

SlotDescription
childrenPanel content