PluginContextValue
Defined in: Context.tsx:48
Plugin context value available to all plugins.
Note: data, selectedRows, and table are typed as unknown because
plugins are defined generically and cannot know the specific row type.
Type Parameters
Section titled “Type Parameters”TOpenArgs
Section titled “TOpenArgs”TOpenArgs = unknown
Properties
Section titled “Properties”columns
Section titled “columns”columns:
PluginColumnInfo[]
Defined in: Context.tsx:62
Column information (key and header)
data:
unknown[]
Defined in: Context.tsx:57
Current table data
openArgs
Section titled “openArgs”openArgs:
TOpenArgs|undefined
Defined in: Context.tsx:89
Arguments passed to openPlugin() when the plugin was opened. Use this to receive initial data when the plugin mounts.
For type-safe access, pass the plugin ID as the type parameter:
const { openArgs } = usePluginContext<"row-detail">();// openArgs is typed as { row: Person } if registered in PluginArgsRegistryExample
Section titled “Example”// Application opens plugin with args:table.plugin.open("row-detail", { row: clickedRow });
// Plugin receives args (type-safe):const { openArgs } = usePluginContext<"row-detail">();const initialRow = openArgs?.row;selectedRows
Section titled “selectedRows”selectedRows:
unknown[]
Defined in: Context.tsx:67
Currently selected rows
table:
SeizenTableInstance<unknown>
Defined in: Context.tsx:52
The SeizenTable instance
useEvent()
Section titled “useEvent()”useEvent: <
K>(event,callback) =>void
Defined in: Context.tsx:117
Hook to subscribe to events emitted by SeizenTable.
Built-in events:
data-change: Table data changedselection-change: Row selection changedfilter-change: Column filters changedsorting-change: Sorting changedpagination-change: Pagination changedrow-click: A row was clicked
Type Parameters
Section titled “Type Parameters”K extends keyof SeizenTableEventMap<unknown> | string & object
Parameters
Section titled “Parameters”K
callback
Section titled “callback”(payload) => void
Returns
Section titled “Returns”void
Example
Section titled “Example”const { useEvent } = usePluginContext();
// Subscribe to selection changesuseEvent("selection-change", (selectedRows) => { console.log("Selection changed:", selectedRows);});
// Subscribe to row clicksuseEvent("row-click", (row) => { console.log("Row clicked:", row);});