Upload request panel — Files block

Pro

files-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-panel

Usage

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.

PropTypeDescription
title*stringWordswhat is being uploaded ("Add documents")
limits*stringWordsthe limits as the server enforces them ("PDF, JPG or PNG · 5 files · 10 MB each")
fieldsField[]the form’s fields, in order
submit*stringActionthe page action that receives the files
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Field fields[] · 7 props
PropTypeDescription
name*stringDesignthe key of the field in what the form sends
label*stringWordsthe field’s name ("Project name")
type'text' | 'email' | 'date' | 'textarea' | 'select'what kind of field it is: text, email, date, textarea, select
helpstringWordsone sentence on how the field is used
placeholderstringWordsthe shape expected, never a value that looks real
optionsOption[]the choices, for a select
requiredbooleantrue: it must be filled in
Option fields[].options[] · 2 props
PropTypeDescription
value*stringDesignwhat is sent
label*stringWordswhat is read
Options options · 6 props
PropTypeDescription
cancelstringActionwhere Cancel leads
submitLabelstringWordsthe send button ("Upload")
linkstringDatathe address where others upload, as the host created it
folderstringWordsthe folder the files land in
deadlinestringWordsthe deadline, as the merchant wrote it
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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.

All 12 files blocks