# SbDrawer A slide-out panel component for displaying content from the edge of the screen. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Open | bool | false | Whether the drawer is open | | Placement | SbDrawerPlacement | Start | Drawer position (Start, End, Top, Bottom) | | Modal | bool | true | Whether drawer has a backdrop | | Title | string? | null | Drawer title | | Width | string | "320px" | Width for Start/End placement | | Height | string | "320px" | Height for Top/Bottom placement | | CloseOnEscape | bool | true | Whether to close on Escape key | | CloseOnBackdropClick | bool | true | Whether to close on backdrop click | | Class | string? | null | Additional CSS classes | | Style | string? | null | Inline styles | | AdditionalAttributes | Dictionary\? | null | Additional HTML attributes | ## Events | Event | Type | Description | |-------|------|-------------| | OpenChanged | EventCallback\ | Fired when open state changes | ## Templates / Slots | Slot | Type | Description | |------|------|-------------| | Header | RenderFragment | Custom header content | | ChildContent | RenderFragment | Drawer body content | | Footer | RenderFragment | Footer content | ## SbDrawerPlacement Enum ```csharp public enum SbDrawerPlacement { Start, // Left in LTR, Right in RTL End, // Right in LTR, Left in RTL Top, // Top of screen Bottom // Bottom of screen } ``` ## CSS Classes - `sb-drawer` - Base class - `sb-drawer--start|end|top|bottom` - Placement variants - `sb-drawer--modal` - When modal is true - `sb-drawer__container` - Inner container - `sb-drawer__header` - Header section - `sb-drawer__title` - Title text - `sb-drawer__close-btn` - Close button - `sb-drawer__body` - Body content - `sb-drawer__footer` - Footer section ## CSS Variables - `--sb-drawer-width` - Width for horizontal drawers - `--sb-drawer-height` - Height for vertical drawers ## Examples ### Basic Usage ```razor Open Drawer

Drawer content

@code { private bool isOpen = false; } ``` ### Different Placements ```razor Left side content Right side content Top content Bottom content ``` ### Custom Width ```razor

This drawer is 500px wide.

``` ### Navigation Drawer ```razor ``` ### Filter Drawer ```razor All Electronics Clothing
Clear Apply Filters
``` ### Cart Drawer ```razor @if (cartItems.Any()) { @foreach (var item in cartItems) { @item.Name @item.Name @item.Price.ToString("C") } } else { }
Total: @cartTotal.ToString("C") Checkout
``` ### Non-Modal Drawer ```razor

This drawer doesn't have a backdrop overlay.

```