Introduction
Text columns display simple text based on the column’s state:Formatting the text
Date formatting
You can format date values using thedate(), dateTime(), and time() methods:
string
The PHP date format string.
Number formatting
You can format a column as a number usingnumeric():
int
default:"0"
The number of decimal places.
string
default:"app locale"
The locale for number formatting.
Money formatting
You can easily format money values:string
required
The currency code (e.g., ‘EUR’, ‘USD’).
int
default:"1"
Divide the value before formatting (useful for cents).
Customizing the appearance
Color
You may set a color for the text:string | Closure
The color name or a closure that returns a color.
Displaying as a badge
You can display text as a badge:bool | Closure
default:"true"
Whether to display as a badge.
Adding an icon
Text columns may have an icon:string | BackedEnum | Htmlable | Closure
The icon to display.
IconPosition | Closure
default:"IconPosition::Before"
The position of the icon (Before or After).
string | array | Closure
The color of the icon.
Text size
You can customize the text size:ExtraSmall, Small, Medium, Large.
TextSize | string | Closure
The text size.
Font weight
Customize the font weight:Thin, ExtraLight, Light, Medium, SemiBold, Bold, ExtraBold, Black.
FontWeight | string | Closure
The font weight.
Font family
You can change the font family:Sans, Serif, Mono.
FontFamily | string | Closure
The font family.
Working with lists
Listing multiple values
If your column state is an array, values will be comma-separated by default. You can display them on separate lines:bool | Closure
default:"true"
Whether to display list items on separate lines.
Adding bullet points
You can add bullet points to list items:Limiting the list
Limit the number of values displayed:int | Closure
default:"3"
The maximum number of items to display.
Handling long text
Limiting text length
Limit the number of characters:int | Closure
The maximum number of characters.
string | Closure
default:"'...'"
The string to append when text is truncated.
Limiting word count
Limit the number of words:int | Closure
The maximum number of words.
Wrapping text
By default, text will not wrap. Enable wrapping:Line clamping
Limit text to a specific number of lines:int | Closure
The maximum number of lines to display.
Making text copyable
Allow users to copy text to clipboard:bool | Closure
default:"true"
Whether the text should be copyable.
string | Closure
default:"'Copied'"
The message to display when copied.
int | Closure
default:"2000"
How long to show the message (milliseconds).
Additional methods
Row index
Display the row index:bool
default:"false"
Whether to start counting from zero.
Description
Add a description below the column content:string | Htmlable | Closure
The description text.
string
default:"'below'"
Position of the description (‘above’ or ‘below’).