Skip to content

Brand assets

Logo, favicon, and mobile-menu mark live in a locked cupboard, not in ordinary Media. Call createBrandAssets and point Theme at BRAND_ASSETS_SLUG.

Access matches createTheme. read defaults to public so the live site can load the file; pass a stricter function to tighten it. update defaults to canUseFeature("theme") — the same Roles grant that opens the Theme document — and covers create, update, delete, and version history.

SVG preferred, PNG and ICO allowed; an SVG is sanitized on upload. Versions stay on so a replaced file can be rolled back. Each row carries a label, usage notes, and required alt text so a logo has its accessible name.

import { BRAND_ASSETS_SLUG, createBrandAssets } from "@bison-lab/payload-core";
collections: [
createBrandAssets(),
];
// createTheme({ logo: { collection: BRAND_ASSETS_SLUG }, … })

Then payload migrate:create. See Theme for the identity fallback the live site uses when a slot is empty.