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-drawsh
pnpm add leafer-drawsh
yarn add leafer-drawsh
bun add leafer-drawWe 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.1.0/dist/web.min.js"></script>
<script>
const { Leafer } = LeaferUI
// ...
</script>html
<script src="https://unpkg.com/leafer-draw@2.1.0/dist/web.js"></script>
<script>
const { Leafer } = LeaferUI
// ...
</script>html
<script type="module">
import { Leafer } from 'https://unpkg.com/leafer-draw@2.1.0/dist/web.module.min.js'
// ...
</script>html
<script type="module">
import { Leafer } from 'https://unpkg.com/leafer-draw@2.1.0/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.