Skip to main content
CoverCard ← Back to Table of Contents

Summary

Media card for hero banners, product tiles, and call-to-action blocks. Supports background images, gradients, or solid colors, with optional top/footer copy and a footer action button.
ClassBjanczak\FilamentFlexFields\Filament\Schemas\Components\CoverCard
StateNone — display/action component
Playgroundcover-card slug in Flex Fields playground
ExtendsFilament\Schemas\Components\Component

Basic usage

Portrait product card

use Bjanczak\FilamentFlexFields\Filament\Schemas\Components\CoverCard;
use Bjanczak\FilamentFlexFields\Filament\Actions\Action;

CoverCard::make()
    ->backgroundImage('https://example.com/yacht.jpg')
    ->ratio('3:4')
    ->topTitle('Azimut 55 Fly')
    ->footerTitle('From €4,900 / week')
    ->footerAction(
        Action::make('book')->label('Book now')
    );

Full-width cinematic banner

CoverCard::make()
    ->backgroundImage('https://example.com/harbor.jpg')
    ->ratio('21:9')
    ->tone('light')
    ->fullWidth()
    ->columnSpanFull()
    ->topTitle('Charter Season 2026')
    ->footerTitle('Early Booking Discount')
    ->footerDescription('Save 15% before March');

Configuration API

All methods accept Closure unless noted.
MethodTypeDefaultDescription
backgroundImage(string|Closure|null $url)BackgroundnullCover image URL. Sanitized via SafeMediaUrl.
backgroundGradient(string|Closure|null $css)BackgroundnullCSS gradient string (used if no image is set).
backgroundColor(string|Closure|null $color)BackgroundnullFallback / underlay color.
backgroundPosition(string|Closure $pos)Background'center'CSS background-position.
ratio(string|Closure|null $ratio)Layout'3:4'Aspect ratio (e.g., 16:9, 1:1, auto).
fullWidth(bool|Closure $condition = true)LayoutfalseRemoves the default 20rem max-width constraint.
contentMaxWidth(string|Closure $width)LayoutnullCustom max-width when not full width.
topTitle(string|Closure $text)ContentnullHeader title text.
topDescription(string|Closure $text)ContentnullHeader description text.
footerTitle(string|Closure $text)ContentnullFooter title text.
footerDescription(string|Closure $text)ContentnullFooter description text.
footerAction(Action|Closure $action)ContentnullFilament Action rendered as a pill CTA.
tone(string|Closure $tone)Appearance'dark'Text/scrim variant: dark or light.
radius(string|Closure $radius)Appearance'xl'Corner radius: md, lg, xl, 2xl.
contentOverlays(bool|Closure $on)AppearancefalseEnables separate top/bottom gradient overlays.
topOverlayGradient(string $css)AppearancenullCustom CSS gradient for top overlay.
footerOverlayGradient(string $css)AppearancenullCustom CSS gradient for bottom overlay.

Public helper methods

MethodReturnsDescription
getAspectRatioStyle()?stringResolved CSS aspect-ratio value.
getBackgroundStyles()arrayInline style fragments for the background layer.
hasTopContent()boolWhether top copy blocks are filled.
hasFooterContent()boolWhether footer copy or action exists.

Real-world examples

Gradient feature strip

CoverCard::make()
    ->backgroundGradient('linear-gradient(90deg, #4c1d95 0%, #be185d 100%)')
    ->ratio('3:1')
    ->tone('light')
    ->fullWidth()
    ->footerTitle('Premium Features')
    ->footerDescription('Unlock advanced analytics and reporting');

Vertical card in a grid

CoverCard::make()
    ->backgroundImage($product->image_url)
    ->ratio('9:16')
    ->contentMaxWidth('16rem')
    ->footerTitle($product->name)
    ->footerDescription($product->price_formatted)
    ->footerAction(Action::make('view')->label('View details'));

Playground

/admin/flex-fields-playground/cover-card See Playground for setup.
ComponentWhen to use instead
ItemCardFor standard list rows with icons and descriptions.
ItemCardGroupTo group multiple item cards in a shared container.
ProgressCircleWhen the card should focus on a progress metric.

CSS classes (reference)

ClassRole
fff-cover-cardRoot card container
fff-cover-card--tone-{dark|light}Text contrast variant
fff-cover-card--radius-{md|lg|xl|2xl}Corner radius variant
is-full-widthFull width modifier
fff-cover-card__backgroundBackground image/color layer
fff-cover-card__scrimGlobal gradient overlay
fff-cover-card__overlay--topTop-specific gradient overlay
fff-cover-card__overlay--bottomBottom-specific gradient overlay
fff-cover-card__contentCopy and action container
fff-cover-card__footer-actionAction button wrapper