Rich text editor
A lightweight editor with markdown shortcuts, a floating toolbar, a slash menu, and HTML and markdown output.
A generous target for dropping one or more files.
npx shadcn@latest add @silicon-ui/file-dropzonenpx shadcn@latest add @silicon-ui/file-dropzoneInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/file-dropzone/file-dropzone.tsxcomponents/silicon-ui/file-dropzone/file-dropzone.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
accept | string | — |
multiple | boolean | true |
maxFiles | number | 5 |
onFilesChange | (files: File[]) => void | — |
label | string | "Add files" |
description | string | "Drop files here or choose from your device" |
defaultItemsRows present at mount, such as files uploaded earlier. They render in place without an entrance. | FileDropzoneItem[] | — |
onUploadUploads each added file. Without it the list shows plain selections. | FileDropzoneUpload | — |
maxSizeFiles above this many bytes fail with a size reason and never upload. | number | — |
listPlacementRender the file list under the drop target or inside its edge. | "below" | "inside" | "below" |
noteReplaces the small line under the description. | string | — |
dropLabelLabel while files hover over the target. | string | — |
compactAtOnce the list holds this many files, the prompt folds to a slim bar so the list has room. A file dragged over brings the icon back. | number | — |