For Tailwind CSS v3 docs, click here.

文件上传

A modern file upload component with a 3D card effect, drag-and-drop functionality, and a responsive grid background pattern.

通过 CLI 安装

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/file-upload.json"

手动安装

在同一个文件中,复制并粘贴以下代码:

FileUpload.vue
FileUploadGrid.vue

API

FileUpload

The FileUpload component serves as a wrapper for the file upload effect. It manages mouse events to create a 3D perspective.

Props

Prop 名称类型默认值描述
classString-Additional classes for styling the container element.

Emits

Event Name类型描述
onChange(files: File[]) => voidCallback function triggered when files are added/uploaded.

用例

MyComponent.vue
<FileUpload class="additional-class">
  <!-- Your content here -->
</FileUpload>

FileUploadGrid

The FileUploadGrid component provides the background grid pattern for the file upload area. It is intended to be used within a FileUpload component to create the visual grid effect behind the upload interface.

Props

Prop 名称类型默认值描述
classString-Additional classes for custom styling.

用例

MyComponent.vue
<FileUploadGrid class="custom-class" />

感谢