UI Components are the foundation of the Streams UI system. They encapsulate the structural properties, rendering, and logical behavior of UI such as forms, tables, and buttons.
Below is a complete list of all first-party UI components:
@foreach (Streams::entries('docs_ui')->where('category', 'components')->orderBy('sort', 'ASC')->orderBy('name', 'ASC')->get() as $entry)
There are a handful of ways to define UI components.
Stream components are configured within the stream definition.
// streams/contacts.json
{
// ...
"ui": {
"tables": {
"example": {
// ...
}
},
"forms": {
"example": {
// ...
}
}
}
}
You can use the ui
method to build the above configured UI component:
$table = Streams::make('contacts')->ui('tables.example');
$form = Streams::make('contacts')->ui('forms.example');
You can also instantiate UI components manually. In the below example, the provided stream
parameter would be all that is required. The rest, you may customize to your liking.
You may find that a component may require more fields if a
stream
parameter is not provided.
It is also important to note that components technically do not require a stream
parameter.
use Streams\Ui\Table\Table;
$table = new Table([
'stream' => $stream,
'columns' => [
// ...
],
]);
UI components are paired with corresponding Laravel Blade components which you may access manually in a similar manner.
@verbatim<x-table stream="contacts"/>@endverbatim
Each component documents its own configuration documentation.
You can use the control panel API to access any configured UI component for a stream.
GET|POST /cp/ui/{stream}/{component}/{handle?}
A blank TALL-stack Laravel project with Streams.
The fundamental features and utilities offered by the Streams platform.
A universal and extensible RESTful API for Streams.
Extensible, user-friendly, and performant control panel, components, and services.
Dev tooling for Laravel Streams.