Skip to content

API reference

Everything the theme adds. All of it is registered when the package boots, so there is nothing to import and nothing to register per component.

Index

MethodOnPurpose
filledButton()Action, ActionGroupFilled button
tonal()Action, ActionGroupFilled tonal button
elevated()Action, ActionGroup, ComponentElevated button, or elevated card
fab()Action, ActionGroupFloating action button
extendedFab()Action, ActionGroupExtended floating action button
splitButton()ActionGroupLeading action beside a menu of the rest
fabMenu()ActionGroupFAB opening its actions as separate buttons
bottomSheet()ActionModal docked to the bottom edge
outlined()Field, ComponentOutlined text field, or outlined card
filledField()FieldFilled text field
search()FieldSearch field
filled()ComponentFilled card
secondary()TabsSecondary tabs
filledBadge()Column, EntryFilled chip
outlinedBadge()Column, EntryOutlined chip
elevatedBadge()Column, EntryElevated chip
inset()DividerDivider indented at the leading edge
middleInset()DividerDivider indented at both edges
variant()All of the above classesAny variant of that component by name

Actions

Filament\Actions\Action

MethodArgumentsResultSee
filledButton()Filled buttonButtons
tonal()Filled tonal buttonButtons
elevated()Elevated buttonButtons
fab()FAB; turns on iconButton()Buttons
extendedFab()Extended FAB; turns on button()Buttons
variant(ButtonVariant|string)Case or valueAny button variant by nameButtons
bottomSheet(bool|Closure = true)Condition, per renderBottom sheet; turns on slideOver()Modals

Every one except bottomSheet() is registered on Filament\Actions\ActionGroup as well, since a group renders as a button. The group takes two of its own:

MethodResultSee
splitButton()Rearranges the group into a button group of two halvesGrouping
fabMenu()A FAB with a panel of separate buttons, opening upwardGrouping

Applied without being called: any action where isOutlined() is true is marked for the stylesheet, which is what makes an outlined icon button work, since Filament drops the flag when it renders one.

Fields

Filament\Forms\Components\Field

MethodResultSee
outlined()Outlined text field, the defaultText input
filledField()Filled text fieldText input
search()Search fieldSearch
variant(FieldVariant|string)Any field variant by nameText input

Written to the field wrapper with extraFieldWrapperAttributes(), merged rather than replaced.

Schema components

Filament\Schemas\Components\Component, which sections, fieldsets, fields, entries and stats all descend from

MethodResultSee
elevated()Elevated cardSections
filled()Filled cardSections
outlined()Outlined cardSections
variant(CardVariant|string)Any card variant by nameSections

Drawn on a Section, a Fieldset and a stats overview Stat. Elsewhere the class is set and nothing is drawn from it.

Tabs

Filament\Schemas\Components\Tabs

MethodResultSee
secondary()Secondary tabsTabs
variant(TabsVariant|string)Either tab variant by nameTabs

Columns and entries

Filament\Tables\Columns\Column and Filament\Infolists\Components\Entry

MethodResultSee
filledBadge()Filled chipBadges
outlinedBadge()Outlined chipBadges
elevatedBadge()Elevated chipBadges
variant(ChipVariant|string)Any chip variant by nameBadges

Written to the table cell with extraCellAttributes(), and to the entry wrapper with extraEntryWrapperAttributes().

Components the theme ships

Saade\FilamentMaterialTheme\Schemas\Components\Divider

MethodArgumentsResultSee
make()A full-width divider, spanning the rowDivider
inset()Indented at the leading edgeDivider
middleInset()Indented at bothDivider
variant(DividerVariant|string|Closure)Case, value or closureAny of the three by nameDivider
getVariant()The resolved DividerVariantDivider

Names that collide

Three sets would meet on the same name. Filament's macro lookup walks the closest parent first, so the narrower registration wins; where that would be ambiguous, the theme renames rather than relying on it:

Written asBecause
filledButton()Keeps the button apart from the card's filled() and the field's variant
filledField()filled() is already Filament's validation rule on a field
outlinedBadge(), filledBadge(), elevatedBadge()An Entry descends from the schema component, so a bare outlined() on one would resolve to an outlined card

outlined() and elevated() are deliberately shared: on a Field they mean the text field, on a Section the card, on an Action the button. Each resolves to the closest registration, so the call reads the same wherever it appears.

Enums

Saade\FilamentMaterialTheme\Enums

EnumCasesValues
ButtonVariantElevated, Filled, Tonal, Outlined, Text, Fab, ExtendedFabelevated, filled, tonal, outlined, text, fab, extended-fab
CardVariantElevated, Filled, Outlinedelevated, filled, outlined
ChipVariantFilled, Outlined, Elevatedfilled, outlined, elevated
FieldVariantFilled, Outlined, Searchfilled, outlined, search
TabsVariantPrimary, Secondaryprimary, secondary
DividerVariantFullWidth, Inset, MiddleInsetfull-width, inset, middle-inset

Every one is a backed string enum, and every variant() takes either the case or its value. Passing an unknown value throws, as from() does.

Three cases add nothing of their own: ButtonVariant::Outlined and ButtonVariant::Text resolve to Filament's outlined() and link(), and TabsVariant::Primary is a no-op. A variant held in a variable can therefore be any case without the calling code branching.

Plugin

Saade\FilamentMaterialTheme\FilamentMaterialThemePlugin

MethodArgumentDefaultEffect
make()Resolves the plugin from the container
source(string|Closure)Hex color#1B48A5The color the whole scheme is derived from
variant(string|Closure)One of nine namestonalSpotWhich derivation to use
contrast(float|Closure)-1 to 10.0Reduced through high contrast
primary(string|Closure|null)Hex colornull, derivedPins the primary accent, and takes over as the seed
secondary(string|Closure|null)Hex colornull, derivedPins the secondary accent
tertiary(string|Closure|null)Hex colornull, derivedPins the tertiary accent
icons(bool|Closure)ConditiontrueUses Material icons, when the set is installed
getScheme()The three resolved values as a MaterialScheme
hasIcons()Whether Material icons are wanted
getId()filament-material-theme

Closures are evaluated per request. See theming and icons.

The plugin registers one render hook, on PanelsRenderHook::HEAD_START, which prints the scheme for the browser runtime. It is deliberately unscoped: a panel id is not a valid render hook scope, and passing one silently drops the hook.

Scheme

Saade\FilamentMaterialTheme\Color\MaterialScheme

php
use Saade\FilamentMaterialTheme\Color\MaterialScheme;

MaterialScheme::make(
    source: '#6750A4',
    variant: 'tonalSpot',
    contrast: 0.0,
    primary: null,
    secondary: '#625B71',
    tertiary: null,
);

Immutable, with all six readable as properties, toArray() for the payload the browser receives, and MaterialScheme::DEFAULT_SOURCE for the fallback. A pinned accent that was not named is left out of toArray() entirely rather than sent as null, so the runtime can tell "derive this one" apart from a color.

PropertyTypeDefault
sourcestring#1B48A5
variantstringtonalSpot
contrastfloat0.0
primary?stringnull
secondary?stringnull
tertiary?stringnull

Browser runtime

APIPurpose
material-theme:updateA CustomEvent on document, carrying { source, scheme, contrast, primary, secondary, tertiary }
window.filamentMaterialThemeApply(scheme)The same, called directly

The call returns without doing anything unless a source or a primary is given.

See theming.

CSS

Custom properties, Tailwind utilities and the layers a panel is built from are documented under customization.