🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@isoftdata/svelte-modal

Package Overview
Dependencies
Maintainers
11
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-modal

## Install

npmnpm
Version
1.4.0
Version published
Maintainers
11
Created
Source

Svelte Modal

Install

npm i @isoftdata/svelte-modal

Props

NameTypeDescriptionDefault Value
backdropClickCancelsbooleanDetermines whether clicking on the backdrop should close the modal.true
cancelButtonColorButtonColorsThe Bootstrap class to apply to the cancel button."secondary"
cancelButtonIconstringThe FontAwesome icon to display on the cancel button, without the preceeding fa-."times"
cancelButtonOutlinebooleanWhether the button should be outlined, instead of solid.false
cancelButtonTextstringThe text to display on the cancel button."Close"
cancelShownbooleanDetermines whether the cancel button is shown in the modal (This is the Cancel button at the bottom)footer.true
closeIdstringThe ID of the close button."close-modal"
closeShownbooleanDetermines whether the close button is shown in the modal (This is the X in the top right corner) header.true
confirmButtonColorButtonColorsThe Bootstrap color class to apply to the confirm button."success"
confirmButtonDisabledbooleanDetermines whether the confirm button is disabled.false
confirmButtonFormIdstringThe ID of the form to associate with the confirm button when using the "submit" button type.""
confirmButtonIconstringThe FontAwesome icon to display on the confirm button, without the preceeding fa-."check"
confirmButtonIsLoadingbooleanWhether to disable and show a spinner on the "Confirm" button.false
confirmButtonOutlinebooleanWhether the button should be outlined, instead of solid.false
confirmButtonTextstringThe text to display on the confirm button."Confirm"
confirmButtonTitlestringThe title of the confirm button""
confirmButtonType"button" | "submit" | "reset"The type of the confirm button (e.g., "button" or "submit")."button"
confirmShownbooleanDetermines whether the confirm button is shown in the modal footer.true
footerClassstringCustom CSS class to apply to the modal footer element."align-items-end"
footerShownbooleanDetermines whether the modal footer is shown.true
footerStylestringAny additional CSS styles to add to the modal footer.""
fullscreenboolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'Breakpoint to apply fullscreen from that size and down. Boolean true for all sizes. This option is only available with Bootstrap 5.false
headerShownbooleanDetermines whether the modal header is shown.true
modalBodyClassstringAdditional CSS classes to apply to the modal body element.''
modalDialogClassstringAdditional CSS classes to apply to the modal dialog element.''
modalIdstringThe ID of the modal-body element."itModal"
modalSize"sm" | "" | "lg" | "xl" | "xxl"Determines the maximum width of the modal.""
savingInProgressbooleanDetermines whether a saving operation is in progress (useful for showing a loading state on the confirm button).false
showbooleanDetermines whether the modal is currently visible or hidden. You probably want to bind: to this.false
showModalContentbooleanDetermines whether to show the modal content (header, body, and footer) or hide it (can be used for a loading state).true
subtitlestringAn optional subtitle to display below the main title.''
titlestringThe main title of the modal."Confirm"
transitionModestringThe transition mode for the modal and its content (possible values: "present", "cardMovePrevious", "cardMoveNext")."present"
zIndexnumberThe z-index of the modal element.20000

Slots

  • default - The modal body.
  • modalHeader - The modal header.
  • modalFooter - the modal footer.

Events

  • backdrop - Fired when the backdrop is clicked. event.details is the MouseEvent (mouseup) from clicking the button.
  • close - Fired when "Cancel" or "Close" button is clicked. event.details is the MouseEvent (click) from clicking the button.
  • confirm - Fired when Confirm button is clicked. event.details is the MouseEvent (click) from clicking the button.

Example

<script lang="ts">
	import Modal from '@isoftdata/svelte-modal'
</script>

<Modal
	bind:show
	on:close={() => (show = false)}
	on:confirm={() => (show = false)}
>
	Modal content goes here.
</Modal>

FAQs

Package last updated on 27 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts