Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The most advanced Flip animation library for Solid.js inspired by react-flip-toolkit
The most advanced Flip animation library for Solid.js inspired by react-flip-toolkit
enter
, exit
properties in Flip
onEnter
, onExit
properties in Flip
pnpm add solid-flip
or with npm
npm install solid-flip
FlipProvider
import { FlipProvider } from 'solid-flip';
const root = document.getElementById('root');
render(() => (
<FlipProvider> // Like this
<App/>
</FlipProvider>
), root!);
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>
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 when the content should be animated
<div class={show() ? 'show' : 'hidden'}>Animated content</div>
</Flip>
End! You have successfully added flip animation to your component!
Please check the example folder or codesandbox for more details.
<Flip id={'flip2'} with={flip2()}>
<div class={flip2() ? 'card blue fullscreen' : 'card red'} onClick={() => setFlip2(!flip2())}>
<Unflip>
<div>
{flip2() ? 'Click Again!' : 'Click!'}
</div>
</Unflip>
</div>
</Flip>
<div class={'grid'}>
<For each={flip5()}>
{(item) => (
<Flip id={`flip5-${item}`} with={flip5()}>
<div class={'card'}>
{item}
</div>
</Flip>
)}
</For>
</div>
<div class={'grid'}>
<For each={flip6()}>
{(item) => (
<Flip id={`flip6-group-${item.id}`} with={flip6()}>
<div class={'card grid'}>
<For each={item.items}>
{(subItem) => (
<Flip id={`flip6-${subItem}`} with={flip6()}>
<div class={'card'}>
{subItem}
</div>
</Flip>
)}
</For>
</div>
</Flip>
)}
</For>
</div>
FlipProvider
component is used to wrap the root component of your application. It provides the context for the flip animation.
If you don't wrap your root component with FlipProvider
, the flip animation will not work.
Property | Type | Default | Description |
---|---|---|---|
defaultConfig | FlipConfig | - | The default configuration of the flip animation. If you set the value in Flip component, it will be overridden. |
interface FlipConfig {
duration?: number;
easing?: string;
enter?: string | boolean;
exit?: string | boolean;
preserve?: false | 'position' | 'scale' | 'all';
}
See Flip
component for more details.
import { FlipProvider } from 'solid-flip';
const root = document.getElementById('root');
render(() => (
<FlipProvider>
<App/>
</FlipProvider>
), root!);
Flip
component is used to wrap the content that you want to animate. It directly passes children.
Property | Type | Default | Description |
---|---|---|---|
id* | string | (required) | The unique id of the flip component |
with | unknown | unknown[] | [] | The condition to determine when the content should be animated |
duration | number | 300 | The duration of the animation |
easing | string | 'ease' | The easing of the animation |
properties | string | string[] | [] | The additional properties that will be animated |
enter | string | boolean | false | If this value is truthy, The element will be animate when the element is inserted. The value means the initial class name of the element. If you set this value as true , entering class name will be set as enter |
exit | string | boolean | false | If this value is truthy, The element will be animate when the element is removed. The value means the class name of the element after element removed. If you set this value as true , exiting class name will be set as exit |
preserve | false | 'position' | 'scale' | 'all' | false | This value manipulates the element's style when the element runs in 'enter' or 'exit'. If you set this value as position , the element will be use the value when the element is connected to DOM. So that It prevent the element moving to 'enter' or 'exit' position. It will be useful when you set the 'exit' animation's position as absolute or fixed. 'scale' and 'all' also act like 'position'. |
import { Flip } from 'solid-flip';
<Flip id={'my-flip-id'} with={flip()}>
<div class={flip() ? 'show' : 'hidden'}>Animated content</div>
</Flip>
Unflip
component is used to warp the content that ignore parent flip animation. It directly passes children.
Property | Type | Default | Description |
---|---|---|---|
id | string | - | A parent id that ignore flip animation |
import { Unflip } from 'solid-flip';
<Flip id={'my-flip-id'}>
<div>
Animated content
<Unflip> // id is not required. Unflip component will find the parent flip component automatically.
<div>Ignore flip animation</div>
</Unflip>
</div>
</Flip>
FAQs
The most advanced Flip animation library for Solid.js inspired by react-flip-toolkit
The npm package solid-flip receives a total of 1,017 weekly downloads. As such, solid-flip popularity was classified as popular.
We found that solid-flip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.