Button

Buttons with variants, icons, loading states, confirmation dialogs, and ripple effects.

Variants

JavaScript Initialisation

Click a button to see output...
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->button($id, $text)string, stringCreate a button component.
->primary()Apply primary (blue) styling.
->secondary()Apply secondary styling.
->danger()Apply danger (red) styling.
->success()Apply success (green) styling.
->block()Make the button full-width.
->loading()Show a loading spinner.
->icon($icon)stringSet a Font Awesome icon.
->type($type)stringSet the button type: button, submit, reset.
->name($name)stringSet the name attribute.
->confirm($message)stringShow a browser confirm dialog before the click fires.
->on($event, $handler)string, stringAttach a JS event handler.

JS JS Methods

Method / PropertyParametersDescription
m.button(id, options)string, ?objectInitialise or get a button instance.
enable()Remove the disabled state.
disable()Add the disabled state.
setText(text)stringUpdate button text (preserves icon).
setLoading(loading)booleanToggle loading spinner and disable state.
icon(faName, position)string, stringSet or replace the icon. Position: "left" or "right".

EVENT Events

Event NameDetailDescription
clickStandard DOM click event. Includes ripple animation.