Skip to main content Skip to navigation

Components: HasComponents

How to use

Components that use this trait are able to render other components.

Available methods

components(?Iterable $components = null, $zone = 'components'): static

Registers components.

Component::make()
    ->components([
        Text::make(),
        Btn::make(),
    ])

addComponent(Component $component, $zone = 'components'): static

Adds a single component.

Component::make()
    ->addComponent(Btn::make())