Asset inspector wall beside — Files block

Pro

files-asset-inspector-wall-beside · for app pages

Asset inspector wall beside

The same wall with the selected asset’s record beside it: weight, dimensions, where it is used, and its actions

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-asset-inspector-wall-beside

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import FilesAssetInspectorWallBeside from '@/components/trame/blocks/files/files-asset-inspector-wall-beside.vue'

const props = {
title: "Ostra media library",
items: [
{
id: "a1",
name: "low-light-coat-columns.jpg",
kind: "image",
src: "https://images.unsplash.com/photo-1782694308249-917d2599b46f?w=1600&q=80",
alt: "A woman in a long dark coat by stone columns, in black and white",
path: "media/fall-winter/",
size: "2.4 MB",
dimensions: "1600 × 2400 px",
date: "Jun 24",
author: {
name: "Mina Sato"
},
uses: 4
},
{
id: "a2",
name: "trench-bridge-02.jpg",
kind: "image",
src: "https://images.unsplash.com/photo-1790802195673-357071dfa500?w=1600&q=80",
alt: "A woman in a black trench coat and gray slip dress on a city bridge",
path: "media/fall-winter/",
size: "1.9 MB",
dimensions: "1600 × 2400 px",
date: "Jun 21",
author: {
name: "Mina Sato"
},
uses: 2
}
],
folders: [
{
id: "f1",
name: "Fall–Winter",
count: 148,
action: "folder-products"
},
{
id: "f2",
name: "Campaign",
count: 46,
action: "folder-workshop"
}
],
kinds: [
{
value: "all",
label: "All",
count: 216
},
{
value: "image",
label: "Images",
count: 171
}
],
storage: "12.4 GB of 50 GB used",
upload: {
label: "Upload",
action: "media-upload"
},
open: "media-open",
detailActions: [
{
label: "Replace",
action: "media-replace"
},
{
label: "Download",
action: "media-download"
}
],
selectedId: "a1"
}
</script>

<template>
<FilesAssetInspectorWallBeside v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordswhat the library holds ("Shop media library")
items*Item[] | nullDatathe assets, with the details the app holds about each
foldersFolder[]Datathe folders at the top of the library
kindsKind[]the filter chips of the toolbar
storagestringWordswhat the library occupies, as the app writes it ("12.4 GB of 50 GB")
uploadUploadthe entry to add assets
openstringActionopens one asset
detailActionsDetailAction[]the actions under the record of the inspector
selectedIdstringDesignthe asset the record shows; the first one without it
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 11 props
PropTypeDescription
id*string | numberDatathe asset’s id in the library
name*stringWordsthe file’s name ("leather-tote-04.jpg")
kind'image' | 'video' | 'document' | 'archive'what the file is: image, video, document or archive
srcstringPicturethe small preview the library serves
altstringWordswhat the picture shows
pathstringWordswhere it lives ("media/products/")
sizestringWordsits weight as the app writes it ("2.4 MB")
dimensionsstringWordsits pixel size ("2400 × 1600 px")
datestringWordsthe upload date as the app writes it
authorAuthorwho added the file
usesnumberon how many pages the app shows it
Author items[].author · 6 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
Folder folders[] · 4 props
PropTypeDescription
id*string | numberDatathe folder’s id
name*stringWordsthe album or folder ("Products")
countnumberhow many assets it holds
action*stringActionopens that folder
Kind kinds[] · 3 props
PropTypeDescription
value*stringDesignthe kind’s value
label*stringWordswhat is read ("Pictures")
countnumberhow many assets of this kind
Upload upload · 2 props
PropTypeDescription
label*stringWordswhat happens ("Upload")
action*stringActionopens the upload flow
DetailAction detailActions[] · 3 props
PropTypeDescription
label*stringWordswhat happens ("Replace")
action*stringActiona named action of the page
dangerbooleandestructive, drawn last in red
Options options · 3 props
PropTypeDescription
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
loadingstringWordswhat the page says while the tool answers ("Loading the media library")
selectLabelstringWordswhat picking a tile means ("Select")
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
asseta picture’s address as your app serves it
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: folders[], upload, open, detailActions[]
  • Reads files from your app

A files section, for app pages; it uses @lucide/vue, class-variance-authority, clsx, reka-ui, tailwind-merge.

More files blocks

  • Device sync cards: Device status cards and folder sync controls, using the merchant's own sync states only.
  • Drop zone: a form that takes files by drop or choice within stated limits, then lists what was added.
  • 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.

All 12 files blocks