Skip to content

Translations, theming and RTL ​

Translations ​

English (en) and Arabic (ar) ship with the package. Each is one file, media-library.php, in the filament-media-library namespace.

Publish them to edit the wording:

bash
php artisan vendor:publish --tag=filament-media-library-translations

The files land in lang/vendor/filament-media-library/{locale}/media-library.php. Laravel merges your copy over the package, so you can keep only the keys you change.

Add a language ​

Copy the English file and translate the values. Keep the keys, the :placeholders and the pluralisation syntax.

bash
mkdir -p lang/vendor/filament-media-library/fr
cp lang/vendor/filament-media-library/en/media-library.php lang/vendor/filament-media-library/fr/media-library.php

Panel users see the library in the locale your app uses for that request. Plural strings use Laravel's {1} … |[2,*] … form, for example item_count. Upload and validation messages live under errors and client, so translators see them in the same file.

Right-to-left ​

Arabic switches the library to a right-to-left layout with no setup. The layout follows the document direction that Filament sets for the locale, so any RTL locale you add works the same way. The sidebar, breadcrumbs, folder carets, bulk bar and lightbox arrows mirror. File sizes, dimensions and numbers stay left-to-right so they read correctly inside Arabic text.

The media library in Arabic with a right-to-left layout
The library in Arabic. The sidebar moves to the right and icons that point forward flip.

Theming ​

The library ships its own compiled CSS, loaded only on pages that use it. You do not add a Tailwind @source line or a @import to your Filament theme.

It reads Filament's color tokens, so it inherits your panel's primary, danger, success and warning colors, your fonts and your dark mode. Primary buttons take their classes from Filament's button color system, so the text color follows Filament's contrast logic for your primary color, in light and dark mode. If you change ->colors([...]) on the panel, the library follows.

Tokens ​

All tokens start with --fml-. They are declared on .fml, .fml-field, .fml-cell-files, .fml-file-list, .fml-gallery and .fml-field-preview, with dark values under .dark.

TokenUse
--fml-surface, --fml-surface-raisedMain and raised backgrounds.
--fml-rail, --fml-sunkenSidebar and recessed areas.
--fml-line, --fml-line-strongBorders and dividers.
--fml-text, --fml-text-2, --fml-text-3Primary, secondary and muted text.
--fml-hover, --fml-pressHover and pressed backgrounds.
--fml-accent, --fml-accent-textAccent fill and accent text. Derived from --primary-*.
--fml-accent-soft, --fml-accent-lineSelected backgrounds and outlines.
--fml-focusFocus ring color.
--fml-danger, --fml-success, --fml-warningStatus colors.
--fml-shadow-sm, --fml-shadow-lgElevation.
--fml-radius, --fml-radius-smCorner radii.
--fml-tile-sizeGrid tile size. Set by the tileSize option.
--fml-easeEasing curve for transitions.
--fml-checker-a, --fml-checker-bThe transparency checkerboard behind images.
--fml-type-colorPer-file-type accent for badges.

Override tokens ​

Add your overrides to your Filament theme CSS. Match the selector so yours wins, and set dark values separately:

css
.fml,
.fml-field,
.fml-gallery {
    --fml-radius: 0.375rem;
    --fml-surface: #fafaf9;
}

.dark .fml,
.dark .fml-field,
.dark .fml-gallery {
    --fml-surface: #0c0a09;
}

To change the accent, change the panel's primary color rather than --fml-accent, so buttons, focus rings and the rest of Filament stay consistent.

Commercial licence. One licence per production project. Terms · Privacy · Refunds