Skip to main content
Version: v3

ModalApi

API for displaying modals in Rancher UI. Here's what a Modal looks like in Rancher UI:

  • modal Example

Methods

open()

open(component, config?): void;

Opens a modal dialog in Rancher UI

Example:

import { useShell } from '@shell/apis';
import MyCustomModal from '@/components/MyCustomModal.vue';

const shell = useShell();

shell.modal.open(MyCustomModal, {
props: { title: 'Hello Modal' }
});

Parameters

component

Component

The Vue component to be displayed inside the modal. This can be any SFC (Single-File Component) imported and passed in as a Component.

config?

ModalConfig

Modal configuration object

Returns

void