AI product
Attachment chip
a file in a conversation: icon by type, name, size · onRemove while composing
function AttachmentDemo() { const [files, setFiles] = React.useState(MOCK_FILES); return ( <View className="w-full gap-2"> <AttachmentChip file={MOCK_FILES[0]} /> <View className="flex-row flex-wrap gap-2"> {files.map((f) => ( <AttachmentChip key={f.name} file={f} onRemove={() => setFiles((fs) => fs.filter((x) => x.name !== f.name))} /> ))} </View> </View> );}Usage
ChatComposer shows these itself; use it to show the files in a sent message. Without onRemove it is read-only.
API
<AttachmentChip file={{ name, size, type? }} onRemove? />Get it
Already in every copy of the native kit:
import { AttachmentChip, formatBytes } from '@/components/kit/attachment-chip';Details
- Exports
AttachmentChip,formatBytes- Packages
- lucide-react-native@^1.21.0
- Installs with
- @halftone-native/icon, @halftone-native/lib-utils, @halftone-native/text
- Also searched as
- file, upload, attachment
- Registry JSON
- /r/native/attachment-chip.json
<div className="flex flex-wrap gap-2"> <AttachmentChip file={{ name: 'INV-1047-fernway.pdf', size: 184_320, type: 'application/pdf' }} /> <AttachmentChip file={{ name: 'receipt-photo.jpg', size: 2_516_582, type: 'image/jpeg' }} onRemove={() => toast('Removed receipt-photo.jpg')} /> <AttachmentChip file={{ name: 'q2-board-report-final-final-v3.xlsx', size: 48_211 }} /></div>Usage
ChatComposer shows these itself; use it to show the files in a sent message. Without onRemove it is read-only.
API
<AttachmentChip file={{ name, size, type? }} onRemove? />Get it
Already in every copy of the web kit:
import { AttachmentChip, formatBytes } from '@/components/kit/attachment-chip';Details
- Exports
AttachmentChip,formatBytes- Packages
- cn@^0.5.2, lucide-react@^1.52.0
- Installs with
- @halftone-web/button
- Also searched as
- file, upload, attachment
- Registry JSON
- /r/web/attachment-chip.json
Agents: the whole registry is at /llms.txt.