# Modal Dialog

**Path:** Components/Popover

[Back to Documentation Index](http://rubicblazor.skyconis.com/docs.md)

---

Modal Dialog

 Modal dialogs render inline fragments or components through RbDialogService .

 Show code

 ShowModal 

 Basic

 Configure title, icon, width, height, and close behavior through RbDialogOptions .

 Show code

 ShowModal 

 Component Content

 Open a component with strongly typed parameters and receive its close code.

 Show code

 Open Service Modal (Component)

 Scrollable Content

 Keep modal dimensions fixed while allowing the body content to scroll.

 Show code

 ShowModal 

 Footer and Close Behavior

 Combine footer actions with escape and backdrop close options.

 Show code

 ShowModal 

 Close On Escape ? 

 Close On Drop Click ? 

 Nested Dialogs

 Open a child dialog without closing its parent.

 Show code

 Open Parent Modal (Nested Demo)

 RTL Support

 Modal direction follows the local RTL context from which it is opened.

 Show code

 نافذة داخل حاوية RTL

 العنوان والمحتوى يجب أن يظهرا باتجاه عربي صحيح عند الفتح من داخل الحاوية المحلية.

 فتح النافذة

 API

 ShowAsync<TComponent>

 Opens a modal by rendering a Blazor component type through the dialog service.

 Parameters

 RbComponentParameters<TComponent> parameters = null

 Optional component parameters passed to the modal content.

 Action<RbDialogOptions> opt = null

 Optional dialog options builder used to configure title, size, close behavior, and similar modal settings.

 Return

 Task<int> 

 Returns the modal close code. Typical values are 1 for primary close actions and 0 when the modal is dismissed without an explicit result.

 ShowAsync(Type componentType, ... )

 Opens a modal from a runtime component type instead of a generic type argument.

 Parameters

 Type componentType 

 Component type to render inside the modal. The type must implement IComponent.

 RbComponentParameters parameters = null

 Optional runtime parameter bag passed to the modal content.

 Action<RbDialogOptions> opt = null

 Optional dialog options builder used to configure modal behavior and appearance.

 Return

 Task<int> 

 Returns the modal close code.

 ShowAsync(RenderFragment<RbDialogContext> content, ... )

 Opens a modal from inline fragment content when you do not want a separate component file.

 Parameters

 RenderFragment<RbDialogContext> content 

 Inline modal content. The dialog context gives access to CloseAsync and the modal lifecycle.

 Action<RbDialogOptions> opt = null

 Optional dialog options builder used to configure modal behavior and appearance.

 Return

 Task<int> 

 Returns the modal close code.

 ✕

 Contents
