FileItem
One uploaded or uploading file with type tag, progress or size, and remove.
Code
import * as React from 'react';
import { FileItem } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 380,
}}
>
<FileItem name="invoice-december.pdf" size="214 KB" onRemove={() => {}} />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { FileItem } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/file-item.jsonGuidelines
- Use under FileUpload or in attachments lists.
Props
| Prop | Type | Required |
|---|---|---|
name | string | Yes |
size | string | No |
progress | number | No |
onRemove | () => void | No |
className | string | No |