---
sidebar_position: 4
title: Installer Blazored.Modal
---

## Utilisation de Blazored Modal

Ajouter le nuget `Blazored.Modal`.

### Ajouter le service

```csharp title="Program.cs"
// highlight-next-line
using Blazored.Modal;

...

// highlight-next-line
builder.Services.AddBlazoredModal();

...
```

### Ajouter les Imports

```cshtml title="_Imports.razor"
@using Blazored.Modal
@using Blazored.Modal.Services
```

### Ajouter le composant CascadingBlazoredModal autour du composant Router existant

```cshtml title="App.razor"
// highlight-next-line
<CascadingBlazoredModal>
    <Router AppAssembly="typeof(Program).Assembly">
        ...
    </Router>
// highlight-next-line
</CascadingBlazoredModal>
```

### Ajouter les références Javascript & CSS

```cshtml title="Pages/_Layout.cshtml"
<link href="_content/Blazored.Modal/blazored-modal.css" rel="stylesheet" />
```

```html
<script src="_content/Blazored.Modal/blazored.modal.js"></script>
```

## Documentation

Lien vers la documentation [Blazored.Modal](https://github.com/Blazored/Modal).