Skip to content

Description list

DescriptionList::make() lays out label/value pairs for a single subject — the read-only counterpart to a form. Give it a record and each entry reads its own value from it:

Card::make('Account')->schema([
DescriptionList::make()->bleed()->record($user)->schema([
TextEntry::make('name'),
TextEntry::make('email')->copyable(),
DateEntry::make('joined_at', 'Joined')->style(DateTimeStyle::Long),
BooleanEntry::make('is_active', 'Active'),
]),
]);

An entry’s label defaults to its name in headline case (joined_atJoined at); pass a second argument to override it. The record may be an associative array, a keyed Collection, a model, or another object. Entry names use Laravel’s data_get(), so dotted paths such as profile.email work across those record types.

When the list has no record, it treats its entries as a row template and binds each value to the entry name through Lattice’s dataBindings. This lets the same list work inside a client-materialised schema. Use ->dataKey('value', 'profile.email') when the row path differs from the entry name.

Entry Renders
TextEntry The value as text. ->copyable() adds a copy affordance, ->placeholder('—') covers an empty value.
DateEntry A localised date. ->style(DateTimeStyle::…) or ->dateTime().
BooleanEntry A check or cross icon. ->icons($true, $false) swaps them.
BadgeEntry The value as a badge; ->color(…) tints it.
ComponentEntry Any component as the value — a stack, a segmented control, whatever the schema can express.

ComponentEntry is the escape hatch when a value is not a formatted scalar:

ComponentEntry::make('appearance', __('Theme'))
->value(SegmentedControl::make('appearance')->options([...])),

Rows are separated by hairlines; ->divided(false) turns them off. Inside a padded panel such as a Card the lines stop at the gutter — ->bleed() runs them to the panel edge while the rows stay aligned with the rest of its content.

An entry with ->disclosure([...]) turns its row into a toggle that reveals the content beneath it. The typical body is the form that edits the value the row displays:

Card::make('Login')->schema([
DescriptionList::make()->bleed()->schema([
TextEntry::make('email')->value('[email protected]'),
TextEntry::make('password')
->value('••••••••')
->disclosure([Form::use(PasswordForm::class)]),
]),
]);

->emptyLabel('No memberships yet') covers a list whose entries all resolved to nothing — building rows from a collection that turned out empty, for instance.