Asset inspector wall beside — Files block
Profiles-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-besideUsage
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.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the library holds ("Shop media library") |
| items* | Item[] | null | Datathe assets, with the details the app holds about each |
| folders | Folder[] | Datathe folders at the top of the library |
| kinds | Kind[] | the filter chips of the toolbar |
| storage | string | Wordswhat the library occupies, as the app writes it ("12.4 GB of 50 GB") |
| upload | Upload | the entry to add assets |
| open | string | Actionopens one asset |
| detailActions | DetailAction[] | the actions under the record of the inspector |
| selectedId | string | Designthe asset the record shows; the first one without it |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 11 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe asset’s id in the library |
| name* | string | Wordsthe file’s name ("leather-tote-04.jpg") |
| kind | 'image' | 'video' | 'document' | 'archive' | what the file is: image, video, document or archive |
| src | string | Picturethe small preview the library serves |
| alt | string | Wordswhat the picture shows |
| path | string | Wordswhere it lives ("media/products/") |
| size | string | Wordsits weight as the app writes it ("2.4 MB") |
| dimensions | string | Wordsits pixel size ("2400 × 1600 px") |
| date | string | Wordsthe upload date as the app writes it |
| author | Author | who added the file |
| uses | number | on how many pages the app shows it |
Author items[].author · 6 props
| Prop | Type | Description |
|---|---|---|
| id | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe person’s name |
| role | string | Wordstheir role or job title |
| company | string | Wordswhere they work |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| url | string | Designa page about them |
Folder folders[] · 4 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe folder’s id |
| name* | string | Wordsthe album or folder ("Products") |
| count | number | how many assets it holds |
| action* | string | Actionopens that folder |
Kind kinds[] · 3 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Designthe kind’s value |
| label* | string | Wordswhat is read ("Pictures") |
| count | number | how many assets of this kind |
Upload upload · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Upload") |
| action* | string | Actionopens the upload flow |
DetailAction detailActions[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Replace") |
| action* | string | Actiona named action of the page |
| danger | boolean | destructive, drawn last in red |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
| loading | string | Wordswhat the page says while the tool answers ("Loading the media library") |
| selectLabel | string | Wordswhat 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).
| 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 |
| asset | a picture’s address as your app serves it |
| 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:
folders[],upload,open,detailActions[] - Reads
filesfrom 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.