# Attachment URL: /docs/ui/attachment UI components for attaching and viewing files in messages. **Note:** These components provide the UI for attachments, but you also need to configure attachment adapters in your runtime to handle file uploads and processing. See the [Attachments Guide](/docs/guides/attachments) for complete setup instructions. Getting Started \[#getting-started] Add `attachment` \[#add-attachment] This adds a `/components/assistant-ui/attachment.tsx` file to your project, which you can adjust as needed. Use in your application \[#use-in-your-application] ```tsx title="/components/assistant-ui/thread.tsx" {1-4,9-10} import { ComposerAttachments, ComposerAddAttachment, } from "@/components/assistant-ui/attachment"; const Composer: FC = () => { return ( ); }; ``` ```tsx title="/components/assistant-ui/thread.tsx" {1,8} import { UserMessageAttachments } from "@/components/assistant-ui/attachment"; const UserMessage: FC = () => { return (
); }; ```
API Reference \[#api-reference] Composer Attachments \[#composer-attachments] ComposerPrimitive.Attachments \[#composerprimitiveattachments] Renders all attachments in the composer. ComposerPrimitive.AddAttachment \[#composerprimitiveaddattachment] A button that opens the file picker to add attachments. This primitive renders a `