AttachmentChip
File attached to a prompt or message, with type tag, name, size and remove.
Code
import * as React from 'react';
import { AttachmentChip } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
display: 'flex',
gap: 8,
}}
>
<AttachmentChip
name="brief.pdf"
size="1.2 MB"
{...{
onRemove() {},
}}
/>
<AttachmentChip name="data.csv" size="84 KB" />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { AttachmentChip } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/attachment-chip.jsonGuidelines
- Show above the prompt while composing, under the user message after sending.
Props
| Prop | Type | Required |
|---|---|---|
name | string | Yes |
size | string | No |
onRemove | () => void | No |
className | string | No |