npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yoyoo-ddr/vue

v2.1.1

Published

Lightweight and no dependencies, use draggable, resizable, rotatable, configurable for Vue 3 component

Readme

@yoyoo-ddr/vue

Vue 3 component for DDR — Draggable, Resizable, Rotatable. Built on top of @yoyoo-ddr/core.

NPM Version

Install

npm i @yoyoo-ddr/vue --save

@yoyoo-ddr/core is included as a dependency — no need to install it separately.

Quick Start

JSX (recommended)

import DDR from '@yoyoo-ddr/vue'
import type { TransformProps } from '@yoyoo-ddr/vue'
import '@yoyoo-ddr/vue/dist/style.css'
import { defineComponent, ref } from 'vue'

export default defineComponent({
  setup() {
    const t = ref<TransformProps>({
      x: 100, y: 100, width: 100, height: 100, rotation: 0,
    })

    return () => (
      <div style={{ width: '100%', height: '100%' }}>
        <DDR
          v-model:value={t.value}
          parent={true}
          grid={[10, 10]}
          minWidth={20}
          minHeight={20}
          onDragstart={(e, transform) => console.log('drag start', transform)}
        >
          <div style={{ width: '100%', height: '100%', background: 'red' }} />
        </DDR>
      </div>
    )
  },
})

SFC (Single File Component)

<template>
  <div style="width: 100%; height: 100%">
    <DDR
      v-model:value="transform"
      :parent="true"
      :grid="[10, 10]"
      :minWidth="20"
      :minHeight="20"
      @dragstart="onDragStart"
    >
      <div :style="{ width: '100%', height: '100%', background: 'red' }" />
    </DDR>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import DDR from '@yoyoo-ddr/vue'
import type { TransformProps } from '@yoyoo-ddr/vue'
import '@yoyoo-ddr/vue/dist/style.css'

const transform = ref<TransformProps>({
  x: 100, y: 100, width: 100, height: 100, rotation: 0,
})

const onDragStart = (e: MouseEvent, t: TransformProps) => {
  console.log('drag start', t)
}
</script>

v-model:value

The component uses v-model:value to keep position/size/rotation in sync:

const t = ref<TransformProps>({ x: 0, y: 0, width: 100, height: 100, rotation: 0 })

<DDR v-model:value={t.value} />
// t.value updates automatically on drag / resize / rotate

Props

All props are optional. Props match DDRCoreConfig from @yoyoo-ddr/core.

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | TransformProps | { x:0, y:0, width:100, height:100, rotation:0 } | Controlled position / size / rotation (use with v-model:value) | | active | boolean | true | Whether interaction is enabled | | draggable | boolean | true | Enable drag | | resizable | boolean | true | Enable resize | | rotatable | boolean | true | Enable rotation | | resizeHandler | string[] | ['tl','tm','tr','r','br','bm','bl','l'] | Visible resize handle positions | | handlerSize | number | 11 | Resize handle size in px | | acceptRatio | boolean | false | Lock aspect ratio (hold Shift to toggle) | | minWidth | number | 1 | Minimum width | | minHeight | number | 1 | Minimum height | | maxWidth | number | 1000000 | Maximum width | | maxHeight | number | 1000000 | Maximum height | | parent | boolean | false | Constrain to parent bounds | | grid | [number, number] | [1, 1] | Grid snap [x, y] | | axis | 'x' 'y' 'xy' | 'xy' | Restrict drag axis | | zoom | number | 1 | Parent scale factor (for transform: scale()) | | useCSSTransform | boolean | false | Use transform: translate() for sub-pixel smoothness | | transformOrigin | [number, number] | [0, 0] | Parent transform-origin in px | | stop | boolean | true | Stop event propagation | | prevent | boolean | true | Prevent default events | | beforeActive | () => boolean | () => false | Guard before interaction; return true to allow |

Events

Each event receives (event: MouseEvent, transform: TransformProps).

| Event | Description | |-------|-------------| | dragstart | Drag started | | drag | Dragging | | dragend | Drag ended | | resizestart | Resize started | | resize | Resizing | | resizeend | Resize ended | | rotatestart | Rotate started | | rotate | Rotating | | rotateend | Rotate ended | | change | Fires on every interaction tick (drag/resize/rotate move) |

Re-exports from Core

For convenience, @yoyoo-ddr/vue re-exports core types and the DDRCore class:

import type { TransformProps, DDRCoreConfig, HanlderType } from '@yoyoo-ddr/vue'
import { DDRCore } from '@yoyoo-ddr/vue'
import type { DDRProps, DDREvents } from '@yoyoo-ddr/vue'

CSS State Classes

| Class | Description | |-------|-------------| | yoyoo-ddr | Wrapper (always present) | | active | Component is active | | ddr-ready-drag | Ready to drag | | ddr-dragging | Dragging | | ddr-ready-resize | Ready to resize | | ddr-resizing | Resizing | | ddr-ready-rotate | Ready to rotate | | ddr-rotating | Rotating |

License

MIT