Skip to content

Custom Search & Pagination

tsx
<InertiaTable
    tableData={servers}
    renderSearch={({ searchTerm, onSearch }) => (
        <input
            value={searchTerm}
            onChange={(e) => onSearch(e.target.value)}
            placeholder="Filter servers..."
            className="rounded-full px-4 py-2 border"
        />
    )}
/>
vue
<!-- Coming soon -->

Custom Pagination

tsx
<InertiaTable
    tableData={servers}
    renderPagination={({ links, meta, onPageChange, isFetching }) => (
        <div className="flex items-center justify-between px-4 py-4 border-t">
            <span className="text-sm text-gray-500">
                Showing {meta.from} to {meta.to}
                {meta.total != null && <> of {meta.total} results</>}
            </span>
            <div className="flex gap-2">
                <button disabled={!links.prev || isFetching} onClick={() => onPageChange(meta.current_page - 1)}>
                    Previous
                </button>
                <button disabled={!links.next || isFetching} onClick={() => onPageChange(meta.current_page + 1)}>
                    Next
                </button>
            </div>
        </div>
    )}
/>
vue
<!-- Coming soon -->

Custom Empty State

tsx
<InertiaTable
    tableData={servers}
    renderEmpty={() => (
        <div className="p-12 text-center">
            <h3 className="text-lg font-medium">No servers yet</h3>
            <p className="text-gray-500">Create your first server to get started.</p>
            <button className="mt-4 px-4 py-2 bg-blue-600 text-white rounded-md">
                Create Server
            </button>
        </div>
    )}
/>
vue
<!-- Coming soon -->

Toolbar Actions

Add buttons alongside the search without replacing it:

tsx
<InertiaTable
    tableData={servers}
    renderToolbarActions={() => (
        <div className="flex gap-2">
            <button className="px-3 py-1.5 border rounded">Export</button>
            <button className="px-3 py-1.5 bg-blue-600 text-white rounded">Create</button>
        </div>
    )}
/>
vue
<!-- Coming soon -->