Skip to main content Skip to navigation

Components: DataList

How to use

Displays a list of data. Accepts an optional title, and a list of rows. For each row, pass both a label and a value, which can be a string or a component instance.

DataList::make()
    ->title('About')
    ->row('Bio', $speaker->bio)
    ->row('URL', $speaker->url)
    ->row('Phone', Text::make($speaker->origin)->icon('phone')),

Available methods

title(?string $title): static

Set the title.

DataList::make()
    ->title('About');

row(string|Component $term, string|Component $definition): static

Add a row.

DataList::make()
    ->row('Url', 'https://hiker.dev')
    ->row('Contact', Btn::make()->label('Contact'));

Inherited methods

The DataList component extends the base component and inherits all of its methods.