# Modal

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

## Basic

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MAgDDtlz7vhocNS49ln%2F-MAgHCegkDdI-8ERES6T%2Fimage.png?alt=media\&token=beb6413b-cb04-4e8a-87e4-5d2f3fb3c892)

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

## Full Screen

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MAgDDtlz7vhocNS49ln%2F-MAgHMDDsiPNvxsZa8S1%2Fimage.png?alt=media\&token=ff480444-0c3f-4829-975a-1fb4097cc9ed)

```powershell
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.

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MAgDDtlz7vhocNS49ln%2F-MAgHSBaiUZjFN06cWsT%2Fimage.png?alt=media\&token=f201ed6b-72a3-4c76-8b6e-5136dfa1d9f8)

```powershell
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`.

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-MAgDDtlz7vhocNS49ln%2F-MAgHXYJdJXkyTu0s3cq%2Fimage.png?alt=media\&token=dc29e8fb-cdfd-4bb8-9ce7-904beee106f5)

```powershell
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.

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

## API

* [Show-UDModal](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/Show-UDModal.txt)
* [Hide-UDModal](https://github.com/ironmansoftware/universal-docs/blob/master/cmdlets/Hide-UDModal.txt)
