Skip to content

leafer-draw ​

Compared to leafer-ui, this package reduces features such as App and event interactions, making it suitable for pure drawing scenarios (58KB min+gzip).

​

web version     worker version     node version     mini program version ​

​

Runs in a Web environment and is adapted for mobile devices.

Installation ​

sh
npm install leafer-draw
sh
pnpm add leafer-draw
sh
yarn add leafer-draw
sh
bun add leafer-draw

We also provide a Playground environment and a create-leafer CLI tool to help you quickly try the official examples.

Or import via script tag ​

html
<script src="https://unpkg.com/leafer-draw@2.3.1/dist/web.min.js"></script>
<script>
  const { Leafer } = LeaferUI
  // ...
</script>
html
<script src="https://unpkg.com/leafer-draw@2.3.1/dist/web.js"></script>
<script>
  const { Leafer } = LeaferUI
  // ...
</script>
html
<script type="module">
  import { Leafer } from 'https://unpkg.com/leafer-draw@2.3.1/dist/web.module.min.js'
  // ...
</script>
html
<script type="module">
  import { Leafer } from 'https://unpkg.com/leafer-draw@2.3.1/dist/web.module.js'
  // ...
</script>

Update ​

Learn how to quickly update versions.

Usage ​

The usage, global variables, and leafer-ui are consistent. You only need to change the package name to run the official example code.

create-leafer CLI tool ​

Directly create a Vue + Leafer project ​

Quickly integrate Leafer into an existing project ​

Install or upgrade plugins in your project ​

Playground environment ​

If you want to run official example code directly, you can use the Playground environment. ​

Released under the MIT License.