UNPKG

1.64 kBMarkdownView Raw
1# CovalentSideSheet
2
3Main injectable to import and call the `open` method with any TemplateRef or Component
4
5## td-side-sheet-title
6
7`td-side-sheet-title` adds title styling to an element (optional)
8
9## td-side-sheet-close
10
11`td-side-sheet-close` will close the open side sheet on click, enter, etc.
12
13## td-side-sheet-content
14
15`td-side-sheet-content` creates an element to hold the content with margins that follow Material spec and also scroll when the content is larger than the view port
16
17## td-side-sheet-actions
18
19`td-side-sheet-actions` creates a sticky footer that can hold multiple actions (optional)
20
21## Setup
22
23Import the [CovalentSideSheetModule] in your NgModule:
24
25```typescript
26import { CovalentSideSheetModule } from '@covalent/core/side-sheet';
27@NgModule({
28 imports: [
29 CovalentSideSheetModule,
30 ...
31 ],
32 ...
33})
34export class MyModule {}
35```
36
37## Usage
38
39Basic Example:
40
41```typescript
42import { ExampleSideSheetComponent } from './example.sidebar/example.sidesheet.component';
43import { CovalentSideSheet } from '.@covalent/core/side-sheet';
44
45export class AppComponent {
46 constructor(private sideSheet: CovalentSideSheet) {
47 this.sideSheet.open(ExampleSidebarComponent);
48 }
49}
50```
51
52Example component html content with optional directives to support styling:
53
54```html
55<span td-sidesheet-title>
56 Side Sheet Title
57 <button mat-icon-button td-side-sheet-close>close</button>
58</span>
59<td-side-sheet-content> Sidesheet Content </td-side-sheet-content>
60<td-sidesheet-actions>
61 <button mat-icon-button td-side-sheet-close>close</button>
62 <button mat-icon-button td-side-sheet-close>save</button>
63</td-sidesheet-actions>
64```