Modal

Overlay components used to present focused content, actions, or navigation layers above the main interface.

Local

A self-contained modal where triggers and modal elements live within the same component structure. Built using interactions and sibling targeting for simple and reliable modal behavior.
The local Modal interactions are found in the Interactions (X) panel under Modal - Open and Modal - Close.

Modal - Open controls the opening sequence by adding is-open and on-enter to modal-navigation. Modal - Close controls the closing sequence by adding on-exit. Once the exit animation is complete, is-open, on-enter, and on-exit are all removed to return the Modal to its default state.

Keep the interactions connected to the documented classes, addon triggers, and component structure so the Modal can open, close, and complete each animation correctly.
modal
|
|
modal-open
i-local
|
modal-navigation
is-open
on-enter
on-exit
|
|
modal-backdrop
|
modal-layout
|
|
modal-close
i-local
Centered /
Close Button Outside of Panel
Centered /
Close Button Inside of Panel
Full Screen /
Primary Background
Full Screen /
Alternate Background

Global

A flexible modal system controlled through attributes and a lightweight script. Triggers can open specific modals from anywhere on the page by matching attribute values. Modal transitions are handled through CSS classes instead of interactions, making the system predictable and easy to reuse across components.
modal
|
|
modal-open
|
modal-navigation
is-open
on-enter
on-exit
|
|
modal-backdrop
|
modal-layout
|
|
modal-close
Centered /
Close Button Outside of Panel
Centered /
Close Button Inside of Panel
Full Screen /
Primary Background
Full Screen /
Alternate Background
Nested

Elements

Modal System Container
modal
Triggers
Local via Interaction
modal-open
i-local
Global via Attribute
modal-open
b-modal-open = modal-name
Targets
Local via Interaction
modal-navigation
Note: Element is hidden by default.
Global via Attribute
modal-navigation
b-modal-target = modal-name
Note: Element is hidden by default.
Menu Open
modal-navigation
is-open
Note: Element is hidden to prevent overlay.
Menu Enter Animation
modal-navigation
is-open
on-enter
Note: Element is hidden to prevent overlay.
Menu Exit Animation
modal-navigation
is-open
on-enter
on-exit
Note: Element is hidden to prevent overlay.
Backdrop
Overlay
modal-backdrop
Background
modal-background
Layout
modal-layout
Close Triggers
Interaction (Local)
modal-close
i-local
Class (Global)
modal-close
Spacer
modal-spacer
Close Button Positions
Basic
close
Sticky
close
is-sticky
Float Left
close
is-float-left
Float Right
close
is-float-right
Absolute Top / Left
close
is-absolute-top-left
Absolute Top / Right
close
is-absolute-top-right
Absolute Bottom / Left
close
is-absolute-bottom-left
Absolute Bottom / Right
close
is-absolute-bottom-right
Fixed Top / Left
close
is-fixed-top-left
Note: Element is hidden to prevent overlay.
Fixed Top / Right
close
is-fixed-top-right
Note: Element is hidden to prevent overlay.
Fixed Bottom / Left
close
is-fixed-bottom-left
Note: Element is hidden to prevent overlay.
Fixed Bottom / Right
close
is-fixed-bottom-right
Note: Element is hidden to prevent overlay.
Responsive Close Button Fixed Positions
Tablet
Mobile
Mobile Portrait
Top / Left
close
is-tablet-fixed-top-left
-
close
is-mobile-fixed-top-left
-
close
is-mobile-portrait-fixed-top-left
Top / Right
close
is-tablet-fixed-top-right
-
close
is-mobile-fixed-top-right
-
close
is-mobile-portrait-fixed-top-right
Bottom / Left
close
is-tablet-fixed-bottom-left
-
close
is-mobile-fixed-bottom-left
-
close
is-mobile-portrait-fixed-bottom-left
Bottom / Right
close
is-tablet-fixed-bottom-right
-
close
is-mobile-fixed-bottom-right
-
close
is-mobile-portrait-fixed-bottom-right
Custom Behavior -
Modal

Modal Structure

Each modal is defined using the attribute b-modal-target with a unique value.

Example: b-modal-target = pricing

The value acts as the modal identifier and must match the trigger that opens it.

When a modal opens, the script applies the following classes to the modal target: is-open on-enter

These classes control visibility and the entry transition.

‍

Trigger Elements

Any element can open a modal by adding the attribute b-modal-open with the same value used on the modal target.

Example: b-modal-open = pricing

When clicked, the trigger finds the modal with the matching identifier and activates it.

Triggers can be placed anywhere on the page.

‍

Closing a Modal

Any element inside a modal can close it by adding the class modal-close.

When clicked, the script finds the closest parent modal container with the attribute b-modal-target and begins the exit transition.

‍

Modal State Classes

The modal system uses three classes to control modal behavior and transitions.

After the exit transition finishes, all three classes are removed automatically.

‍

CSS Transition Logic

Transitions are controlled entirely through CSS.

Typical setup:

When closing, the script adds the on-exit class while keeping the on-enter class applied so the transition starts from the exact position where the entry animation finished.

‍

Animation Example

A common pattern for modal navigation panels is:

Other transitions can also be used if desired.

Because transitions are handled by CSS classes, interaction setup is neither required nor encouraged.

‍

Multiple Modals

The system supports multiple modals on the same page.

Triggers open only the modal that matches their identifier.

If multiple modals are open, the most recently opened modal is considered the active layer.

‍

Nested Modal Rule

A trigger can exist inside an open modal and open another modal.

Nested modals are supported, which means a modal target can be placed inside another modal target when needed.

When a close element is clicked, the script closes only the closest parent modal with the attribute b-modal-target, allowing parent and child modals to function independently.

This makes it possible to stack multiple modals inside each other, as long as their structure and z-index order are set correctly.

Important:

‍

Body Scroll Lock

When a modal opens, page scrolling is disabled.

The scroll position of the page is preserved, and scrolling inside the modal remains functional.

When the last modal closes, page scrolling is automatically restored.

‍

Summary

To create a modal:

  1. Add a modal container with the attribute b-modal-target = modal-name.
  2. Add a trigger element with the attribute b-modal-open = modal-name.
  3. Add a close element inside the modal with the class modal-close.
  4. Define CSS transitions using the classes is-open, on-enter, and on-exit.

No additional configuration or interactions are required.