Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@oku-ui/motion
Advanced tools
Package | Version | Downloads |
---|---|---|
Vue | ||
Nuxt |
A tiny, performant animation library for VueJS. Powered by Motion One.
Motion One for Vue is a 5kb animation library for Vue 3. Built on Motion One, it's capable of springs, independent transforms, and hardware accelerated animations.
By the end of this quick guide, you'll have installed Motion One for Vue and created your first animation.
Motion One for VueJS can be installed via npm:
npm install @oku-ui/motion
# or
pnpm add @oku-ui/motion
# or
yarn add @oku-ui/motion
Motion One for NuxtJS can be installed via npm:
npm install @oku-ui/motion-nuxt
# or
pnpm add @oku-ui/motion-nuxt
# or
yarn add @oku-ui/motion-nuxt
Import the Motion component and register it in your Vue component:
<script setup lang="ts">
import { Motion } from "@oku-ui/motion"
</script>
<template>
<Motion />
</template>
The Motion
component can be used to create an animatable HTML or SVG element. By default, it will render a div
element:
<script setup lang="ts">
import { Motion } from "motion/vue"
</script>
<template>
<Motion />
</template>
<style scoped>
div {
width: 100px;
height: 100px;
border-radius: 10px;
background-color: var(--splash);
}
</style>
Edit the above example by adding an animate prop:
<Motion :animate="{ rotate: 90, backgroundColor: 'var(--yellow)' }" />
Every time a value in animate changes, perhaps from component data or props, the component will automatically animate to the latest values.
We can change the type of animation used by passing a transition
prop.
<Motion
:animate="{ rotate: 90, backgroundColor: 'var(--yellow)' }"
:transition="{ duration: 1, easing: 'ease-in-out' }"
/>
By default transition options are applied to all values, but we can also override on a per-value basis:
<Motion
:animate="{ rotate: 90, backgroundColor: 'var(--yellow)' }"
:transition="{
duration: 1,
rotate: { duration: 2 },
}"
/>
Values can also be set as arrays, to define a series of keyframes.
<Motion :animate="{ x: [0, 100, 50] }" />
By default, keyframes are spaced evenly throughout duration
, but this can be adjusted by providing progress values to offset
:
<Motion
:animate="{ x: [0, 100, 50] }"
:transition="{ x: { offset: [0, 0.25, 1] } }"
/>
Elements will automatically animate
to the values defined in animate when they're created.
This can be disabled by setting the initial
prop to false
. The styles defined in animate
will be applied immediately when the element is first created.
<Motion :initial="false" :animate="{ x: 100 }" />
When an element is removed with v-show
or v-if
it can be animated out with the Presence component and the exit prop:
<script setup lang="ts">
import { Motion, Presence } from "motion/vue"
const show = ref(true)
</script>
<template>
<div class="container">
<Presence>
<Motion
v-show="show"
:initial="{ opacity: 0, scale: 0 }"
:animate="{ opacity: 1, scale: 1 }"
:exit="{ opacity: 0, scale: 0.6 }"
class="box"
/>
</Presence>
<button @click="show = !show">
Toggle
</button>
</div>
</template>
<style>
.container {
width: 100px;
height: 150px;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.container button {
cursor: pointer;
}
.box {
width: 100px;
height: 100px;
border-radius: 10px;
background-color: var(--splash);
}
</style>
exit
can be provided a transition
of its own, that override the component's transition
:
<Motion
v-show="isVisible"
:animate="{ opacity: 1 }"
:exit="{ opacity: 0, transition: { duration: 0.8 } }"
:transition="transition"
/>
FAQs
A tiny, performant animation library for VueJS
We found that @oku-ui/motion demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.