You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In these examples, the prime components are not associated with any other components in the schema, they are standalone.
57
+
Although text can be rendered in a schema using an [infolist text entry](../infolists/text), entries are intended to render a label-value detail about an entity (like an Eloquent model), and not to render arbitrary text. Prime components are more suitable for this purpose. Infolists can be considered more similar to [description lists](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl) in HTML.
56
58
57
59
Prime component classes can be found in the `Filament\Schemas\Components` namespace. They reside within the schema array of components.
58
60
59
-
Components may be created using the static `make()` method. Usually, you will then define the child component `schema()` to display inside:
60
-
61
-
```php
62
-
use Filament\Schemas\Components\Text;
63
-
64
-
Text::make()
65
-
```
66
-
67
61
## Available prime components
68
62
69
63
Filament ships with some prime components, suitable for arranging your components depending on your needs:
70
64
71
-
-[Grid](grid)
72
-
-[Section](section)
73
-
-[Tabs](tabs)
74
-
-[Wizard](wizard)
75
-
-[Fieldset](fieldset)
76
-
-[Split](split)
65
+
-[Text](text)
66
+
-[Icon](icon)
67
+
-[Image](image)
68
+
-[Unordered list](unordered-list)
69
+
-[Action](action)
77
70
78
-
You may also [create your own custom prime components](custom) to organize schemas however you wish.
71
+
You may also [create your own custom prime components](custom) to add your own arbitrary content to a schema.
79
72
80
73
## Adding extra HTML attributes to a prime component
81
74
82
75
You can pass extra HTML attributes to the component via the `extraAttributes()` method, which will be merged onto its outer HTML element. The attributes should be represented by an array, where the key is the attribute name and the value is the attribute value:
<UtilityInjectionset="formFields"version="4.x">As well as allowing a static value, the `extraAttributes()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
@@ -97,21 +90,18 @@ By default, calling `extraAttributes()` multiple times will overwrite the previo
97
90
The vast majority of methods used to configure entries accept functions as parameters instead of hardcoded values:
This alone unlocks many customization possibilities.
@@ -212,22 +202,22 @@ function (Request $request, Set $set) {
212
202
213
203
## Global settings
214
204
215
-
If you wish to change the default behavior of a component globally, then you can call the static `configureUsing()` method inside a service provider's `boot()` method, to which you pass a Closure to modify the component using. For example, if you wish to make all section components have [2 columns](grid) by default, you can do it like so:
205
+
If you wish to change the default behavior of a component globally, then you can call the static `configureUsing()` method inside a service provider's `boot()` method, to which you pass a Closure to modify the component using. For example, if you wish to make all images have a height of 12rem by default:
0 commit comments