Documentation Index
Fetch the complete documentation index at: https://mintlify.com/filamentphp/filament/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Text entries display simple text from your data source. They are the most commonly used entry type in infolists.
use Filament\Infolists\Components\TextEntry;
TextEntry::make('title')
Available Methods
Format the entry’s state using a custom closure. The closure receives the state and can return a formatted value.TextEntry::make('status')
->formatStateUsing(fn (string $state): string => __("statuses.{$state}"))
Format the entry as a date using PHP date formatting tokens.TextEntry::make('created_at')
->date('M j, Y')
Format the entry as a date and time.TextEntry::make('created_at')
->dateTime('M j, Y H:i:s')
Format the entry as a time.TextEntry::make('created_at')
->time('H:i:s')
Format the entry as a relative time (e.g., “2 hours ago”).TextEntry::make('created_at')
->since()
Format the entry as a money value with currency.TextEntry::make('price')
->money('USD')
Format the entry as a number with optional decimal places.TextEntry::make('stock')
->numeric(decimalPlaces: 2)
Render the entry as Markdown.TextEntry::make('description')
->markdown()
Render the entry as HTML.TextEntry::make('content')
->html()
Appearance
Set the text color.TextEntry::make('status')
->color(fn (string $state): string => match ($state) {
'draft' => 'gray',
'published' => 'success',
})
Add an icon to the entry.use Filament\Support\Icons\Heroicon;
TextEntry::make('email')
->icon(Heroicon::Envelope)
Set the icon color separately from the text color.TextEntry::make('email')
->icon(Heroicon::Envelope)
->iconColor('primary')
Set the icon position (before or after the text).use Filament\Support\Enums\IconPosition;
TextEntry::make('email')
->icon(Heroicon::Envelope)
->iconPosition(IconPosition::After)
Display the text as a badge with a background color.TextEntry::make('status')
->badge()
->color(fn (string $state): string => match ($state) {
'draft' => 'gray',
'published' => 'success',
})
Set the text size.use Filament\Support\Enums\TextSize;
TextEntry::make('title')
->size(TextSize::Large)
Set the font weight.use Filament\Support\Enums\FontWeight;
TextEntry::make('title')
->weight(FontWeight::Bold)
Set the font family.use Filament\Support\Enums\FontFamily;
TextEntry::make('code')
->fontFamily(FontFamily::Mono)
Lists
Display array values with line breaks between items.TextEntry::make('authors.name')
->listWithLineBreaks()
Display array values as a bulleted list.TextEntry::make('authors.name')
->bulleted()
Limit the number of items displayed in a list.TextEntry::make('tags')
->badge()
->limitList(3)
Allow users to expand a limited list to see all items.TextEntry::make('tags')
->listWithLineBreaks()
->limitList(3)
->expandableLimitedList()
Split a single value into multiple list items using a separator.TextEntry::make('tags')
->badge()
->separator(',')
Text Manipulation
Limit the character length of the text.TextEntry::make('description')
->limit(50)
Limit the word count of the text.TextEntry::make('description')
->words(10)
Limit the text to a specific number of lines.TextEntry::make('description')
->lineClamp(2)
Control whether text wraps to the next line.TextEntry::make('code')
->wrap(false)
Make the text copyable to clipboard on click.TextEntry::make('api_key')
->copyable()
->copyMessage('Copied!')
->copyMessageDuration(1500)
Add a prefix before the text.TextEntry::make('price')
->prefix('$')
Add a suffix after the text.TextEntry::make('temperature')
->suffix('°C')
Relationship Aggregation
Display the average of a relationship field.TextEntry::make('users_avg_age')
->avg('users', 'age')
Display the count of related records.TextEntry::make('users_count')
->counts('users')
Display the maximum value of a relationship field.TextEntry::make('users_max_age')
->max('users', 'age')
Display the minimum value of a relationship field.TextEntry::make('users_min_age')
->min('users', 'age')
Display the sum of a relationship field.TextEntry::make('orders_sum_total')
->sum('orders', 'total')
Examples
Status Badge with Color
TextEntry::make('status')
->badge()
->color(fn (string $state): string => match ($state) {
'draft' => 'gray',
'reviewing' => 'warning',
'published' => 'success',
'rejected' => 'danger',
})
TextEntry::make('price')
->money('EUR', divideBy: 100)
->label('Price')
Author List
TextEntry::make('authors.name')
->listWithLineBreaks()
->limitList(3)
->expandableLimitedList()
API Key with Copy
TextEntry::make('api_key')
->label('API Key')
->fontFamily(FontFamily::Mono)
->copyable()
->copyMessage('API key copied to clipboard!')