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