Skip to content
Shamar

Media library

The media library is a file manager inside the panel, plus form fields that pick or upload a file stored there. It is optional. A panel that only edits text records never needs it. When you enable it, staff get folders, uploads, and public or private URLs, and your forms can use a file picker instead of asking for a raw path.

Files are not stored by core. The library needs an adapter that matches your database: Lucid models if you are on SQL, Mongoose models if you are on MongoDB. Those adapters are documented with the packages, SQL and MongoDB. This page is the screen and the panel option that turns it on.

Enable media on a panel to get a File Manager UI and FilePicker form fields.

File Manager — folders, uploads, visibility, and public URLs. Open `/demo/media` in the live sandbox.
panel('admin').media({
label: 'Files',
// Omit navigationGroup (or set '') for a top-level sidebar root.
// navigationGroup: 'System', // nest under an existing cluster
navigationIcon: 'folder', // also: files, media, photo, image, images
// disk / adapter / storage options per host docs
})
import { FilePicker } from '@shamar/core'
FilePicker.make('logoMediaId')
.image()
.makePublic()
.label('Logo')

Adapters under @shamar/mongoose / @shamar/lucid persist folders and files; public URLs can power login branding overrides.