logo-icon
STW UI

Modal

Modal is used to show a dialog or a box when you click a button.

Usage

svelte
import { Modal } from 'stwui';
// OR
import Modal from 'stwui/modal'; // for tree shaking

Basic Modal

Long Content With Footer

Long Content Screen Contained

Modal Props

handleClose () => void

Modal Slots

backdrop <Modal.Backdrop slot="backdrop" />
content <Modal.Content slot="content" />
default

Modal.Backdrop Props

handleClose () => void

Modal.Content Props

collapsed boolean false
collapsedWidth string 4.5rem
expandedWidth string 12rem

Modal.Content Slots

header <Modal.Content.Header slot="header" />
cover <Modal.Content.Cover slot="cover" />
body <Modal.Content.Body slot="body" />
default
footer <Modal.Content.Footer slot="footer" />

Modal.Content.Header Slots

default
extra

Modal.Content.Body Slots

default

Modal.Content.Footer Slots

default

Modal.Content.Actions.Action.Icon Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Modal.Content.Actions.Action.Label Slots

default

Modal Class Identifiers

stwui-modal-wrapper
stwui-modal-backdrop
stwui-modal
stwui-modal-content
stwui-modal-content-header
stwui-modal-content-body
stwui-modal-content-footer