Blazorise Offcanvas Provider API
Review the provider component and service methods used to create and manage offcanvas instances.
For setup instructions and examples, see the Offcanvas Provider documentation.
API
Parameters
| Parameter | Default | Type |
|---|---|---|
Animated | true | bool |
Determines whether the component has any animations. Global option. | ||
AnimationDuration | 150 | int |
Specifies the animation duration. Global option. | ||
Placement | End | Placement |
Specifies the position of the offcanvas. Possible values: TopBottomStartEnd | ||
ShowBackdrop | true | bool |
Specifies the backdrop needs to be rendered for this Offcanvas. Global option. | ||
ShowCloseButton | true | bool |
Shows a close button in the offcanvas header when using the provider structure. Global option. | ||
Size | OffcanvasSize.Default | OffcanvasSize |
Changes the size of the offcanvas. Possible values: DefaultSmallLargeExtraLargeFullscreen | ||
Stateful | false | bool |
Keeps the OffcanvasInstance in memory after it has been closed. Defaults to false. | ||
UseOffcanvasStructure | true | bool |
Uses the offcanvas standard structure, by setting this to true you are only in charge of providing the custom content. Defaults to true. Global option. | ||
Events
| Event | Type |
|---|---|
CloseButtonClicked | EventCallback |
Callback executed when the close button is clicked. Global option. | |
Closed | EventCallback |
Occurs after the offcanvas has closed. Global option. | |
Closing | Func<OffcanvasClosingEventArgs, Task> |
Occurs before the offcanvas is closed. Global option. | |
Opened | EventCallback |
Occurs after the offcanvas has opened. Global option. | |
Opening | Func<OffcanvasOpeningEventArgs, Task> |
Occurs before the offcanvas is opened. Global option. | |
IOffcanvasService
Properties
| Property | Type |
|---|---|
OffcanvasProvider | OffcanvasProvider |
Gets the provider that manages offcanvas instances.
| |
Methods
| Method | Return | Parameters |
|---|---|---|
SetOffcanvasProvider | void | OffcanvasProvider offcanvasProvider |
Sets the provider used to manage offcanvas instances.
| ||
Show<TComponent> | Task<OffcanvasInstance> | title, parameters, options (depending on overload) |
Shows a component in an offcanvas panel. Overloads support a title, component parameters, and instance options.
| ||
Show | Task<OffcanvasInstance> | component type or RenderFragment, with optional title and options |
Shows dynamically selected component content or a render fragment.
| ||
Show | Task | OffcanvasInstance offcanvasInstance |
Reopens an existing offcanvas instance.
| ||
Hide | Task | OffcanvasInstance offcanvasInstance (optional) |
Hides the latest offcanvas panel or a specific instance.
| ||
GetInstances | IEnumerable<OffcanvasInstance> | — |
Returns all offcanvas instances managed by the provider.
| ||
Remove | Task | OffcanvasInstance offcanvasInstance |
Removes an offcanvas instance from the provider.
| ||
Reset | Task | — |
Clears the offcanvas provider state and its tracked instances.
| ||