Download the PHP package davidgut/boson without Composer

On this page you can find all versions of the php package davidgut/boson. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package boson

Boson

Minimal, well-designed, flexible Laravel Blade components. Turbo-ready out of the box.

Requirements

Installation

The package auto-registers its service provider via Laravel's package discovery.

Include CSS & JS

Import the Boson stylesheet and script in your application's entry points:

Then compile your assets as usual with Vite (or your bundler of choice).

Usage

All components are available under the boson:: namespace:

Available Components

Accordion, Avatar, Badge, Button, Card, Checkbox, Combobox, Description, Dropdown, Error, Field, Form, Heading, Icon, Img, Input, Label, Link, Listbox, Modal, Navbar, Radio, Select, Separator, Spacer, Table, Tabs, Textarea, Toast.

Toasts

Add <x-boson::toast /> once in your layout. Then flash toasts from PHP or trigger them from JavaScript.

PHP. Flash via the Toast helper in controllers or middleware:

All methods accept an optional $heading and $duration (in ms, default 5000).

JavaScript. Trigger toasts client-side via the global $toast helper:

You can also dismiss a toast programmatically:

Async Forms

Add async to <x-boson::form> for JavaScript-powered submission. Response handling is automatic:

Controller returns Boson does
redirect('/dashboard') Navigates normally
response()->json(['data' => $model]) Updates all [data-field] elements in-place, resets the form, closes the parent modal
422 validation response Populates matching <x-boson::error> components

Without async, the form submits normally (Turbo handles it if installed, browser handles it otherwise).

GET forms send form data as URL query parameters automatically.

In-page updates support dot-notation for nested data:

Async Options (Combobox & Listbox)

Combobox and Listbox support loading options asynchronously via async="/url":

The endpoint should return a JSON array (or { data: [...] }). Each item should have value/id and label/name/text keys:

Prop Default Description
async — URL to fetch options from
async:param q Query parameter name
async:min 2 Minimum characters before fetching
async:debounce 300 Debounce delay in ms

Events

Boson provides a declarative event system via on: attributes. Write inline expressions directly in Blade:

Inside a handler, these helpers are available:

$event is the raw DOM event:

$data is shorthand for $event.detail.data (the response payload on form success):

$(selector) is a chainable DOM helper for updating page elements without a reload:

Available methods: .text(value), .class(name, force?), .data(key, value), .attr(key, value), .toggle().

$match(value, map, fallback?) is a value lookup, like PHP's match:

$toast triggers toast notifications:

this refers to the element that owns the on: attribute:

The system supports both native DOM events (click, submit, keydown, etc.) and custom Boson events (success, error, open, close, change, select, deselect).

Register custom events at runtime:

Component Data Attributes

All interactive Boson components follow a consistent data-controller / data-{name}-target convention:

Access component instances programmatically via el.boson:

Component Controller
Accordion accordion
Combobox combobox
Dropdown dropdown
Form form
Listbox listbox
Modal modal
Navlist navlist
Sidebar sidebar
Tabs tab
Toast toast

Turbo Compatibility

Turbo is entirely optional. Boson has no dependency on it and works perfectly without it. When Turbo Laravel is present, everything works seamlessly with zero configuration.

The internal lifecycle system automatically handles:

If your app doesn't use Turbo, nothing changes. Components initialize on DOMContentLoaded as usual.

Building custom components? Follow the same protocol to get Turbo compatibility for free:

Then in Blade:

Turbo Attributes

Link, Form, Button, Navbar Item, Navlist Item, and Breadcrumbs Item accept Turbo data attributes via the turbo: prop prefix. Each turbo:* prop maps to its data-turbo-* HTML attribute:

To disable Turbo on any of these components, use :turbo="false":

Prop HTML Output Description
:turbo="false" data-turbo="false" Disable Turbo on this element
turbo:frame data-turbo-frame Target a specific Turbo Frame
turbo:action data-turbo-action advance or replace history
turbo:preload data-turbo-preload Pre-fetch into cache
turbo:prefetch data-turbo-prefetch Control hover prefetching
turbo:stream data-turbo-stream Accept Turbo Stream responses
turbo:confirm data-turbo-confirm Show confirmation dialog
turbo:method data-turbo-method Override link request method
turbo:submits-with data-turbo-submits-with Text to show while submitting

AI Rules Generation

Boson can generate a compact .mdc context file containing all component documentation, props, and usage examples. Designed to be consumed by AI coding assistants.

This parses every Boson component's @description, @usage, and props, then writes a single boson.mdc file to your IDE's rules directory.

Options

Option Default Description
--ide= cursor Target IDE: cursor (writes to .cursor/rules/) or antigravity (writes to .agent/rules/)
--output= (auto) Custom output directory
--canary false Include a verification string to test context loading

The canary flag can also be enabled globally via the boson.rules.canary config option.

Publishing

Publish the config file:

Publish the views for customization:

License

MIT. See LICENSE for details.


All versions of boson with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0 || ^13.0
blade-ui-kit/blade-heroicons Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package davidgut/boson contains the following files

Loading the files please wait ...