Modal component for Svelte
Features:
npm install modal-svelte
<script>
import Modal from 'modal-svelte'
</script>
<Modal title="Hello world!" onCancel={() => (open = false)}>
<p>Content</p>
</Modal>
This shows all available functionality
<Modal
title="Hello world!"
onCancel={() => (open = false)}
form={() => submitMyForm()}
noEscapeHandling
noCloseIcon
class="w-full"
>
<p>Content</p>
<input />
<!-- If you want to bring focus to a specific element -->
<input autofocus />
<div slot="buttons">
<button type="submit">Submit</button>
</div>
</Modal>
:root {
--modal-bg: #fff;
color: #000;
}
npm install
npm run dev
: Start in dev modenpm run build
: Buildnpm run lint
: Lintnpm run format
: FormatCHANGELOG.md
npm run lint
npm version --no-git-tag <version>
npm run build:package
npm publish