Skip to content
See live

Divider

Material's divider, which Filament has no component for. Everywhere else the theme restyles markup Filament already renders; here there is none, so the rule ships as a schema component of its own. Default variant: full width.

Three dividers between lines of text: one edge to edge, one indented at the leading edge, one indented at bothThree dividers between lines of text: one edge to edge, one indented at the leading edge, one indented at both
php
use Saade\FilamentMaterialTheme\Schemas\Components\Divider;

Divider::make();

A 1dp rule in the outline-variant color, with no margin of its own.

Variants

VariantMaterial nameModifierInset
Full widthFull-width dividernonenone
InsetInset divider->inset()16dp at the leading edge
Middle insetMiddle-inset divider->middleInset()16dp at both
php
Divider::make();                 // edge to edge
Divider::make()->inset();        // indented at the leading edge
Divider::make()->middleInset();  // indented at both

An inset divider lines up with the text of the list it divides, rather than with the container.

variant() takes the same set by name, and unlike the other variant methods in the theme it also takes a closure, evaluated when the schema renders:

php
use Saade\FilamentMaterialTheme\Enums\DividerVariant;

Divider::make()->variant(DividerVariant::Inset);
Divider::make()->variant('inset');
Divider::make()->variant(fn (): string => $this->isCompact ? 'inset' : 'full-width');
CaseValue
DividerVariant::FullWidthfull-width
DividerVariant::Insetinset
DividerVariant::MiddleInsetmiddle-inset

Behavior

The component spans the whole row, since a rule that stops at a column edge is a border. It renders its own markup rather than a Blade view, so it costs a single <hr>.

Everything a schema component takes applies as usual:

php
Divider::make()
    ->visible(fn (): bool => $this->hasSections)
    ->extraAttributes(['class' => 'my-4']);

API

MethodArgumentsResult
make()A full-width divider
inset()Indents the rule at the leading edge
middleInset()Indents it at both
variant(DividerVariant|string|Closure)Case, value or closureAny of the three by name
getVariant()The resolved DividerVariant