Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

solid-flip

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solid-flip

The most advanced Flip animation library for Solid.js inspired by react-flip-toolkit

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by1.12%
Maintainers
0
Weekly downloads
 
Created
Source

solid-flip

The most advanced Flip animation library for Solid.js inspired by react-flip-toolkit

Feature

  • 🚀 Fully typed with TypeScript
  • 🫙 Zero dependency
  • ✅ Support Solid.js
  • ✅ Support nested flip
  • 📦 Support scale animation without children

Installation

pnpm add solid-flip

or with npm

npm install solid-flip

Quick Start

  1. Wrap your root component with FlipProvider
    import { FlipProvider } from 'solid-flip';
    
    const root = document.getElementById('root');
    
    render(() => (
      <FlipProvider> // Like this
        <App/>
      </FlipProvider>
    ), root!);
    
  2. Use Flip component to wrap your animated component
    import { Flip } from 'solid-flip';
    
    <Flip id={'my-flip-id'}> // `id` property need to be unique
      <div class={'show'}>Animated content</div>
    </Flip>
    
  3. Change the content of Flip component
    import { Flip } from 'solid-flip';
    
    const [show, setShow] = createSignal(false);
    
    <Show
      when={show()}
      fallback={
        <Flip id={'my-flip-id'}>
          <div class={'hidden'}>Animated content</div>
        </Flip>
      }
    >
      <Flip id={'my-flip-id'}>
        <div class={'show'}>Animated content</div>
      </Flip>
    </Show>
    
    or
    import { Flip } from 'solid-flip';
    
    const [show, setShow] = createSignal(false);
    
    <Flip id={'my-flip-id'} with={show()}> // set `with` property that will be used to determine whether the content should be animated
      <div class={show() ? 'show' : 'hidden'}>Animated content</div>
    </Flip>
    

End! You have successfully added flip animation to your component!

Example

Please check the example folder or codesandbox for more details. (TODO)

Usage

Flip

TODO

Unflip

TODO

Keywords

FAQs

Package last updated on 25 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc