Skip to content

Text Column

Comprehensive guide to using TextColumn for displaying and formatting text data in your tables.

Text columns display simple text from your data source. They can be formatted, styled, and configured for various interactions like searching, sorting, and copying.

use Egmond\InertiaTables\Columns\TextColumn;
TextColumn::make('name')

Add text before or after the column value:

TextColumn::make('price')
->prefix('$')
->suffix(' USD')
// Will display: $29.99 USD

Limit the number of characters displayed:

TextColumn::make('description')
->limit(50)
// Long text will be truncated with "..."

If you’d like your text to wrap if it’s too long, you can use the wrap() method:

TextColumn::make('title')
->wrap()

Display values as styled badges:

TextColumn::make('status')
->badge()
->badgeVariant('secondary')

Available badge variants:

  • default
  • secondary
  • destructive
  • outline

Allowing text to be copied to the clipboard

Section titled “Allowing text to be copied to the clipboard”

Enable users to copy column values:

TextColumn::make('email')
->copyable()
  • Actions - Add interactive actions to your tables