SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

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.

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

Signature

typescript
slide(options: Slide.Options): CSSMixinDescriptor

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

Parameters

ParameterTypeDefaultRequiredDescription
optionsSlide.Options—YesWhich edge to travel from, the offset distance, opacity, timing, and entered-state selector.

Examples

tsx
<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

MemberTypeDefaultRequiredDescription
fromFrom—Yes
distancestring—NoHow far off its resting position the host enters from. Defaults to "0.5rem"; the exit travels half of it.
blurnumber—NoBlur radius in pixels the host softens from and to while it travels.
opacitynumber—NoExit-state opacity (0 to 1). Defaults to 0.
durationnumber—NoTransition duration in milliseconds. Defaults to durations.normal.
easingstring—NoA transition-timing-function value. Defaults to easings.standard.
whenstring—NoA 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).

typescript
type Slide.From = "top" | "right" | "bottom" | "left"
@sdxc/ui

Can’t find it? Contact us