Row Links & Clickable Columns
Zonvoir Table can make an entire row clickable or attach navigation to individual columns.
Navigation is configured on the backend using the Url helper and rendered automatically by the frontend adapter.
Make a row clickable
Section titled “Make a row clickable”Define a rowUrl() method on your table to make each row navigate to a URL:
use App\Models\User;use Zonvoir\ZonvoirTable\Url;
public function rowUrl(User $user, Url $url): Url{ return $url->route('users.show', $user);}The callback receives the current record and a Url instance. Each row will resolve its own URL using the corresponding model.
/users/1/users/2/users/3Users can then click any part of the row to navigate to that record.
Preserve scroll
Section titled “Preserve scroll”Use preserveScroll() when the current scroll position should be maintained during Inertia navigation:
public function rowUrl(User $user, Url $url): Url{ return $url ->route('users.show', $user) ->preserveScroll();}Preserve state
Section titled “Preserve state”Use preserveState() when the current Inertia page state should be preserved:
public function rowUrl(User $user, Url $url): Url{ return $url ->route('users.show', $user) ->preserveScroll() ->preserveState();}URL options can be chained fluently:
return $url ->route('users.show', $user) ->preserveScroll() ->preserveState();Make a column clickable
Section titled “Make a column clickable”Sometimes you don’t want the entire row to be clickable. Use url() on an individual column instead:
use Zonvoir\ZonvoirTable\Columns\TextColumn;use Zonvoir\ZonvoirTable\Url;
TextColumn::make('name') ->url( fn (User $user, Url $url) => $url->route('users.show', $user) );Only the value rendered by that column will act as the link:
public function columns(): array{ return [ TextColumn::make('name') ->sortable() ->searchable() ->url( fn (User $user, Url $url) => $url->route('users.show', $user) ),
TextColumn::make('email') ->searchable(),
TextColumn::make('status'), ];}In this example, the user’s name is clickable while the rest of the row behaves normally.
Row links vs column links
Section titled “Row links vs column links”Use a row link when the record itself has a clear primary destination:
public function rowUrl(User $user, Url $url): Url{ return $url->route('users.show', $user);}Use a column link when only a specific value should navigate somewhere:
TextColumn::make('name') ->url( fn (User $user, Url $url) => $url->route('users.show', $user) );Both approaches use the same Url helper, so navigation behavior remains consistent throughout your tables.
URL options
Section titled “URL options”The Url helper can carry additional navigation behavior used by the frontend adapter:
- Target (
_blank, etc.) - HTTP method (GET, POST, DELETE)
- Preserve scroll (
preserveScroll()) - Preserve state (
preserveState()) - Download attribute
- Modal navigation
- Prefetching
- Disabled state
- Hidden state
For the complete list of available methods and arguments, see the Url API Reference.
Related guides
Section titled “Related guides”- Row Actions — Action buttons, menus, and confirmation dialogs.
- Typed Columns — Formatting and configuring column properties.
- Configuration API —
Urlvalue object reference and options.