Sheet
Place supplementary UI beside the main content.
Examples
Place supplementary UI beside the main content
React code
import {
DialogTrigger,
Sheet,
DialogTitle,
DialogDescription,
DialogClose,
} from "@accelerate/react/components";
export function Example() {
return (
<>
<DialogTrigger aria-controls="record-sheet">Show record</DialogTrigger>
<Sheet id="record-sheet" aria-labelledby="sheet-title">
<DialogTitle id="sheet-title">Record details</DialogTitle>
<DialogDescription>Review state and ownership.</DialogDescription>
<DialogClose>Close panel</DialogClose>
</Sheet>
</>
);
}Angular code
import { Component } from "@angular/core";
import {
AccDialogTrigger,
AccSheet,
AccDialogTitle,
AccDialogDescription,
AccDialogClose,
} from "@accelerate/angular/components";
@Component({
selector: "app-example",
imports: [
AccDialogTrigger,
AccSheet,
AccDialogTitle,
AccDialogDescription,
AccDialogClose,
],
template: `
<button accDialogTrigger aria-controls="record-sheet">Show record</button>
<dialog accSheet id="record-sheet" aria-labelledby="sheet-title">
<h2 accDialogTitle id="sheet-title">Record details</h2>
<p accDialogDescription>Review state and ownership.</p>
<button accDialogClose>Close panel</button>
</dialog>
`,
})
export class Example {}Open from the start edge
React code
import {
DialogTrigger,
Sheet,
DialogTitle,
DialogClose,
} from "@accelerate/react/components";
export function Example() {
return (
<>
<DialogTrigger aria-controls="start-sheet">Open navigation</DialogTrigger>
<Sheet id="start-sheet" data-side="start" aria-labelledby="start-title">
<DialogTitle id="start-title">Navigation</DialogTitle>
<a href="/components/">Component catalog</a>
<DialogClose>Close navigation</DialogClose>
</Sheet>
</>
);
}Angular code
import { Component } from "@angular/core";
import {
AccDialogTrigger,
AccSheet,
AccDialogTitle,
AccDialogClose,
} from "@accelerate/angular/components";
@Component({
selector: "app-example",
imports: [
AccDialogTrigger,
AccSheet,
AccDialogTitle,
AccDialogClose,
],
template: `
<button accDialogTrigger aria-controls="start-sheet">Open navigation</button>
<dialog accSheet id="start-sheet" data-side="start" aria-labelledby="start-title">
<h2 accDialogTitle id="start-title">Navigation</h2>
<a href="/components/">Component catalog</a>
<button accDialogClose>Close navigation</button>
</dialog>
`,
})
export class Example {}Installation
Source preview. The expanded component catalog is ahead of the public npm releases. To run these examples in your own application, use packages built from the SDK source used for the previews or a release that includes the APIs below.
- React
@accelerate/ui@0.4.0and@accelerate/react@0.4.0- Angular
@accelerate/ui@0.4.0and@accelerate/angular@0.2.0
Load @accelerate/ui/theme.css and put acc-theme on the app or the region using Accelerator components. See the framework setup guide for the theme and adapter conventions.
Usage
Side-aligned modal using the dialog parts. Set data-side="start" to switch sides.
Import the React component Sheet from @accelerate/react/components. For Angular, add AccSheet to the standalone component’s imports and use <dialog accSheet>.
Examples use these React parts: DialogTrigger, Sheet, DialogTitle, DialogDescription, DialogClose. The Angular examples show the corresponding directives and template hosts.
API reference
- data-side
- Use start to open from the inline start edge.
- DialogTrigger / DialogClose
- Reuse native dialog controls.