Import
Basic Usage
API Reference
MatBottomSheet (Service)
Methods
| Name | Description |
|---|---|
open<T>(component: ComponentType<T>, config?: MatBottomSheetConfig): MatBottomSheetRef<T> | Opens component in bottom sheet |
open<T>(template: TemplateRef<T>, config?: MatBottomSheetConfig): MatBottomSheetRef<T> | Opens template in bottom sheet |
dismiss<R>(result?: R): void | Dismisses the currently visible bottom sheet |
MatBottomSheetRef
Reference to the opened bottom sheet.Properties
| Name | Type | Description |
|---|---|---|
instance | T | Component instance |
containerInstance | MatBottomSheetContainer | Container instance |
Methods
| Name | Description |
|---|---|
dismiss(result?: R): void | Dismisses the bottom sheet |
afterDismissed(): Observable<R> | Observable that emits when dismissed |
afterOpened(): Observable<void> | Observable that emits when opened |
backdropClick(): Observable<MouseEvent> | Observable for backdrop clicks |
keydownEvents(): Observable<KeyboardEvent> | Observable for keydown events |
MatBottomSheetConfig
| Property | Type | Description |
|---|---|---|
data | any | Data to pass to the bottom sheet |
panelClass | string | string[] | Custom CSS classes |
backdropClass | string | Backdrop CSS class |
disableClose | boolean | Whether close on backdrop click |
ariaLabel | string | ARIA label |
autoFocus | boolean | string | AutoFocusTarget | Auto focus strategy |
restoreFocus | boolean | Restore focus on close |
direction | Direction | Layout direction |
Examples
With Data
Returning Data
With Template
Custom Styling
Disable Close
Share Actions
Accessibility
- Bottom sheet has
role="dialog" - Focus is trapped within the bottom sheet
- ESC key closes the bottom sheet by default
- Focus returns to trigger element on close
- Use
ariaLabelfor screen readers