Modal
Modals are dialogs that can be used for lightboxes, user notifications, or completely custom content.
Example
To create a modal, create an element (such as an <i-button>) as a trigger and the v-model on an <i-modal> component to control its visibility. Everything inside the <i-modal> is rendered as the modal body. Optionally, you can provide a modal header and footer using #header and #footer slots.
Size Variants
You’re able to use the size property to control the size of your modals, using one of the available sizes: sm, md, and lg. The default size is set to md.
Color Variants
Inkline includes multiple predefined modal styles, each serving its own semantic purpose. You can set the style of a <i-modal> using the color property. By default, modals use the light variant.
Configuration
Props
Use props to modify the component’s design and behavior.
- Property
closeOnPressEscapeTypeBooleanDefaulttrueDescription Determines if the modal should close when pressing escape - Property
closeAriaLabelTypeStringDefaultCloseDescription The aria-label attribute of the close button - Property
colorType'primary' | 'success' | 'light' | 'dark' | 'info' | 'success' | 'warning' | 'danger'Default'light'Description The color variant of the modal - Property
disabledTypeBooleanDefaultfalseDescription The disabled state of the modal - Property
hideOnClickOutsideTypeBooleanDefaulttrueDescription Determines if the modal should close when clicking the overlay - Property
nameTypeStringDefaultuid()Description The identifier of the modal - Property
showCloseTypeBooleanDefaultfalseDescription Determines if the close icon should be visible in the modal header - Property
sizeType'sm' | 'md' | 'lg'Default'md'Description The size variant of the modal - Property
modelValueTypeBooleanDefaultfalseDescription Used to determine if modal is visible or not - Property
transitionTypefade-in-transition | fade-in-linear-transition | zoom-in-top-transition | zoom-in-bottom-transition | zoom-in-center-transition | zoom-in-left-transition | zoom-in-right-transitionDefaultzoom-in-center-transitionDescription The modal opening and closing animation
Slots
Use slots to insert custom content into well-defined component locations.
- Property
defaultDescription Slot for modal body content - Property
headerDescription Slot for modal header content - Property
footerDescription Slot for modal footer content
Events
Use events to react to something happening inside the component.
- Property
update:modelValueDescription Event emitted for setting the modelValue - Property
update:modelValueDescription Event emitted for setting the modelValue
CSS Variables
Read more about configuring Inkline’s Design System variables to update the look and feel of the component.
- Property
----backgroundValuecolor('white')Description The background of the modal component - Property
----border-top-colorValuecolor('light')Description The border top color of the modal component - Property
----border-right-colorValuecolor('light')Description The border right color of the modal component - Property
----border-bottom-colorValuecolor('light')Description The border bottom color of the modal component - Property
----border-left-colorValuecolor('light')Description The border left color of the modal component - Property
----border-colorValuevar(----border-top-color) var(----border-right-color) var(----border-bottom-color) var(----border-left-color)Description The border color of the modal component - Property
----border-styleValuevar(--border-style)Description The border style of the modal component - Property
----border-top-widthValuevar(--border-top-width)Description The border top width of the modal component - Property
----border-right-widthValuevar(--border-right-width)Description The border right width of the modal component - Property
----border-bottom-widthValuevar(--border-bottom-width)Description The border bottom width of the modal component - Property
----border-left-widthValuevar(--border-left-width)Description The border left width of the modal component - Property
----border-widthValuevar(----border-top-width) var(----border-right-width) var(----border-bottom-width) var(----border-left-width)Description The border width of the modal component - Property
----border-top-left-radiusValuevar(--border-top-left-radius)Description The border top left radius of the modal component - Property
----border-top-right-radiusValuevar(--border-top-right-radius)Description The border top right radius of the modal component - Property
----border-bottom-right-radiusValuevar(--border-bottom-right-radius)Description The border bottom right radius of the modal component - Property
----border-bottom-left-radiusValuevar(--border-bottom-left-radius)Description The border bottom left radius of the modal component - Property
----border-radiusValuevar(----border-top-left-radius) var(----border-top-right-radius) var(----border-bottom-right-radius) var(----border-bottom-left-radius)Description The border radius of the modal component - Property
----box-shadow-offset-xValuevar(--box-shadow-offset-x)Description The box shadow horizontal offset of the modal component - Property
----box-shadow-offset-yValuevar(--box-shadow-offset-y)Description The box shadow vertical offset of the modal component - Property
----box-shadow-blur-radiusValuevar(--box-shadow-blur-radius)Description The box shadow blur radius of the modal component - Property
----box-shadow-spread-radiusValuevar(--box-shadow-spread-radius)Description The box shadow spread radius of the modal component - Property
----box-shadow-colorValuevar(--box-shadow-color)Description The box shadow spread radius of the modal component - Property
----box-shadowValuevar(----box-shadow-offset-x) var(----box-shadow-offset-y) var(----box-shadow-blur-radius) var(----box-shadow-spread-radius) var(----box-shadow-color)Description The box shadow of the modal component - Property
----colorValuecontrast-color($color-light)Description The color of the modal component - Property
----font-sizeValuefont-size()Description The font size of the modal component - Property
----font-weightValuefont-weight('normal')Description The font weight of the modal component - Property
----line-heightValuevar(--line-height)Description The line height of the modal component - Property
----margin-topValuevar(--margin-top)Description The margin top of the modal component - Property
----margin-rightValuevar(--margin-right)Description The margin right of the modal component - Property
----margin-bottomValuevar(--margin-bottom)Description The margin bottom of the modal component - Property
----margin-leftValuevar(--margin-left)Description The margin left of the modal component - Property
----marginValuevar(----margin-top) var(----margin-right) var(----margin-bottom) var(----margin-left)Description The margin of the modal component - Property
----padding-topValuevar(--padding-top)Description The padding top of the modal component - Property
----padding-rightValuevar(--padding-right)Description The padding right of the modal component - Property
----padding-bottomValuevar(--padding-bottom)Description The padding bottom of the modal component - Property
----padding-leftValuevar(--padding-left)Description The padding left of the modal component - Property
----paddingValuevar(----padding-top) var(----padding-right) var(----padding-bottom) var(----padding-left)Description The padding of the modal component - Property
----widthValue480pxDescription The width of the modal component - Property
----header--backgroundValuecolor('light-25')Description The background of the modal component header - Property
----header--border-colorValuevar(----border-color)Description The border color of the modal component header - Property
----header--border-styleValuevar(----border-style)Description The border style of the modal component header - Property
----header--border-top-widthValuevar(----border-top-width)Description The border top width of the modal component header - Property
----header--border-right-widthValuevar(----border-right-width)Description The border right width of the modal component header - Property
----header--border-bottom-widthValuevar(----border-bottom-width)Description The border bottom width of the modal component header - Property
----header--border-left-widthValuevar(----border-left-width)Description The border left width of the modal component header - Property
----header--border-widthValuevar(----header--border-top-width) var(----header--border-right-width) var(----header--border-bottom-width) var(----header--border-left-width)Description The border width of the modal component header - Property
----header--colorValuevar(----color)Description The color of the modal component header - Property
----header--padding-topValuevar(----padding-top)Description The padding top of the modal component header - Property
----header--padding-rightValuevar(----padding-right)Description The padding right of the modal component header - Property
----header--padding-bottomValuevar(----padding-bottom)Description The padding bottom of the modal component header - Property
----header--padding-leftValuevar(----padding-left)Description The padding left of the modal component header - Property
----header--paddingValuevar(----header--padding-top) var(----header--padding-right) var(----header--padding-bottom) var(----header--padding-left)Description The padding of the modal component header - Property
----body--backgroundValuevar(----background)Description The background of the modal component body - Property
----body--border-colorValuevar(----border-color)Description The border color of the modal component body - Property
----body--border-styleValuevar(----border-style)Description The border style of the modal component body - Property
----body--border-top-widthValuevar(----border-top-width)Description The border top width of the modal component body - Property
----body--border-right-widthValuevar(----border-right-width)Description The border right width of the modal component body - Property
----body--border-bottom-widthValuevar(----border-bottom-width)Description The border bottom width of the modal component body - Property
----body--border-left-widthValuevar(----border-left-width)Description The border left width of the modal component body - Property
----body--border-widthValuevar(----body--border-top-width) var(----body--border-right-width) var(----body--border-bottom-width) var(----body--border-left-width)Description The border width of the modal component body - Property
----body--colorValuevar(----color)Description The color of the modal component body - Property
----body--padding-topValuevar(----padding-top)Description The padding top of the modal component body - Property
----body--padding-rightValuevar(----padding-right)Description The padding right of the modal component body - Property
----body--padding-bottomValuevar(----padding-bottom)Description The padding bottom of the modal component body - Property
----body--padding-leftValuevar(----padding-left)Description The padding left of the modal component body - Property
----body--paddingValuevar(----body--padding-top) var(----body--padding-right) var(----body--padding-bottom) var(----body--padding-left)Description The padding of the modal component body - Property
----footer--backgroundValuecolor('light-25')Description The background of the modal component footer - Property
----footer--border-colorValuevar(----border-color)Description The border color of the modal component footer - Property
----footer--border-styleValuevar(----border-style)Description The border style of the modal component footer - Property
----footer--border-top-widthValuevar(----border-top-width)Description The border top width of the modal component footer - Property
----footer--border-right-widthValuevar(----border-right-width)Description The border right width of the modal component footer - Property
----footer--border-bottom-widthValuevar(----border-bottom-width)Description The border bottom width of the modal component footer - Property
----footer--border-left-widthValuevar(----border-left-width)Description The border left width of the modal component footer - Property
----footer--border-widthValuevar(----footer--border-top-width) var(----footer--border-right-width) var(----footer--border-bottom-width) var(----footer--border-left-width)Description The border width of the modal component footer - Property
----footer--colorValuevar(----color)Description The color of the modal component footer - Property
----footer--padding-topValuevar(----padding-top)Description The padding top of the modal component footer - Property
----footer--padding-rightValuevar(----padding-right)Description The padding right of the modal component footer - Property
----footer--padding-bottomValuevar(----padding-bottom)Description The padding bottom of the modal component footer - Property
----footer--padding-leftValuevar(----padding-left)Description The padding left of the modal component footer - Property
----footer--paddingValuevar(----footer--padding-top) var(----footer--padding-right) var(----footer--padding-bottom) var(----footer--padding-left)Description The padding of the modal component footer - Property
----wrapper--backgroundValuergba(0, 0, 0, 0.75)Description The overlay background of the modal component wrapper