Upload request panel — Files block
Profiles-upload-request-panel · for forms, app pages
Upload request panel
Someone else must send files: a panel with the folder, the deadline and a link to copy
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/files-upload-request-panelUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import FilesUploadRequestPanel from '@/components/trame/blocks/files/files-upload-request-panel.vue'
const props = {
title: "Request documents",
limits: "Invited people can send up to 10 files of 25 MB each.",
submit: "create-request",
fields: [
{
name: "folder",
label: "Destination folder",
type: "select",
options: [
{
value: "compta",
label: "Accounting"
},
{
value: "rh",
label: "Human resources"
}
],
required: true
},
{
name: "deadline",
label: "Send by",
type: "date"
}
],
options: {
link: "https://example.example/send/k3p9x2",
folder: "Accounting",
deadline: "Friday, October 16"
}
}
</script>
<template>
<FilesUploadRequestPanel v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat is being uploaded ("Add documents") |
| limits* | string | Wordsthe limits as the server enforces them ("PDF, JPG or PNG · 5 files · 10 MB each") |
| fields | Field[] | the form’s fields, in order |
| submit* | string | Actionthe page action that receives the files |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Field fields[] · 7 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Designthe key of the field in what the form sends |
| label* | string | Wordsthe field’s name ("Project name") |
| type | 'text' | 'email' | 'date' | 'textarea' | 'select' | what kind of field it is: text, email, date, textarea, select |
| help | string | Wordsone sentence on how the field is used |
| placeholder | string | Wordsthe shape expected, never a value that looks real |
| options | Option[] | the choices, for a select |
| required | boolean | true: it must be filled in |
Option fields[].options[] · 2 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Designwhat is sent |
| label* | string | Wordswhat is read |
Options options · 6 props
| Prop | Type | Description |
|---|---|---|
| cancel | string | Actionwhere Cancel leads |
| submitLabel | string | Wordsthe send button ("Upload") |
| link | string | Datathe address where others upload, as the host created it |
| folder | string | Wordsthe folder the files land in |
| deadline | string | Wordsthe deadline, as the merchant wrote it |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
submit,options.cancel
A files section, for forms, app pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More files blocks
- Import mapping stepped: the import in numbered steps: match each column to a field, choose the duplicates to merge when there are any, review and send.
- List browser: A file browser with list and grid views, using the merchant's own files only.
- List links: A shared-file ledger with access and expiry, using the merchant's own system values only.
- Media library grid: a wall of previews with a box on each to pick several assets at once, and the upload entry at hand.
- Media library table: a dense table when there are many files: a small preview, the name and folder, the kind, the weight, the date.
- Recent dated list: A date-grouped reading list for returning to the merchant's own recently used files, in host order.
- Recent event rail: An event rail with file details and actors, using the merchant's own recorded activity only.
- Upload sources: files can also come from a link, a camera or a library: the zone plus a row of source buttons.