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 TypeDefault
Animated

Determines whether the component has any animations. Global option.

booltrue
AnimationDuration

Specifies the animation duration. Global option.

int150
Placement

Specifies the position of the offcanvas.

Possible values:Top, Bottom, Start, End

PlacementPlacement.End
ShowBackdrop

Specifies the backdrop needs to be rendered for this Offcanvas. Global option.

booltrue
ShowCloseButton

Shows a close button in the offcanvas header when using the provider structure. Global option.

booltrue
Size

Changes the size of the offcanvas.

Possible values:Default, Small, Large, ExtraLarge, Fullscreen

OffcanvasSizeOffcanvasSize.Default
Stateful

Keeps the OffcanvasInstance in memory after it has been closed. Defaults to false.

boolfalse
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.

booltrue

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 DescriptionReturnParameters
SetOffcanvasProvider Sets the provider used to manage offcanvas instances. voidOffcanvasProvider 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. TaskOffcanvasInstance offcanvasInstance
Hide Hides the latest offcanvas panel or a specific instance. TaskOffcanvasInstance offcanvasInstance (optional)
GetInstances Returns all offcanvas instances managed by the provider. IEnumerable<OffcanvasInstance>
Remove Removes an offcanvas instance from the provider. TaskOffcanvasInstance offcanvasInstance
Reset Clears the offcanvas provider state and its tracked instances. Task
On this page