Card
A content container with an optional header and footer. Cards automatically receive the
m-card-default style class, giving them a white background, border, rounded
corners, and a subtle shadow — no extra class needed.
Basic Card
A card with just body content.
This is the card body. Any HTML can go here.
Card with Title
Use ->title() to add a styled header section.
Card body with a title above it.
Card with Title, Subtitle & Footer
Combine ->title(), ->subtitle(), and ->footer()
for a fully-structured card.
Main content area. Add any HTML here — forms, lists, text, components.
Title with Icon
->title() accepts trusted HTML, so you can embed FA icons directly.
Body content here.
Section Headers
Use ->sectionHeader() to add divider rows with an optional "View all" link
before the card body. Call multiple times to add multiple sections.
Section content goes here.
Custom Classes
Extra classes can be added via ->addClass(). The m-card-default
style is always present; your class adds on top of it.
Body with a custom accent class applied.
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->card($id) | string | Create a card component. Automatically applies m-card and m-card-default. |
->title($html) | string | Set the card header title (trusted HTML, renders inside .m-card-header). |
->subtitle($html) | string | Set a subtitle shown below the title. |
->content($html) | string | Set the card body HTML. |
->footer($html) | string | Set the card footer HTML. |
->sectionHeader($title, $linkUrl, $linkText) | string, ?string, string | Add a section-header divider before the body, with an optional link. $linkText defaults to 'View all'. Call multiple times. |
->addClass($class) | string | Append additional CSS class(es) to the card element. |
->attr($name, $value) | string, string | Set an arbitrary HTML attribute on the card element. |