# ModalService ## Description BitModalService is a service to globally handle modals with any content. ## Parameters | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | OnAddModal | `event Func<BitModalReference, Task>?` | | The event for when a new modal gets added through calling the Show method. | | OnCloseModal | `event Func<BitModalReference, Task>?` | | The event for when a modal gets removed through calling the Close method. | | Close | `Task (BitModalReference modal)` | | Closes an already opened modal using its reference. | | Show | `Task<BitModalReference> (Dictionary<string, object>? parameters)` | | Shows a new BitModal with a custom component with parameters as its content. | | Show | `Task<BitModalReference> (BitModalParameters? modalParameters)` | | Shows a new BitModal with a custom component as its content with custom parameters for the modal. | | Show | `Task<BitModalReference> (Dictionary<string, object>? parameters, BitModalParameters? modalParameters)` | | Shows a new BitModal with a custom component as its content with custom parameters for the custom component and the modal. | ## Examples \n**Basic**: ```razor Show ``` ```csharp [AutoInject] private BitModalService modalService = default!; private async Task ShowModal() { await modalService.Show(new BitModalParameters() { FullWidth = true }); } ```