Text entry
Introduction
Text entries display simple text:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('title')

Customizing the color
You may set a color for the text:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('status')
->color('primary')
As well as allowing a static value, the color() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |

Adding an icon
Text entries may also have an icon:
use Filament\Infolists\Components\TextEntry;
use Filament\Support\Icons\Heroicon;
TextEntry::make('email')
->icon(Heroicon::Envelope)
The icon() method also accepts a function to dynamically calculate the icon. You can inject various utilities into the function as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |
You may set the position of an icon using iconPosition():
use Filament\Infolists\Components\TextEntry;
use Filament\Support\Enums\IconPosition;
use Filament\Support\Icons\Heroicon;
TextEntry::make('email')
->icon(Heroicon::Envelope)
->iconPosition(IconPosition::After) // `IconPosition::Before` or `IconPosition::After`
The iconPosition() method also accepts a function to dynamically calculate the icon position. You can inject various utilities into the function as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |
The icon color defaults to the text color, but you may customize the icon color separately using iconColor():
use Filament\Infolists\Components\TextEntry;
use Filament\Support\Icons\Heroicon;
TextEntry::make('email')
->icon(Heroicon::Envelope)
->iconColor('primary')
The iconColor() method also accepts a function to dynamically calculate the icon color. You can inject various utilities into the function as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |
Displaying as a "badge"
By default, text is quite plain and has no background color. You can make it appear as a "badge" instead using the badge() method. A great use case for this is with statuses, where may want to display a badge with a color that matches the status:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('status')
->badge()
->color(fn (string $state): string => match ($state) {
'draft' => 'gray',
'reviewing' => 'warning',
'published' => 'success',
'rejected' => 'danger',
})

You may add other things to the badge, like an icon.
Optionally, you may pass a boolean value to control if the text should be in a badge or not:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('status')
->badge(FeatureFlag::active())
As well as allowing a static value, the badge() method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |
Formatting
When using a text entry, you may want the actual outputted text in the UI to differ from the raw state of the entry, which is often automatically retrieved from an Eloquent model. Formatting the state allows you to preserve the integrity of the raw data while also allowing it to be presented in a more user-friendly way.
To format the state of a text entry without changing the state itself, you can use the formatStateUsing() method. This method accepts a function that takes the state as an argument and returns the formatted state:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('status')
->formatStateUsing(fn (string $state): string => __("statuses.{$state}"))
In this case, the status column in the database might contain values like draft, reviewing, published, or rejected, but the formatted state will be the translated version of these values.
The function passed to formatStateUsing() can inject various utilities as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |
Date formatting
Instead of passing a function to formatStateUsing(), you may use the date(), dateTime(), and time() methods to format the entry's state using PHP date formatting tokens:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('created_at')
->date()
TextEntry::make('created_at')
->dateTime()
TextEntry::make('created_at')
->time()

You may customize the date format by passing a custom format string to the date(), dateTime(), or time() method. You may use any PHP date formatting tokens:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('created_at')
->date('M j, Y')
TextEntry::make('created_at')
->dateTime('M j, Y H:i:s')
TextEntry::make('created_at')
->time('H:i:s')
As well as allowing static values, the date(), dateTime(), and time() methods also accept a function to dynamically calculate the format. You can inject various utilities into the function as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |
Date formatting using Carbon macro formats
You may use also the isoDate(), isoDateTime(), and isoTime() methods to format the entry's state using Carbon's macro-formats:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('created_at')
->isoDate()
TextEntry::make('created_at')
->isoDateTime()
TextEntry::make('created_at')
->isoTime()
You may customize the date format by passing a custom macro format string to the isoDate(), isoDateTime(), or isoTime() method. You may use any Carbon's macro-formats:
use Filament\Infolists\Components\TextEntry;
TextEntry::make('created_at')
->isoDate('L')
TextEntry::make('created_at')
->isoDateTime('LLL')
TextEntry::make('created_at')
->isoTime('LT')
As well as allowing static values, the isoDate(), isoDateTime(), and isoTime() methods also accept a function to dynamically calculate the format. You can inject various utilities into the function as parameters.
Learn more about utility injection.| Utility | Type | Parameter | Description |
|---|---|---|---|
| Entry | Filament\Infolists\Components\Entry | $component | The current entry component instance. |
| Get function | Filament\Schemas\Components\Utilities\Get | $get | A function for retrieving values from the current schema data. Validation is not run on form fields. |
| Livewire | Livewire\Component | $livewire | The Livewire component instance. |
| Eloquent model FQN | ?string<Illuminate\Database\Eloquent\Model> | $model | The Eloquent model FQN for the current schema. |
| Operation | string | $operation | The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>. |
| Eloquent record | ?Illuminate\Database\Eloquent\Model | $record | The Eloquent record for the current schema. |
| State | mixed | $state | The current value of the entry. |
Relative date formatting
You may use the since() method to format the entry's state using Carbon's diffForHumans():
use Filament\Infolists\Components\TextEntry;
TextEntry::make('created_at')
->since()





