sdxc

Type to search, or start from one of these:

[ @sdxc/ui/animations ]

slide

A fade paired with a directional offset, entering from just off one edge of its resting position and exiting back toward it.

import { slide } from "@sdxc/ui/animations";

Signature

slide(options: Slide.Options): CSSMixinDescriptor

Returns a css() mixin ready for a host element's mix prop.

Parameters

ParameterTypeDescription
optionsSlide.OptionsWhich 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>;

The events, constants and types its module publishes, each imported from @sdxc/ui/animations too.

Interface

Slide.Options

MemberTypeDescription
fromFrom
distance?stringHow far the exit state is offset along that edge. Defaults to "0.5rem".
opacity?numberExit-state opacity (0 to 1). Defaults to 0.
duration?numberTransition duration in milliseconds. Defaults to durations.normal.
easing?stringA transition-timing-function value. Defaults to easings.standard.
when?stringA 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"

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.