GoFilament
You're reading the docs for v1.24.1, an older release. Go to v1.40.1 (latest).

Docs v1.24.1 Guide

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, and Only Trashed (trash bin view)) into the table toolbar.
  • Dynamic Row Action Swapping: Active records show standard Edit and Delete actions, while trashed records automatically display Restore (⟲) and Force 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() and tables.ForceDeleteBulkAction().
  • Activity Log Audit Trail: Intercepts restore and force delete operations, recording restored and force_deleted events in the audit trail.
  • REST API Support: Native endpoints at /admin/api/resources/{slug}/restore and /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 or Enter.
    • 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 with Esc revert and Enter save.
    • Automatic backend integration: Routes POST /admin/{resource}/cell and POST/PATCH /admin/api/resources/{slug}/:id/cell, triggering r.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 localStorage across page visits.
  • ↕️ Drag-and-Drop Row Reordering: Reorder records with grip handles (⋮⋮). Dragging a row dispatches an asynchronous update to POST /admin/{resource}/reorder and POST /admin/api/resources/{slug}/reorder, calling r.OnReorder(func(ctx, orderedIDs) error).
  • 🚀 Server-Side Sorting & Filtering: Multi-column sorting (↑, ↓), search bars, SelectFilter, and TernaryFilter (soft-deletes).
  • 📦 Streaming Bulk & Header Actions: In-line View/Edit/Delete actions, multi-record delete, and streaming data export (CSV, TSV, JSON).

Generated from README.md at v1.24.1 · released Nov 7, 2026