Skip to content

Button

A link that is styled to look like a button.

Example

php
use Flowframe\Brief\Components\Html;
use Flowframe\Brief\Components\Body;
use Flowframe\Brief\Components\Button;

Html::make(
    Body::make(
        Button::make('Click me!')
            ->href('https://klopstra.me')
            ->target('_blank')
    )
);

Implements

Allows a component to link to an url.

php
interface LinkInterface
{
    /**
     * Set the link href.
     */
    public function href(string $href): static;

    /**
     * Set the link target.
     */
    public function target(string $target): static;

    /**
     * Get the link href.
     */
    public function getHref(): string;
}

Styles Interface

Allows a component to receive styles.

php
interface StylesInterface
{
    /**
     * Style the component.
     */
    public function style(Styles $styles): static;

    /**
     * Get the component styles.
     */
    public function getStyles(): Styles;
}

Component Interface

Allows a components to have childeren and render HTML.

php
interface ComponentInterface
{
    /**
     * Make a new component instance.
     */
    public static function make(ComponentInterface|VoidComponentInterface|string ...$children): static;

    /**
     * Get the children of the component.
     */
    public function getChildren(): array;

    /**
     * Render the component.
     */
    public function render(?string $slot = null): string;
}

Released under the MIT License.