svelte-ace
v1.0.21
Published
Svelte Ace Editor component with complete TypeScript support
Downloads
1,140
Maintainers
Readme
Get proper typescript type completions for ace editor in Svelte.
Install :
npm i svelte-ace
Usage :
<script lang="ts">
import { AceEditor } from "svelte-ace";
import "brace/mode/json";
import "brace/theme/chrome";
let text = "";
</script>
<AceEditor
on:selectionChange={(obj) => console.log(obj.detail)}
on:paste={(obj) => console.log(obj.detail)}
on:input={(obj) => console.log(obj.detail)}
on:focus={() => console.log('focus')}
on:documentChange={(obj) => console.log(`document change : ${obj.detail}`)}
on:cut={() => console.log('cut')}
on:cursorChange={() => console.log('cursor change')}
on:copy={() => console.log('copy')}
on:init={(editor) => console.log(editor.detail)}
on:commandKey={(obj) => console.log(obj.detail)}
on:changeMode={(obj) => console.log(`change mode : ${obj.detail}`)}
on:blur={() => console.log('blur')}
width='100%'
height='300px'
lang="json"
theme="chrome"
value={text} />
Links :
NPM : npmjs/svelte-ace
Home : github/svelte-ace
Explore
Check out my svelte-electron-typescript starter pack.
Check out my electron-react-typescript starter pack.