new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

shadcn/ui · Components · all subjects

attachment/usage

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Attachment basic usage example

import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle } from '@/components/ui/attachment' <Attachment> <AttachmentMedia> <FileTextIcon /> </AttachmentMedia> <AttachmentContent> <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle> <AttachmentDescription>PDF · 2.4 MB</AttachmentDescription> </AttachmentContent> <AttachmentActions> <AttachmentAction aria-label="Remove sales-dashboard.pdf"> <XIcon /> </AttachmentAction> </AttachmentActions> </Attachment>

Attachment trigger with dialog example

To make the whole card open a link or dialog while keeping actions clickable, use AttachmentTrigger with DialogTrigger: <Dialog> <Attachment> {/* media, content, actions */} <DialogTrigger render={<AttachmentTrigger aria-label="Preview research-summary.pdf" />} /> </Attachment> <DialogContent>{/* ... */}</DialogContent> </Dialog>

Attachment component imports

Import the following from @/components/ui/attachment: Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle.

Basic attachment usage example

```tsx <Attachment> <AttachmentMedia> <FileTextIcon /> </AttachmentMedia> <AttachmentContent> <AttachmentTitle>sales-dashboard.pdf</AttachmentTitle> <AttachmentDescription>PDF · 2.4 MB</AttachmentDescription> </AttachmentContent> <AttachmentActions> <AttachmentAction aria-label="Remove sales-dashboard.pdf"> <XIcon /> </AttachmentAction> </AttachmentActions> </Attachment> ```

AttachmentTrigger usage

Add an AttachmentTrigger to make the whole card open a link or dialog. It fills the card behind the actions, so the actions stay clickable. Wrap it in DialogTrigger with asChild to open a Dialog. Example: ```tsx <Dialog> <Attachment> {/* media, content, actions */} <DialogTrigger asChild> <AttachmentTrigger aria-label="Preview research-summary.pdf" /> </DialogTrigger> </Attachment> <DialogContent>{/* ... */}</DialogContent> </Dialog> ```

Give your agent this brain