# Modal

Modals inform users about a task and can contain critical information, require decisions, or involve multiple tasks.

## Basic

![](/files/-MAgHCegkDdI-8ERES6T)

```
New-UDButton -Text 'Basic' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    }
}
```

## Full Screen

![](/files/-MAgHMDDsiPNvxsZa8S1)

```
New-UDButton -Text 'Full Screen' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    } -Footer {
        New-UDButton -Text "Close" -OnClick { Hide-UDModal }
    }  -FullScreen
}
```

## Full Width

Full width modals take up the full width as defined by the `-MaxWidth` parameter.

![](/files/-MAgHSBaiUZjFN06cWsT)

```
New-UDButton -Text 'Full Width' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    } -FullWidth -MaxWidth 'md'
}
```

## Persistent

Persistent modals do not close when you click off of them. You will have to close it with `Hide-UDModal`.

![](/files/-MAgHXYJdJXkyTu0s3cq)

```
New-UDButton -Text 'Persistent' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    } -Footer {
        New-UDButton -Text "Close" -OnClick { Hide-UDModal }
    } -Persistent
}
```

## Hide a Modal

You can use the `Hide-UDModal` button to hide a modal that is currently show.

```
New-UDButton -Text 'Basic' -OnClick {
    Show-UDModal -Content {
        New-UDTypography -Text "Hello"
    }
    Start-Sleep 5
    Hide-UDModal
}
```

**Show-UDModal**

| Name       | Type        | Description                                  | Required |
| ---------- | ----------- | -------------------------------------------- | -------- |
| FullScreen | switch      | Creates a full screen modal                  | false    |
| Footer     | ScriptBlock | Sets the footer content for the modal.       | false    |
| Header     | ScriptBlock | Sets the header content for the modal.       | false    |
| Content    | ScriptBlock | Sets the main body content for the modal.    | false    |
| Persistent | switch      | Creates a persistent modal.                  | false    |
| FullWidth  | switch      | Creates a full width modal.                  | false    |
| MaxWidth   | string      | Defines the max width of a full width modal. | false    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powershelluniversal.com/v1/dashboard/components/feedback/modal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
