carta/packages/plugin-attachment
2023-12-17 12:16:02 +01:00
..
src feat(accessibility): add label to attachment icon 2023-12-17 12:16:02 +01:00
static feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
.gitignore feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
.npmrc feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
package.json feat(accessibility): add label to attachment icon 2023-12-17 12:16:02 +01:00
README.md docs: update all READMEs 2023-11-19 19:37:48 +01:00
svelte.config.js feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
tsconfig.json feat: add plugin-attachment 2023-10-26 19:32:50 +02:00
vite.config.ts feat: add plugin-attachment 2023-10-26 19:32:50 +02:00

Carta Attachment Plugin

This plugin adds support for attachments. Install it using:

npm i @cartamd/plugin-attachment

Setup

Styles

Import the default theme, or create you own:

import '@cartamd/plugin-attachment/default.css';

Extension

<script lang="ts">
	import { Carta, CartaEditor } from 'carta-md';
	import { attachment } from '@cartamd/plugin-attachment';

	const carta = new Carta({
		extensions: [
			attachment({
				upload(file) {
					/* ... */
				}
			})
		]
	});
</script>

<CartaEditor {carta} />

Documentation

Checkout the docs for examples, options and more.