Skip to content
See live

Buttons

An Action renders as a Material button. Default variant: filled.

Filled, tonal, elevated, outlined and text buttons side by sideFilled, tonal, elevated, outlined and text buttons side by side

Variants

VariantMaterial nameModifierNotes
FilledFilled button->filledButton()The default
TonalFilled tonal button->tonal()
ElevatedElevated button->elevated()Carries a shadow, and raises it on hover
OutlinedOutlined button->outlined()Filament's own method
TextText button->link()Filament's own method
FABFloating action button->fab()Turns on iconButton()
Extended FABExtended FAB->extendedFab()Turns on button()
php
use Filament\Actions\Action;

Action::make('save')->filledButton();
Action::make('draft')->tonal();
Action::make('export')->elevated();
Action::make('cancel')->outlined();
Action::make('learnMore')->link();

A plain Action::make() is already filled, so filledButton() is only needed to put a button back to filled when something else has changed it.

variant() takes the same set by name, for when the variant is data:

php
use Saade\FilamentMaterialTheme\Enums\ButtonVariant;

Action::make('save')->variant(ButtonVariant::Tonal);
Action::make('save')->variant('tonal');
CaseValueResolves to
ButtonVariant::FilledfilledA class
ButtonVariant::TonaltonalA class
ButtonVariant::ElevatedelevatedA class
ButtonVariant::OutlinedoutlinedFilament's outlined()
ButtonVariant::TexttextFilament's link()
ButtonVariant::FabfabiconButton() plus a class
ButtonVariant::ExtendedFabextended-fabbutton() plus a class

With an icon

The same five buttons, each with a leading plus iconThe same five buttons, each with a leading plus icon
php
use Filament\Support\Icons\Heroicon;

Action::make('create')->icon(Heroicon::OutlinedPlus)->filledButton();

The icon takes the label's color rather than Filament's gray.

Disabled

Filled, tonal, outlined and text buttons in their disabled stateFilled, tonal, outlined and text buttons in their disabled state
php
Action::make('publish')->filledButton()->disabled();

A disabled button that paints a container keeps one at 12% of the on-surface role, with its label at 38%. A text button, which paints nothing when enabled, paints nothing when disabled either. An outline is the exception Material makes: it holds its color in every state, disabled included.

Sizes

Five buttons from extra small to extra largeFive buttons from extra small to extra large
php
use Filament\Support\Enums\Size;

Action::make('xs')->size(Size::ExtraSmall);   // 28dp
Action::make('sm')->size(Size::Small);        // 32dp
Action::make('md');                           // 40dp, the default
Action::make('lg')->size(Size::Large);        // 48dp
Action::make('xl')->size(Size::ExtraLarge);   // 56dp

Not Material Expressive's ramp

Expressive publishes its own five sizes, from 32dp to 136dp, with 56dp as the medium. Adopting it outright would resize every button in the panel and put a 136dp button in a toolbar, so the ramp stays anchored on Filament's 40dp and takes its label styles from the type scale.

Colors

Filled buttons in primary, success, warning, danger, info and grayFilled buttons in primary, success, warning, danger, info and gray
php
Action::make('save')->color('primary');   // the default
Action::make('approve')->color('success');
Action::make('review')->color('warning');
Action::make('delete')->color('danger');
Action::make('details')->color('info');
Action::make('dismiss')->color('gray');
Action::make('other')->color('secondary');

Each name resolves to a Material role rather than to a Tailwind ramp: danger is the error role, gray is the surface and on-surface-variant pair, and secondary is Material's secondary role even though Filament ships no such color. success, warning and info are added by the theme. See theming.

Colors and variants compose, and each variant reads a different part of the role: filled takes the accent, tonal takes its container, outlined and text take the accent as ink.

The same six colors as tonal buttonsThe same six colors as tonal buttons
php
Action::make('approve')->color('success')->tonal();

Icon buttons

Standard, filled, tonal, elevated and outlined icon buttonsStandard, filled, tonal, elevated and outlined icon buttons
php
Action::make('favorite')->icon(Heroicon::OutlinedHeart)->iconButton();
Action::make('favorite')->icon(Heroicon::OutlinedHeart)->iconButton()->filledButton();
Action::make('favorite')->icon(Heroicon::OutlinedHeart)->iconButton()->tonal();
Action::make('favorite')->icon(Heroicon::OutlinedHeart)->iconButton()->elevated();
Action::make('favorite')->icon(Heroicon::OutlinedHeart)->iconButton()->outlined();

Standard is the default: no container, the icon on the on-surface-variant role. Sizes follow the button ramp, from 28dp through 40dp to 56dp.

Floating action buttons

Small, medium and large floating action buttons, then two extended onesSmall, medium and large floating action buttons, then two extended ones
php
Action::make('compose')->icon(Heroicon::OutlinedPlus)->fab();
Action::make('compose')->icon(Heroicon::OutlinedPlus)->fab()->size(Size::Small);
Action::make('compose')->icon(Heroicon::OutlinedPlus)->fab()->size(Size::Large);

fab() renders as an icon button, so it needs an icon(). It sits on the primary container role at elevation 3, and raises to 4 under the pointer.

size()FABHeightCorner
ExtraSmall, SmallSmall FAB40dpMedium
unset, MediumFAB56dpLarge
Large, ExtraLargeLarge FAB96dpExtra large

Extended

An extended floating action button with an icon and a labelAn extended floating action button with an icon and a label
php
Action::make('compose')
    ->label('Compose')
    ->icon(Heroicon::OutlinedPencil)
    ->extendedFab()
    ->color('info');

extendedFab() renders as a labeled button, so it needs both an icon() and a label().

Filament compatibility

Nothing in the theme replaces Filament's own button API. color(), size(), icon(), iconPosition(), badge(), badgeColor(), tooltip(), disabled(), hidden(), visible(), label(), link() and outlined() all behave as they do without the theme. Two of them are reinterpreted rather than changed:

Filament APIReinterpreted as
color()A Material role, not a Tailwind ramp
size()A Material height, with the label style from the type scale

badge() renders as a small pill on the button. See badges.

API

MethodOnResult
filledButton()Action, ActionGroupFilled
tonal()Action, ActionGroupFilled tonal
elevated()Action, ActionGroupElevated
fab()Action, ActionGroupFAB, rendered as an icon button
extendedFab()Action, ActionGroupExtended FAB, rendered as a labeled button
variant(ButtonVariant|string)Action, ActionGroupAny of the above by name

Registered on the base Action, so CreateAction, EditAction, BulkAction and the rest all inherit them. An ActionGroup takes the same set, since a group renders as a button too.

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.

Why filledButton() and not filled()

filled() is the section variant, registered on the schema component. The theme keeps the three filled variants apart by name: filledButton() on an action, filledField() on a field, filledBadge() on a column or entry.