New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@slithy/modal-spring

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slithy/modal-spring

React Spring animation adapter for @slithy/modal-kit.

latest
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

@slithy/modal-spring

Animated modal adapter for @slithy/modal-kit, built on react-spring and @use-gesture/react.

Provides animated enter/leave transitions, an animated backdrop, and drag-to-close gesture support.

Installation

pnpm add @slithy/modal-core @slithy/modal-kit @slithy/modal-spring
pnpm add "@react-spring/web@>=9 <10" @use-gesture/react

@react-spring/web (v9.x) and @use-gesture/react are peer dependencies. react-spring v10 is not yet supported.

Setup

import { LayerProvider, LayerStackPriority } from '@slithy/layers'
import { Portal } from '@slithy/portal'
import { ModalRenderer } from '@slithy/modal-spring'

export function App() {
  return (
    <LayerProvider id="app" zIndex={LayerStackPriority.Base}>
      <main>{/* your app */}</main>
      <ModalRenderer
        renderLayer={(children) => (
          <LayerProvider id="modal" zIndex={LayerStackPriority.Modal}>
            {children}
          </LayerProvider>
        )}
        renderPortal={(children) => <Portal>{children}</Portal>}
      />
    </LayerProvider>
  )
}

renderLayer and renderPortal are optional — omit them if you don't use @slithy/layers or @slithy/portal.

Usage

import { useModalStore } from '@slithy/modal-core'
import { Modal } from '@slithy/modal-spring'

function MyButton() {
  const open = (event: React.MouseEvent) => {
    useModalStore.getState().openModal(
      <Modal aria-label="My Modal">
        <p>Content</p>
      </Modal>,
      { triggerEvent: event }
    )
  }
  return <button onClick={open}>Open</button>
}

Modal Props

PropTypeDefaultDescription
aria-labelstringAccessible name for the dialog
alignX'center' | 'left' | 'right''center'Horizontal position
alignY'middle' | 'top' | 'bottom''middle'Vertical position
dismissiblebooleantrueAllow Escape and backdrop-click to close
contentClassNamestringClass on the <dialog> element
contentStyleCSSPropertiesStatic styles on the <dialog> element
contentTransitions{ from, enter, leave }Spring transition values
disableOpacityTransitionbooleanSkip the default opacity fade
dragDirectionDragDirectionEnable drag-to-close
containerScrollingbooleantrueAllow container scroll
layerIsActivebooleantruePass from useLayerState for layer coordination
springConfigSpringConfigOverride the default spring config
afterOpen() => voidFires after enter animation completes
afterClose() => voidFires after modal is removed

Exports

ExportDescription
ModalAnimated modal component
ModalProps
ModalRendererRenders all open modals with animated backdrop
ModalBackdropAnimated backdrop (used by ModalRenderer)
DragHandleDrag-to-close gesture wrapper
useModalDragLow-level drag hook
useModalDraggingInternal drag spring hook
defaultSpringDefault spring config
iosSheetSpringiOS-feel spring config
DragDirection'up' | 'down' | 'left' | 'right'
DragStylesSpring transform values from drag

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts