Put an Attachment for each file in Attachments, and compose its parts as children.
message-files.tsx
Attachments
<ul>| Prop | Type | Default | Description |
|---|---|---|---|
| layout | "card""chip""gallery""row""tile" | "chip" | chip (default), tile, row, card, or gallery (photos sent together). |
| size | "default""sm" | "default" | default or sm (chip 32, tile 72, a compact row, card 200). |
| mode | "compose""sent" | "compose" | compose (default): a draft with Remove. sent: the files of a message; a press opens. |
| uploads | — | The upload queue (useFileUploads): Remove, Retry, Pause, and Undo act on it by entry id. | |
| files | readonly AttachmentFile[] | — | The saved files to show when there are no children (and no uploads). |
| on | AttachmentOpenHandler | — | Opens a file (the File Viewer seam): a press on a sent file, Open, or a gallery photo. With none, Open goes to the safe url in a new tab, else it downloads the file. |
| max | number | — | Shows this many files, then a +N button (AttachmentsOverflow). |
| filter | "active""all""done""failed" | — | The filter of the files (AttachmentsFilters). Controlled. |
| default | "active""all""done""failed" | "all" | |
| on | — | ||
| selectable | boolean | false | Shows a checkbox on each file and the selection of AttachmentsBatchBar. |
| selected | readonly string[] | — | The ids of the selected files. Controlled. |
| default | readonly string[] | NO_IDS | |
| on | — | ||
| labels | — | The words (ATTACHMENT_LABELS). Keep the object stable. | |
| locale | string | — | The locale of sizes and times. Default: the DisplayLocaleProvider locale. |
| children | ReactNode | — | Attachment items (each with a stable key) and group parts. None: the default list. |
| ...props | <ul> attributes | — | Every other attribute goes to the <ul>, with a ref. |
Attachment
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | The parts of the file. None: the default anatomy of the layout and mode. |
| file | AttachmentFile | — | The file: a page File (a draft) or a saved file. Optional with an entry. |
| id | string | — | A stable id. Default: the entry id, the saved file id, or the name. |
| entry | — | The upload entry of useFileUploads: it sets the file, status, progress, error, and speed. | |
| status | "blocked""done""error""locked""paused""processing""queued""uploading" | — | Where the file is (wins over the entry status, so an app can set processing). |
| progress | number | null | — | 0 to 100 while uploading; null while not known. |
| error | string | — | Why the file failed or was blocked. |
| detail | string | — | The meta words in your words ("Reading 3 of 12 pages", "Link expired on Nov 2"). |
| on | — | Removes the file when the app owns the list (no uploads, no Dropzone around it). It wins over the queue and the host list. Remove shows only when one of them can act. | |
| on | — | Sends a failed file again when the app owns the upload. It wins over the queue and the host. | |
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
AttachmentPreview
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
AttachmentName
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
AttachmentMeta
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
AttachmentProgress
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
AttachmentActions
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
AttachmentRemove
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| children | ReactNode | — | The icon. Default: an X (a trash can on a finished row). | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentRetry
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| children | ReactNode | — | The word on a row, the icon elsewhere. Default: "Retry", a turn arrow. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentPause
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentDownload
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentOpen
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| class | — | CSS class applied to the element, or a function that returns a class based on the component's state. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentMenu
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| children | ReactNode | — | The menu items. None: Open, Download, Copy link, and Delete (on a draft). | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentSelect
<span>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| size | "default""lg" | — | default 16px, or lg 20px. Default: the CheckboxGroup size, else default. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UICheckbox.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id | string | — | The id of the input element. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name | string | undefined | Identifies the field when a form is submitted. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| form | string | — | Identifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
AttachmentsHeader
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
AttachmentsDownloadAll
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| children | ReactNode | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentsSummary
<div>AttachmentsFilters
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| uploads | — | The queue, when the filters sit outside Attachments. | |
| filter | "active""all""done""failed" | — | The filter, when the filters sit outside Attachments. Controlled. |
| default | "active""all""done""failed" | "all" | The first filter outside Attachments. Default all. |
| on | — | ||
| labels | — | ||
| ...props | <div> attributes | — | Every other attribute goes to the <div>. |
AttachmentsOverflow
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| children | ReactNode | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
AttachmentsRemoved
| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — |
AttachmentsBatchBar
<li>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <li> attributes | — | Every other attribute goes to the <li>, with a ref. |
| Tab | Moves through the open layer and the actions of each file. |
|---|---|
| EnterorSpace | Opens a sent file, or runs the focused action (Remove, Retry, Pause, Download). |
| DeleteorBackspace | Removes a draft file from a control on it. The focus moves to the next file. |
Built with
Installs with Attachment







