# nuxt-excalidraw

> Nuxt Excalidraw allow you to use the amazing React library Excalidraw inside your Nuxt 3 application.

Latest version **1.0.0-beta.0** (published 2023-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install nuxt-excalidraw
pnpm add nuxt-excalidraw
yarn add nuxt-excalidraw
bun add nuxt-excalidraw
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.0 |
| Published | 2023-11-15 |
| First published | 2023-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^19.8.1 |
| Dependencies | 5 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Angelo Schuler Piletti |
| Maintainers | angelo_schpil |

## Links

- npm: https://www.npmjs.com/package/nuxt-excalidraw
- Repository: https://github.com/AngeloSchulerPiletti/nuxt-excalidraw
- Homepage: https://github.com/AngeloSchulerPiletti/nuxt-excalidraw#readme
- Issues: https://github.com/AngeloSchulerPiletti/nuxt-excalidraw/issues
- npm.io page: https://npm.io/package/nuxt-excalidraw

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^18.2.0
- [@nuxt/kit](https://npm.io/package/@nuxt/kit.md) ^3.8.1
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [@vitejs/plugin-react](https://npm.io/package/@vitejs/plugin-react.md) ^4.1.1
- [@excalidraw/excalidraw](https://npm.io/package/@excalidraw/excalidraw.md) ^0.17.0

## Recent versions

- 1.0.0-beta.0 (latest) — 2023-11-15
- 1.0.0-beta.7 (beta) — 2023-11-15
- 1.0.0-beta.6 — 2023-11-15
- 1.0.0-beta.5 — 2023-11-15
- 1.0.0-beta.4 — 2023-11-15
- 1.0.0-beta.3 — 2023-11-15
- 1.0.0-beta.2 — 2023-11-15
- 1.0.0-beta.1 — 2023-11-15

## README

<h1 align="center">Nuxt Excalidraw</h1>

<br/>

<p align="center">
  <a href="https://npmjs.com/package/nuxt-excalidraw">
    <img alt="Nuxt Excalidraw is released under the MIT license." src="https://img.shields.io/npm/v/nuxt-excalidraw/latest.svg?style=flat&colorA=18181B&colorB=28CF8D"  />
  </a>
  <a href="https://npmjs.com/package/nuxt-excalidraw">
    <img alt="Nuxt Excalidraw is released under the MIT license." src="https://img.shields.io/badge/license-MIT-blue.svg"  />
  </a>
  <a href="https://npmjs.com/package/nuxt-excalidraw">
    <img alt="npm downloads/month" src="https://img.shields.io/npm/dm/nuxt-excalidraw.svg?style=flat&colorA=18181B&colorB=28CF8D"  />
  </a>
    <img alt="PRs welcome!" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat"  />
</p>

<div align="center">
  <figure>
    <a href="https://excalidraw.com" target="_blank" rel="noopener">
      <img src="https://excalidraw.nyc3.cdn.digitaloceanspaces.com/github%2Fproduct_showcase.png" alt="Product showcase" />
    </a>
    <figcaption>
      <p align="center">
        Add the amazing <a hrer="https://github.com/excalidraw/excalidraw">Excalidraw</a> on your Nuxt 3 project.
      </p>
    </figcaption>
  </figure>
</div>

<h4><a href="https://excalidraw.com" target="_blank" rel="noopener">▶️ See Excalidraw demo</a></h4>

<br/>

## 📌 Features

You can use following APIs:

- ✅ [Props](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/)
- 🚧 [Children Components](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/children-components)
- 🚧 [Utils](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/utils)
- 🚧 [Constants](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/constants)
- 🚧 [Creating Elements programmatically](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/excalidraw-element-skeleton)

Feel free to contribute and get in touch.

## ⚡ Quick Setup

Add `nuxt-excalidraw` dependency to your project

```bash
# Using pnpm
pnpm add -D nuxt-excalidraw

# Using yarn
yarn add --dev nuxt-excalidraw

# Using npm
npm install --save-dev nuxt-excalidraw
```

Add `nuxt-excalidraw` to the `modules` section of `nuxt.config.ts`

```js
export default defineNuxtConfig({
  modules: [
    'nuxt-excalidraw',
    // other modules
  ]
})
```

🪶 No configuration is necessary

## 👣 Usage

The module injects a component called `ExcalidrawBoard` in your NuxtApp.

The basicest use of it is:

```vue
<script setup lang="ts">
</script>

<template>
  <div>
    <ClientOnly>
      <ExcalidrawBoard />
    </ClientOnly>
  </div>
</template>
```

It is important that you load the component once browser APIs are available.

### Using Props

If you want to use, for example, Excalidraw props [`initialData`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/initialdata) and [`onChange`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/#onchange), you can do it as following:

```vue
<script setup lang="ts">
import type { ExcalidrawElement } from '@excalidraw/excalidraw/types/element/types'
import type { AppState, BinaryFiles } from '@excalidraw/excalidraw/types/types'

function myCallback(
  elements: readonly ExcalidrawElement[],
  appState: AppState,
  files: BinaryFiles,
) {
  // Do something cool here...
}

const initialDataFromMyService = useMyService().data
</script>

<template>
  <div>
    <ClientOnly>
      <ExcalidrawBoard
        :on-change="myCallback"
        :initial-data="initialDataFromMyService"
      />
    </ClientOnly>
  </div>
</template>
```

<br/>

- [✨ Release Notes](/CHANGELOG.md)
- [🤝 Contributing](/CONTRIBUTING.md)

---
_Source: https://npm.io/package/nuxt-excalidraw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
