Attachment
Show a file alongside its actions.
Examples
Show a file alongside its actions
React code
import {
Attachment,
AttachmentMedia,
AttachmentContent,
AttachmentActions,
} from "@accelerate/react/components";
export function Example() {
return (
<>
<Attachment>
<AttachmentMedia aria-hidden="true">PDF</AttachmentMedia>
<AttachmentContent>
<strong>Release checklist</strong>
<p>PDF document</p>
</AttachmentContent>
<AttachmentActions>
<a href="/migration/">Open release guidance</a>
</AttachmentActions>
</Attachment>
</>
);
}Angular code
import { Component } from "@angular/core";
import {
AccAttachment,
AccAttachmentMedia,
AccAttachmentContent,
AccAttachmentActions,
} from "@accelerate/angular/components";
@Component({
selector: "app-example",
imports: [
AccAttachment,
AccAttachmentMedia,
AccAttachmentContent,
AccAttachmentActions,
],
template: `
<article accAttachment>
<div accAttachmentMedia aria-hidden="true">PDF</div>
<div accAttachmentContent>
<strong>Release checklist</strong>
<p>PDF document</p>
</div>
<div accAttachmentActions>
<a href="/migration/">Open release guidance</a>
</div>
</article>
`,
})
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
Compose with AttachmentMedia, AttachmentContent, AttachmentActions, and Progress. Wrap several attachments in AttachmentGroup for horizontal snap scrolling.
Import the React component Attachment from @accelerate/react/components. For Angular, add AccAttachment to the standalone component’s imports and use <article accAttachment>.
Examples use these React parts: Attachment, AttachmentMedia, AttachmentContent, AttachmentActions. The Angular examples show the corresponding directives and template hosts.
API reference
- AttachmentGroup
- Groups attachments in a scrollable row.
- data-orientation
- Set vertical for a stacked arrangement.