Download the PHP package adzchappers/blade-components without Composer

On this page you can find all versions of the php package adzchappers/blade-components. 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 blade-components

Blade Components

Latest Version on Packagist Tests Pint Static Analysis Total Downloads

A set of javascript free Tailwind-styled Blade components for making building blade templates easier.

Features

Requirements

Installation

Install the package with composer:

Optionally publish the configuration file:

Tailwind CSS

The package's Blade views ship with Tailwind v4 utility classes. Add a @source directive to your CSS entry point so Tailwind scans the package views, and load the @tailwindcss/forms plugin:

Adjust the @source path to be relative to your CSS file's location within your project.

Configuration

After publishing, config/blade-components.php exposes two keys:

Usage

Form structure

x-form

Renders an HTML <form> tag. Automatically outputs a CSRF token and a spoofed method field when using PUT, PATCH, or DELETE. Normalises the method attribute to uppercase.

Prop Type Default Description
method string 'POST' HTTP method. Normalised to uppercase.
has-files bool false Adds enctype="multipart/form-data".

Additional attributes (e.g. class, action, id) are merged onto the <form> element.


x-form-fieldset

Wraps content in a <fieldset> with an optional <legend>. Supports disabling the entire group.

Prop Type Default Description
legend string\|null null Legend text. Omitted when not set.
disabled bool false Adds disabled aria-disabled="true".

Inputs

All input components share these behaviours: old-input repopulation, automatic error display, and ARIA attribute rendering. See Behaviours for details.

x-form-input

Renders a single <input> element wrapped in a <div> with an optional <label> and error message. Hidden inputs (type="hidden") render without the wrapper, label, or error.

Prop Type Default Description
name string - Field name. Required.
id string\|null null Element id. Auto-generated from name when not set.
label string\|null null Label text. No <label> rendered when omitted.
type string 'text' Input type (e.g. email, password, file, hidden).
placeholder string\|null null Placeholder text.
value string\|null null Initial value. Overridden by old input when present.
required bool false Adds required aria-required="true".
disabled bool false Adds disabled aria-disabled="true".
readonly bool false Adds readonly aria-readonly="true".
show-error bool true Renders the field error message. Set to false to suppress.

x-form-textarea

Renders a <textarea> with an optional <label> and error message.

Prop Type Default Description
name string - Field name. Required.
id string\|null null Element id. Auto-generated from name when not set.
label string\|null null Label text. No <label> rendered when omitted.
placeholder string\|null null Placeholder text.
value string\|null null Initial content. Overridden by old input when present.
required bool false Adds required aria-required="true".
disabled bool false Adds disabled aria-disabled="true".
readonly bool false Adds readonly aria-readonly="true".
show-error bool true Renders the field error message. Set to false to suppress.

x-form-select

Renders a <select> element with an optional <label> and error message.

Prop Type Default Description
name string - Field name. Required.
id string\|null null Element id. Auto-generated from name when not set.
label string\|null null Label text. No <label> rendered when omitted.
options array [] Associative array of value => label pairs.
selected string\|array\|null null Selected value(s). Overridden by old input when present.
multiple bool false Enables multi-select.
required bool false Adds required aria-required="true".
disabled bool false Adds disabled aria-disabled="true".
readonly bool false Adds readonly aria-readonly="true".
show-error bool true Renders the field error message. Set to false to suppress.

x-form-checkbox

Renders a single <input type="checkbox"> with an optional <label> and error message. Handles old-input correctly - if the form was previously submitted and the checkbox was unchecked, it stays unchecked. Whilst errors display as default on checkboxes, you might want to set them to false if you have a group of checkboxes and call the error manually so the errors aren't duplicated after every checkbox.

Prop Type Default Description
name string - Field name. Required.
id string\|null null Element id. Auto-generated from name when not set.
label string\|null null Label text. No <label> rendered when omitted.
value string\|null '1' The value submitted when checked.
checked bool false Whether the checkbox is initially checked.
required bool false Adds required aria-required="true".
disabled bool false Adds disabled aria-disabled="true".
readonly bool false Adds readonly aria-readonly="true".
show-error bool true Renders the field error message. Set to false to suppress.

x-form-radio

Renders a single <input type="radio"> with an optional <label>. Typically used inside an <x-form-fieldset> to group related options. Whilst errors display as default on radios, you might want to set them to false if you have a group of radios and call the error manually so the errors aren't duplicated after every radio.

Prop Type Default Description
name string - Field name. Required.
id string\|null null Element id. Auto-generated from name when not set.
label string\|null null Label text. No <label> rendered when omitted.
value string\|null '1' The value submitted when this option is selected.
checked bool false Whether this option is initially selected.
required bool false Adds required aria-required="true".
disabled bool false Adds disabled aria-disabled="true".
readonly bool false Adds readonly aria-readonly="true".
show-error bool true Renders the field error message. Set to false to suppress.

Supporting

x-form-label

Renders a <label> element. Used automatically by input components when label is set, but also available standalone for custom layouts.

Prop Type Default Description
for string - The id of the associated input. Required.
required bool false Appends a required indicator (*) to the label text.

x-form-button

Renders a <button> element. Validates the type attribute and falls back to submit for unrecognised values. When the slot is empty, the button renders the translatable string Submit as its label.

Prop Type Default Description
type string 'submit' Button type: submit, button, or reset.

x-form-error

Renders the first validation error message for a named field. Used automatically by input components, but also available standalone.

Prop Type Default Description
name string - Field name to look up. Supports array notation (e.g. items[0][name]). Required.
bag string 'default' The error bag to read from.

x-form-error-list

Renders all validation errors from an error bag as an unordered list. Useful at the top of a form to summarise every failure.

Prop Type Default Description
bag string 'default' The error bag to read from.

Behaviours

Old input repopulation

After a failed form submission, x-form-input, x-form-textarea, x-form-select, x-form-checkbox, and x-form-radio automatically call old() to restore the user's previous input. You do not need to write :value="old('field', $default)" manually.

x-form-checkbox handles the unchecked case correctly - HTML forms do not include unchecked checkboxes in the submission, so the component checks session()->hasOldInput() before deciding whether to restore state.

Automatic error display

Input components render an <x-form-error> for their field by default. To suppress it for a specific field, pass :show-error="false":

Use <x-form-error-list /> to render all errors in one place at the top of the form instead.

Method spoofing and CSRF

<x-form> outputs a CSRF token on every state-changing form (anything other than GET, HEAD, or OPTIONS). When method is PUT, PATCH, or DELETE, it also outputs a hidden _method field and sets the <form method="POST">, conforming to Laravel's method spoofing:

Array field names and dot notation

Field names written in array notation (e.g. items[0][name]) are automatically converted to dot notation (items.0.name) when looking up validation errors and old input. This means standard Laravel validation error keys work correctly for array fields:

Validation errors keyed as items.0.name, items.1.name, etc. will appear next to the correct field.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of blade-components with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0|^13.0
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 adzchappers/blade-components contains the following files

Loading the files please wait ...