Skip to Content
Neshel-UI
Animations (experimental)Reference

@neshel-ui/animations/press

Every export of @neshel-ui/animations/press, generated from its declarations.

Experimental and not on npm

@neshel-ui/animations is a private package (0.0.0). It cannot be installed, and its API may change before a first publication. These pages document what exists in the repository.

Signatures, members and defaults, generated from the built declarations. For explanations and examples read the guide.

  • CheckboxDraw component

    Decorative checkbox glyph (aria-hidden SVG) that draws its check mark. Mirror a native checkbox.

    ({ checked, indeterminate, duration, easing, reducedMotion, className, ref, ...rest }: CheckboxDrawProps): Element
  • ContentSwap component

    Cross-fades two contents in place. The inactive one is `hidden` (correct without CSS or JavaScript); with `press.css` the swap fades and slides (opacity only under reduced motion).

    ({ active, children, confirm, live, reducedMotion, className, ref, ...rest }: ContentSwapProps): Element
  • LongPress component

    P11 `<LongPress>`: hold to activate, with a progress layer (`press.css`). Usually `asChild` on your own `<button>`; describe the hold in its label or nearby text, and keep a non-timed path for destructive actions.

    (props: LongPressProps): Element
  • NumberTick component

    A number that counts to each new value. The counting copy is aria-hidden and written without React renders; assistive technologies read a visually hidden copy with the final value.

    ({ value, format, locale, formatOptions, duration, easing, reducedMotion, live, className, ref, ...rest }: NumberTickProps): Element
  • Press component

    `<Press>`: press & microinteraction effects on a `<div>` or, with `asChild`, your own element.

    <Options, Resolved>(props: PressProps<Options, Resolved>): Element
  • ToggleMorph component

    Decorative switch track and thumb (aria-hidden). Use inside a native control, e.g. `<button role="switch" aria-checked={on}>` or a `<label>` with an `<input type="checkbox" role="switch">`.

    ({ checked, spring, stretch, reducedMotion, className, ref, ...rest }: ToggleMorphProps): Element
  • burst const
    Readonly<EffectDefinition<BurstOptions, ResolvedBurst>>
  • checkboxDraw const
    Readonly<EffectDefinition<CheckboxDrawOptions, ResolvedCheckboxDraw>>
  • contentSwap const
    Readonly<EffectDefinition<ContentSwapOptions, { reducedMotion: ReducedMotion; }>>
  • longPress const
    Readonly<EffectDefinition<LongPressOptions, ResolvedLongPress>>
  • nudge const
    Readonly<EffectDefinition<NudgeOptions, ResolvedNudge>>
  • numberTick const
    Readonly<EffectDefinition<NumberTickOptions, ResolvedNumberTick>>
  • pressEffects const

    Every press definition in catalogue order (P01–P11), for explicit registries.

    readonly AnyEffectDefinition[]
  • pressScale const
    Readonly<EffectDefinition<PressScaleOptions, ResolvedPressScale>>
  • ripple const
    Readonly<EffectDefinition<RippleOptions, ResolvedRipple>>
  • shake const
    Readonly<EffectDefinition<ShakeOptions, ResolvedShake>>
  • tapBounce const
    Readonly<EffectDefinition<TapBounceOptions, ResolvedTapBounce>>
  • toggleMorph const
    Readonly<EffectDefinition<ToggleMorphOptions, ResolvedToggleMorph>>
  • BurstOptions interface

    BurstOptions

    P06 — Burst: particles radiate from the centre on an owned layer when trigger changes.

    BurstOptions
    PropTypeDefaultDescription
    colorsreadonly string[]—Particle colours, cycled (default theme-friendly warm colours).
    countnumber—Number of particles (3–24, default 10).
    disabledboolean—Turn the effect off. Disabled elements (:disabled, aria-disabled="true") never react.
    distancenumber—Travel distance in px (8–160, default 34).
    durationnumber—Duration in ms (200–3000, default 650).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    sizenumber—Particle size in px (2–16, default 6).
    triggerstring | number | boolean—Change this value (a counter, a timestamp) to play the effect. The initial value never plays.
  • CheckboxDrawOptions interface

    CheckboxDrawOptions

    CheckboxDrawOptions
    PropTypeDefaultDescription
    checked(required)boolean | "indeterminate"—Current state (mirror your checkbox).
    durationnumber | "fast" | "normal" | "slow" | "deliberate"240Draw duration in ms or preset (default 240).
    easingEasing | EasingPreset——
    reducedMotionReducedMotion——
  • CheckboxDrawProps interface

    CheckboxDrawProps

    CheckboxDrawProps
    PropTypeDefaultDescription
    checked(required)boolean——
    durationnumber | "fast" | "normal" | "slow" | "deliberate"240Draw duration in ms or preset (default 240).
    easingEasing | EasingPreset——
    indeterminateboolean——
    reducedMotionReducedMotion——
    refRef<SVGSVGElement>——

    Also accepts the props of: React DOM attributes.

  • ContentSwapOptions interface

    ContentSwapOptions

    ContentSwapOptions
    PropTypeDefaultDescription
    reducedMotionReducedMotion——
  • ContentSwapProps interface

    ContentSwapProps

    ContentSwapProps
    PropTypeDefaultDescription
    active(required)boolean—Show confirm instead of children (e.g. copied).
    children(required)ReactNode—Content while idle (e.g. "Copy").
    confirm(required)ReactNode—Content while active (e.g. "Copied ✓").
    live"off" | "polite""off"Announce the new content politely when it changes (default "off").
    reducedMotionReducedMotion——
    refRef<HTMLSpanElement>——

    Also accepts the props of: React DOM attributes.

  • LongPressOptions interface

    LongPressOptions

    LongPressOptions
    PropTypeDefaultDescription
    disabledboolean——
    durationnumber—Hold time in ms (200–5000, default 600).
    keyboard"hold" | "press"—Keyboard: hold Space/Enter for the duration ("hold", default) or activate on one press ("press").
    moveTolerancenumber—px of pointer movement that cancels (2–50, default 10).
    onCancel() => void—Called when a started press ends without completing.
    onLongPress(source: "pointer" | "keyboard") => void—Called once per completed long press.
    pointerTypesreadonly ("mouse" | "pen" | "touch")[]—Pointer types that may long-press (default mouse, pen and touch).
    reducedMotionReducedMotion"user"Reduced motion keeps a linear, non-vestibular fill (the progress conveys state). Default "user".
  • LongPressProps interface

    LongPressProps

    LongPressProps
    PropTypeDefaultDescription
    asChildboolean—Apply the effects to the single child element instead of rendering a <div>.
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    disabledboolean——
    durationnumber—Hold time in ms (200–5000, default 600).
    keyboard"hold" | "press"—Keyboard: hold Space/Enter for the duration ("hold", default) or activate on one press ("press").
    moveTolerancenumber—px of pointer movement that cancels (2–50, default 10).
    onCancel() => void—Called when a started press ends without completing.
    onLongPress(source: "pointer" | "keyboard") => void—Called once per completed long press.
    pointerTypesLongPressOptions["pointerTypes"]——
    reducedMotionReducedMotion"user"Reduced motion keeps a linear, non-vestibular fill (the progress conveys state). Default "user".
    refRef<HTMLDivElement>——

    Also accepts the props of: React DOM attributes.

  • NudgeOptions interface

    NudgeOptions

    P08 — Nudge / attention jiggle: a short rotation wiggle, optionally repeated a few times.

    NudgeOptions
    PropTypeDefaultDescription
    anglenumber—Amplitude in degrees (1–20, default 6).
    cyclesnumber—Oscillations (1–6, default 3).
    disabledboolean—Turn the effect off. Disabled elements (:disabled, aria-disabled="true") never react.
    durationnumber—Duration in ms (100–2000, default 600).
    intervalnumber—Pause between plays in ms (1000–10000, default 2500).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    repeatnumber—Extra plays after the first (0–3, default 0); never more than 4 plays in total (WCAG 2.2.2).
    triggerstring | number | boolean—Change this value (a counter, a timestamp) to play the effect. The initial value never plays.
  • NumberTickOptions interface

    NumberTickOptions

    NumberTickOptions
    PropTypeDefaultDescription
    durationnumber | "fast" | "normal" | "slow" | "deliberate"600Count duration in ms or preset (default 600).
    easingEasing | EasingPreset——
    format(value: number) => stringIntl.NumberFormat(locale, formatOptions)Formats the displayed number (default Intl.NumberFormat(locale, formatOptions)).
    formatOptionsIntl.NumberFormatOptions——
    localestring"en-US"Locale of the default formatter (default "en-US", explicit so server and client agree).
    reducedMotionReducedMotion——
    value(required)number——
  • NumberTickProps interface

    NumberTickProps

    NumberTickProps
    PropTypeDefaultDescription
    durationnumber | "fast" | "normal" | "slow" | "deliberate"600Count duration in ms or preset (default 600).
    easingEasing | EasingPreset——
    format(value: number) => stringIntl.NumberFormat(locale, formatOptions)Formats the displayed number (default Intl.NumberFormat(locale, formatOptions)).
    formatOptionsIntl.NumberFormatOptions——
    live"off" | "polite""off"Announce changes politely (default "off"). Announcements carry the final value once per change, never per frame.
    localestring"en-US"Locale of the default formatter (default "en-US", explicit so server and client agree).
    reducedMotionReducedMotion——
    refRef<HTMLSpanElement>——
    value(required)number——

    Also accepts the props of: React DOM attributes.

  • PressOptions interface

    PressOptions

    Options shared by press effects.

    PressOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off. Disabled elements (:disabled, aria-disabled="true") never react.
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
  • PressScaleOptions interface

    PressScaleOptions

    P01 — Press scale: shrink while pressed, spring back on release (pointer, Space/Enter).

    PressScaleOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off. Disabled elements (:disabled, aria-disabled="true") never react.
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    scalenumber—Scale while pressed (0.5–1, default 0.96). Reduced motion keeps half the amplitude, without spring.
    springSpringOptions | SpringPreset——
  • RippleOptions interface

    RippleOptions

    P02 — Ripple: an expanding circle from the press point on a clipped, owned layer.

    RippleOptions
    PropTypeDefaultDescription
    colorstringcurrentColorRipple colour (default currentColor).
    disabledboolean—Turn the effect off. Disabled elements (:disabled, aria-disabled="true") never react.
    durationnumber—Expansion duration in ms (100–3000, default 550).
    opacitynumber—Ripple opacity (0–1, default 0.22).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
  • ShakeOptions interface

    ShakeOptions

    P07 — Shake (error): a short damped horizontal shake. Never the only error signal.

    ShakeOptions
    PropTypeDefaultDescription
    cyclesnumber—Oscillations (1–8, default 4).
    disabledboolean—Turn the effect off. Disabled elements (:disabled, aria-disabled="true") never react.
    distancenumber—Amplitude in px (1–30, default 8). Reduced motion: a third, fewer cycles.
    durationnumber—Duration in ms (100–2000, default 420).
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    triggerstring | number | boolean—Change this value (a counter, a timestamp) to play the effect. The initial value never plays.
  • TapBounceOptions interface

    TapBounceOptions

    P03 — Tap bounce: a springy squash after each activation (click, including keyboard).

    TapBounceOptions
    PropTypeDefaultDescription
    disabledboolean—Turn the effect off. Disabled elements (:disabled, aria-disabled="true") never react.
    reducedMotionReducedMotion"user"Reduced-motion policy (default "user").
    springSpringOptions | SpringPreset"bouncy"Spring (default "bouncy").
    strengthnumber—Impulse strength (0–1, default 0.3).
  • ToggleMorphOptions interface

    ToggleMorphOptions

    ToggleMorphOptions
    PropTypeDefaultDescription
    checked(required)boolean—Current state (mirror your switch's checked / aria-checked).
    reducedMotionReducedMotion——
    springSpringOptions | SpringPreset"snappy"Thumb spring (default "snappy").
    stretchnumber—Peak stretch of the thumb mid-travel (0–0.6, default 0.3).
  • ToggleMorphProps interface

    ToggleMorphProps

    ToggleMorphProps
    PropTypeDefaultDescription
    checked(required)boolean—Mirror of your switch's state.
    reducedMotionReducedMotion——
    refRef<HTMLSpanElement>——
    springSpringOptions | "gentle" | "snappy" | "bouncy"——
    stretchnumber—Peak thumb stretch mid-travel (0–0.6, default 0.3).

    Also accepts the props of: React DOM attributes.

  • TriggerOptions interface

    TriggerOptions

    trigger handling: plays when the value changes after attachment.

    TriggerOptions
    PropTypeDefaultDescription
    triggerstring | number | boolean—Change this value (a counter, a timestamp) to play the effect. The initial value never plays.
  • PressProps type

    PressProps

    PressProps
    PropTypeDefaultDescription
    asChildboolean—Apply the effects to the single child element instead of rendering a <div>.
    childrenReactNode——
    conflictsConflictPolicy—Conflict reporting for exclusive channels (default: warn in development).
    optionsundefined | NoInfer<Partial<Options>>——
    preset(required)readonly PresetInput<any, any>[] | PresetInput<Options, Resolved>——
    refRef<HTMLDivElement>——

    Also accepts the props of: React DOM attributes.

Edit on GitHub