DocsComponentsTemplatesThemesGitHub

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.json

Guidelines

  • Use under FileUpload or in attachments lists.

Props

PropTypeRequired
namestringYes
sizestringNo
progressnumberNo
onRemove() => voidNo
classNamestringNo

Edit this example on GitHub