PHPackages                             ilbronza/buttons - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ilbronza/buttons

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ilbronza/buttons
================

buttons

0255PHP

Since Mar 31Pushed 1w ago2 watchersCompare

[ Source](https://github.com/ilBronza/buttons)[ Packagist](https://packagist.org/packages/ilbronza/buttons)[ RSS](/packages/ilbronza-buttons/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

IlBronza/Buttons
================

[](#ilbronzabuttons)

[![Latest Version on Packagist](https://camo.githubusercontent.com/75783861e1c574ccffb0f0c9f83cca413508e08dce1b0409a4bf50b0cfa4a55b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c62726f6e7a612f627574746f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ilbronza/buttons)[![Total Downloads](https://camo.githubusercontent.com/0406342058f8c7b9841d6e9c9502c5acbc8ff088cef3c9c616d8d45b59ee9850/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c62726f6e7a612f627574746f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ilbronza/buttons)

Laravel package to build HTML buttons, dropdowns and navbars rendered with UIkit Blade views, with Font Awesome icons and role-gated rendering.

Part of the IlBronza package family: it depends on `IlBronza\CRUD`, `IlBronza\Form`, `IlBronza\Menu` and `IlBronza\UikitTemplate` and is not meant to be used standalone.

Installation
------------

[](#installation)

Via Composer

```
$ composer require ilbronza/buttons
```

The service provider is auto-discovered. Views and translations are registered under the `buttons::` namespace.

Usage
-----

[](#usage)

### Creating a button

[](#creating-a-button)

```
use IlBronza\Buttons\Button;

$button = Button::create([
    'href' => route('users.edit', $user),
    'translatedText' => 'Modifica',      // literal text
    'icon' => 'pen',                     // Font Awesome icon code
]);

echo $button->render();
```

Instead of `translatedText` you can pass `text` with a translation key: it will go through `trans()`. If an `href` is set the button renders as ``, otherwise as ``.

### Fluent styling

[](#fluent-styling)

```
$button->setPrimary();        // uk-button-primary
$button->setDanger();         // uk-button-danger
$button->setSmall();          // uk-button-small
$button->setHtmlClass('my-class');
$button->setDisabled();
$button->tooltip('Edit this user');
$button->setBlank();          // target="_blank"
$button->setReturnConfirm('Are you sure?');
```

### Dropdowns (children)

[](#dropdowns-children)

```
$button = Button::create([
    'text' => 'menu.actions',
    'children' => [
        ['href' => route('users.edit', $user), 'translatedText' => 'Modifica', 'icon' => 'pen'],
        ['href' => route('users.show', $user), 'translatedText' => 'Mostra', 'icon' => 'link'],
    ],
]);
```

Children can also be added with `addChild($button)`, `addChildFromArray($parameters)` or `addChildrenFromArray($arrays)`. Dropdown behavior can be tuned with `setDropdownMode('hover'|'click')`, `setDropdownColumns()` and `setChildrenPerColumn()`.

### Rendering variants

[](#rendering-variants)

```
$button->render();                    // standard UIkit button
$button->renderSubmit();              // submit button
$button->renderA();                   // plain anchor, no uk-button class
$button->navbarRender('horizontal');  // navbar item: horizontal, vertical or pdf
```

Rendering is role-gated through `IlBronza\CRUD`: if the current user lacks the required roles, the render methods return `null` and the button is simply not displayed.

### Default model buttons

[](#default-model-buttons)

```
use IlBronza\Buttons\Helpers\DefaultButtonsCreatorHelper;

DefaultButtonsCreatorHelper::getEditButton($model);
DefaultButtonsCreatorHelper::getShowButton($model);
```

### Icons

[](#icons)

Icons are Font Awesome, wrapped by `IlBronza\Buttons\Icons\FaIcon` (aliased as `FaIcon`):

```
FaIcon::check();          // green check
FaIcon::xmark();          // red xmark
FaIcon::inline('user');   // any icon code
```

Defaults (filling type, view type) live in `config/buttons.php`.

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Davide Bronzini](https://github.com/ilbronza)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

31

—

LowBetter than 65% of packages

Maintenance64

Regular maintenance activity

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/33c65523e8a1cdfe8ed5f5fb8d90101b28eceb8c2ef7acb50a24cf6c42b8e639?d=identicon)[ilBronza](/maintainers/ilBronza)

---

Top Contributors

[![bronza](https://avatars.githubusercontent.com/u/3426331?v=4)](https://github.com/bronza "bronza (38 commits)")[![ilBronza](https://avatars.githubusercontent.com/u/68387610?v=4)](https://github.com/ilBronza "ilBronza (7 commits)")[![lbortolon](https://avatars.githubusercontent.com/u/109848849?v=4)](https://github.com/lbortolon "lbortolon (2 commits)")

### Embed Badge

![Health badge](/badges/ilbronza-buttons/health.svg)

```
[![Health](https://phpackages.com/badges/ilbronza-buttons/health.svg)](https://phpackages.com/packages/ilbronza-buttons)
```

###  Alternatives

[docomoinnovations/cloud_orchestrator

Cloud orchestrator distribution by DOCOMO Innovations, Inc.

108.4k](/packages/docomoinnovations-cloud-orchestrator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
