Attachments

pro

Attachments presents removable file chips or image tiles with reusable preview and file-info parts.

launch-brief.png
launch-brief.png
image/png
PDF
notes.pdf
application/pdf

Installation

Add this component with the NateUI CLI.

npx nateui@latest add Attachments

Examples

Non-image Files

PDF
scope.pdf
application/pdf
XLS
estimates.xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

API

Attachments

PropDescriptionTypeDefault
variantArranges chips in a wrapping row, square tiles in a grid, or images at their own size.'inline' | 'grid' | 'media''inline'
...divPropsStandard <div> attributes forwarded to the container.ComponentProps<'div'>—

Attachment

PropDescriptionTypeDefault
dataFile metadata and preview URL.AttachmentData—
onRemoveMakes the remove action available.(attachment: AttachmentData) => void—
variantMatches the parent layout. Inherited from Attachments when omitted.'inline' | 'grid' | 'media''inline'
childrenUse Preview and Info to arrange the item explicitly.ReactNode—

Types

type AttachmentData = {
  id: string;
  name: string;
  mediaType: string;
  url: string;
};