# Attachment Input URL: /components/attachment-input Source: https://github.com/daangn/seed-design/blob/dev/docs/content/components/attachment-input.mdx An input for handling photo, video, and file attachments, managing selection, upload, progress, failure, and delete states. ## Anatomy Attachment Input consists of a Trigger and a Preview; the Preview can display actions on an item (delete/retry) and the upload progress state. ![Anatomy image of Attachment Input. Consists of Trigger, Delete Button, Preview, Loading State, and Retry Button.]() ## Properties ### Variant Attachment Input consists of a Media type for attaching photos/videos and a File type for attaching files. ![Attachment Input Variant - Media, File]() ### Preview Badge A badge can be shown on a Preview item. Mainly used to show a "cover photo" badge on the first Preview. - The badge is shown as a semi-transparent overlay at the bottom of the thumbnail. - The badge label can be changed. ![Example of Attachment Input Preview Badge]() ### State Trigger and Preview each have different states. - **Trigger**: Has Enabled, Pressed, and Disabled states; when it has a value, the Count is shown in the Neutral color. - **Preview**: Has Enabled, Loading, Error, and Disabled states. - **Remove Button**: The delete button at the top right of the Preview, with its own Enabled, Pressed, and Disabled states. ![Example of Attachment Input Trigger's Enabled, Has Value, Pressed, Disabled states]() ![Example of Attachment Input Preview's Enabled, Loading, Error, Disabled, Dragging states]() ![Example of Attachment Input Remove Button's Enabled, Pressed, Disabled states]() ### Dropzone An area where files can be uploaded via drag and drop. Used together with the existing Trigger button, and visually clearly indicates the droppable area. - Files can be selected either by clicking the button or by drag and drop. - When dragging in, the area's border and background color change to show the active state. - After selecting files, the Preview is shown inline below the Dropzone. ![Example of Attachment Input Dropzone's Enabled, Dragging Over, and after file attachment states]() ### Reorder When the Reorderable option is enabled, you can drag Preview items to change their order. ![Example of Attachment Input Reorder]() ## Specification ### Attachment Input Component spec (JSON): /rootage/components/attachment-input.json ### Attachment Input Trigger Component spec (JSON): /rootage/components/attachment-input-trigger.json ### Attachment Input Item Component spec (JSON): /rootage/components/attachment-input-item.json ### Attachment Input Item Action Button Component spec (JSON): /rootage/components/attachment-input-item-action-button.json ### Attachment Input Item Remove Button Component spec (JSON): /rootage/components/attachment-input-item-remove-button.json ### Attachment Input Dropzone Component spec (JSON): /rootage/components/attachment-input-dropzone.json