Skip to main content

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

Formatting

formatStateUsing()
Closure
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}"))
date()
string|Closure|null
Format the entry as a date using PHP date formatting tokens.
TextEntry::make('created_at')
    ->date('M j, Y')
dateTime()
string|Closure|null
Format the entry as a date and time.
TextEntry::make('created_at')
    ->dateTime('M j, Y H:i:s')
time()
string|Closure|null
Format the entry as a time.
TextEntry::make('created_at')
    ->time('H:i:s')
since()
string|Closure|null
Format the entry as a relative time (e.g., “2 hours ago”).
TextEntry::make('created_at')
    ->since()
money()
string
Format the entry as a money value with currency.
TextEntry::make('price')
    ->money('USD')
numeric()
int|Closure|null
Format the entry as a number with optional decimal places.
TextEntry::make('stock')
    ->numeric(decimalPlaces: 2)
markdown()
bool|Closure
Render the entry as Markdown.
TextEntry::make('description')
    ->markdown()
html()
bool|Closure
Render the entry as HTML.
TextEntry::make('content')
    ->html()

Appearance

color()
string|array|Closure
Set the text color.
TextEntry::make('status')
    ->color(fn (string $state): string => match ($state) {
        'draft' => 'gray',
        'published' => 'success',
    })
icon()
string|Htmlable|Closure
Add an icon to the entry.
use Filament\Support\Icons\Heroicon;

TextEntry::make('email')
    ->icon(Heroicon::Envelope)
iconColor()
string|array|Closure
Set the icon color separately from the text color.
TextEntry::make('email')
    ->icon(Heroicon::Envelope)
    ->iconColor('primary')
iconPosition()
IconPosition
Set the icon position (before or after the text).
use Filament\Support\Enums\IconPosition;

TextEntry::make('email')
    ->icon(Heroicon::Envelope)
    ->iconPosition(IconPosition::After)
badge()
bool|Closure
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',
    })
size()
TextSize
Set the text size.
use Filament\Support\Enums\TextSize;

TextEntry::make('title')
    ->size(TextSize::Large)
weight()
FontWeight
Set the font weight.
use Filament\Support\Enums\FontWeight;

TextEntry::make('title')
    ->weight(FontWeight::Bold)
fontFamily()
FontFamily
Set the font family.
use Filament\Support\Enums\FontFamily;

TextEntry::make('code')
    ->fontFamily(FontFamily::Mono)

Lists

listWithLineBreaks()
bool|Closure
Display array values with line breaks between items.
TextEntry::make('authors.name')
    ->listWithLineBreaks()
bulleted()
bool|Closure
Display array values as a bulleted list.
TextEntry::make('authors.name')
    ->bulleted()
limitList()
int|Closure|null
Limit the number of items displayed in a list.
TextEntry::make('tags')
    ->badge()
    ->limitList(3)
expandableLimitedList()
bool|Closure
Allow users to expand a limited list to see all items.
TextEntry::make('tags')
    ->listWithLineBreaks()
    ->limitList(3)
    ->expandableLimitedList()
separator()
string|Closure
Split a single value into multiple list items using a separator.
TextEntry::make('tags')
    ->badge()
    ->separator(',')

Text Manipulation

limit()
int|Closure|null
Limit the character length of the text.
TextEntry::make('description')
    ->limit(50)
words()
int|Closure|null
Limit the word count of the text.
TextEntry::make('description')
    ->words(10)
lineClamp()
int|Closure|null
Limit the text to a specific number of lines.
TextEntry::make('description')
    ->lineClamp(2)
wrap()
bool|Closure
Control whether text wraps to the next line.
TextEntry::make('code')
    ->wrap(false)
copyable()
bool|Closure
Make the text copyable to clipboard on click.
TextEntry::make('api_key')
    ->copyable()
    ->copyMessage('Copied!')
    ->copyMessageDuration(1500)
prefix()
string|Htmlable|Closure
Add a prefix before the text.
TextEntry::make('price')
    ->prefix('$')
suffix()
string|Htmlable|Closure
Add a suffix after the text.
TextEntry::make('temperature')
    ->suffix('°C')

Relationship Aggregation

avg()
string|array
Display the average of a relationship field.
TextEntry::make('users_avg_age')
    ->avg('users', 'age')
counts()
string|array
Display the count of related records.
TextEntry::make('users_count')
    ->counts('users')
max()
string|array
Display the maximum value of a relationship field.
TextEntry::make('users_max_age')
    ->max('users', 'age')
min()
string|array
Display the minimum value of a relationship field.
TextEntry::make('users_min_age')
    ->min('users', 'age')
sum()
string|array
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',
    })

Formatted Money

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!')

Build docs developers (and LLMs) love