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

@composy/cropper-vue

v0.0.2

Published

Vue 3 wrapper for @composy/cropper-core

Readme

@composy/cropper-vue

Vue 3 adapter for @composy/cropper-core. It exports a component, composable, directive, and plugin while keeping all rendering and image-processing behavior in the core package.

Usage

<script setup lang="ts">
import { Cropper } from '@composy/cropper-vue'
import '@composy/cropper-vue/style.css'
</script>

<template>
  <Cropper
    src="/images/photo.jpg"
    ratio="16:9"
    crop-box-style="rounded"
    output-format="blob"
    :style-vars="{
      'color-accent': 'var(--ld-primary-500)',
      'toolbar-button-size': 'var(--ld-px-16)',
    }"
  />
</template>

Load the global LDesign color and size token styles before the cropper stylesheet. The Vue stylesheet imports the core cropper CSS.

Component

<Cropper /> accepts the core cropper options as props, plus Vue-friendly props:

  • src / v-model for image source.
  • ratio for named aspect ratios: free, square, 4:3, 3:4, 16:9, 9:16, 2:1, 1:2, 3:2, 2:3.
  • outputFormat, outputType, outputQuality, maxOutputWidth, maxOutputHeight for export result handling.
  • themeColor and styleVars for tokenized runtime styling.

Exposed methods include getCropper(), crop(), getCroppedResult(), getCroppedCanvas(), replace(), reset(), clear(), rotateLeft(), rotateRight(), flipH(), flipV(), zoomIn(), zoomOut(), setZoom(), setAspectRatio(), setStyle(), setDragMode(), setOptions(), getSnapshot(), restoreSnapshot(), getOperationGraph(), applyOperationGraph(), clearOperationGraph(), download(), and copyToClipboard().

Composable

import { ASPECT_RATIOS, useCropper } from '@composy/cropper-vue'
import { ref } from 'vue'

const containerRef = ref<HTMLElement>()
useCropper(containerRef, {
  src: '/images/photo.jpg',
  aspectRatio: ASPECT_RATIOS.square,
  autoInit: true,
})

The composable forwards the same snapshot and operation graph methods as the Core instance, so draft persistence does not require a second Vue-side state model.

Directive

<template>
  <div
    v-cropper="{
      src: '/images/photo.jpg',
      aspectRatio: 1,
      styleVars: { 'color-accent': 'var(--ld-primary-500)' },
      onReady: cropper => console.log(cropper),
    }"
  />
</template>

Use getCropperInstance(el) to retrieve the directive-owned core instance.

Class And Token Contract

The Vue wrapper root class is ldesign-cropper-vue. Core runtime classes use the ldesign-cropper* namespace. Styling is controlled by component variables with the --ldesign-cropper-* prefix, backed by generated --ld-* color and size tokens.

Build Outputs

The package uses @composy/builder and emits:

  • dist/index.js, dist/index.min.js, dist/index.css, dist/style.css
  • es/index.js
  • esm/index.js
  • lib/index.cjs

Run locally:

corepack pnpm --dir packages/vue run type-check
corepack pnpm --dir packages/vue run type-check:cjs
corepack pnpm --dir packages/vue run build

Builder, TypeScript, and ESLint authority configs live in .ldesign/; the package-root config files remain compatibility entry points.