Skip to content

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.

TOpenArgs = unknown

columns: PluginColumnInfo[]

Defined in: Context.tsx:62

Column information (key and header)


data: unknown[]

Defined in: Context.tsx:57

Current table data


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 PluginArgsRegistry
// 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: unknown[]

Defined in: Context.tsx:67

Currently selected rows


table: SeizenTableInstance<unknown>

Defined in: Context.tsx:52

The SeizenTable instance


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 changed
  • selection-change: Row selection changed
  • filter-change: Column filters changed
  • sorting-change: Sorting changed
  • pagination-change: Pagination changed
  • row-click: A row was clicked

K extends keyof SeizenTableEventMap<unknown> | string & object

K

(payload) => void

void

const { useEvent } = usePluginContext();
// Subscribe to selection changes
useEvent("selection-change", (selectedRows) => {
console.log("Selection changed:", selectedRows);
});
// Subscribe to row clicks
useEvent("row-click", (row) => {
console.log("Row clicked:", row);
});