Table Builder Features
GoFilament’s Table Builder (pkg/tables) provides a high-performance, type-safe data grid with server-side pagination, sorting, filtering, bulk actions, and advanced client interactivity:
table := tables.New[*Customer]().
Toggleable(true). // Enable Column Show/Hide dropdown
Reorderable("sort_order"). // Enable Drag-and-Drop row reordering
Columns(
tables.TextColumn[*Customer]("id").Sortable(),
tables.TextColumn[*Customer]("name").Editable(true).Sortable(), // Inline editable on click
tables.SelectColumn[*Customer]("status").Options(map[string]string{
"active": "Active",
"inactive": "Inactive",
"pending": "Pending Review",
}), // Inline select dropdown
tables.ToggleColumn[*Customer]("is_verified"), // Interactive toggle switch
tables.TextColumn[*Customer]("email").Copyable(),
tables.TextColumn[*Customer]("notes").ToggledHiddenByDefault(true), // Hidden until toggled
).
Filters(
tables.SelectFilter("status").Options(map[string]string{
"active": "Active Only",
}),
).
Actions(
tables.EditAction[*Customer](),
tables.DeleteAction[*Customer](),
).
BulkActions(
tables.DeleteBulkAction(),
tables.ExportBulkAction(),
)
🗑️ Soft Deletes & Trash Recovery Bin (res.SoftDeletes())#
Protect your application from accidental data loss with full lifecycle soft-delete support and Trash Recovery Bin:
res := filament.NewResource[*Document]("documents").
SoftDeletes(true). // Enables soft-delete awareness and trash scoping
OnRestore(func(ctx *filament.Context, id string) error {
return db.RestoreDocument(ctx, id)
}).
OnForceDelete(func(ctx *filament.Context, id string) error {
return db.PermanentlyDeleteDocument(ctx, id)
})
- Automatic Trashed Filter: Injects a 3-state scope filter (
Without Trashed(default active),With Trashed, andOnly Trashed(trash bin view)) into the table toolbar. - Dynamic Row Action Swapping: Active records show standard
EditandDeleteactions, while trashed records automatically displayRestore(⟲) andForce Delete(🗑) actions with safety confirmation modals. - Visual Highlight: Trashed records automatically display
[Trashed]badges and muted row styling (.table-row-trashed). - Bulk Operations: Seamlessly restore or purge batches of records with
tables.RestoreBulkAction()andtables.ForceDeleteBulkAction(). - Activity Log Audit Trail: Intercepts restore and force delete operations, recording
restoredandforce_deletedevents in the audit trail. - REST API Support: Native endpoints at
/admin/api/resources/{slug}/restoreand/admin/api/resources/{slug}/force-delete.
⚡ Advanced Table Capabilities:#
- ✏️ Inline Cell Editing: Edit values directly in the table row without opening edit modals or full pages:
TextInputColumn[T](name): Direct inline text edits synced on blur orEnter.SelectColumn[T](name): Immediate status/role updates via interactive dropdown.ToggleColumn[T](name): Instant visual switch animation persisting state asynchronously.TextColumn[T](name).Editable(true): Click-to-edit inline field withEscrevert andEntersave.- Automatic backend integration: Routes
POST /admin/{resource}/cellandPOST/PATCH /admin/api/resources/{slug}/:id/cell, triggeringr.OnCellUpdate(func(ctx, id, column, value) error)or model updates.
- 👁️ Dynamic Column Toggling (Show/Hide): Operators can customize which columns are visible via a “Columns” dropdown menu. Preferences are automatically persisted to browser
localStorageacross page visits. - ↕️ Drag-and-Drop Row Reordering: Reorder records with grip handles (
⋮⋮). Dragging a row dispatches an asynchronous update toPOST /admin/{resource}/reorderandPOST /admin/api/resources/{slug}/reorder, callingr.OnReorder(func(ctx, orderedIDs) error). - 🚀 Server-Side Sorting & Filtering: Multi-column sorting (
↑,↓), search bars,SelectFilter, andTernaryFilter(soft-deletes). - 📅 Range filters:
tables.DateRangeFilter("created_at")andtables.NumberRangeFilter("amount")give “from / to” inputs (web) and a range dialog (Flutter). Your list handler receivesfilters["created_at"] = "2026-01-01,2026-01-31"(either side may be empty). Turn it into SQL withf.Condition(value)+tables.BuildAdvancedSearchSQLFor(the end date is inclusive), or check in-memory records withf.Matches(value, v). - 🧮 Summaries & grouping:
tables.TextColumn[T]("amount").Summarize(tables.Sum, tables.Avg)shows aggregates under the column for the page and per group (tables.Sum,Avg,Count,Min,Max).res.SummariesUsing(func(ctx, search, filters) (tables.Summaries, error))adds an “All results” row computed by your database (andsummariesin the API).t.Groups("status")/t.DefaultGroup("status")let users group rows with a header and subtotal per group; while grouped, the list is sorted by the group column. Web and Flutter. - 🔒 Edit conflicts:
res.Versioned(func(r *Order) string { return r.UpdatedAt.String() })stops one admin from silently overwriting another’s save. Edit forms (web and Flutter) carry the version they were opened with; a stale save gets 409 and the editor offers Reload or Overwrite. For a race-free write, usefilament.ExpectedVersion(ctx)in yourOnUpdate(UPDATE ... WHERE id = ? AND updated_at = ?). API clients that send no_versionare not checked. - 📦 Streaming Bulk & Header Actions: In-line View/Edit/Delete actions, multi-record delete, and streaming data export (
CSV,TSV,JSON).