slide
A fade paired with a directional offset, entering from just off one edge of its resting position and exiting half that distance back toward it, so leaving reads quieter than arriving.
import { slide } from "@sdxc/ui/animations";Signature
slide(options: Slide.Options): CSSMixinDescriptorReturns a css() mixin ready for a host element's mix prop.
Parameters
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
options | Slide.Options | — | Yes | Which edge to travel from, the offset distance, opacity, timing, and entered-state selector. |
Examples
<dialog id="cart-drawer" mix={slide({ from: "right", duration: durations.slow })}>
...
</dialog>;Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/animations too.
Interface
Slide.Options
| Member | Type | Default | Required | Description |
|---|---|---|---|---|
from | From | — | Yes | |
distance | string | — | No | How far off its resting position the host enters from. Defaults to "0.5rem"; the exit travels half of it. |
blur | number | — | No | Blur radius in pixels the host softens from and to while it travels. |
opacity | number | — | No | Exit-state opacity (0 to 1). Defaults to 0. |
duration | number | — | No | Transition duration in milliseconds. Defaults to durations.normal. |
easing | string | — | No | A transition-timing-function value. Defaults to easings.standard. |
when | string | — | No | A selector fragment overriding the default [open]/:popover-open entered state. |
Type
Slide.From
Which edge the host travels in from (and back out toward on exit).
type Slide.From = "top" | "right" | "bottom" | "left"