useActiveColumns

A hook that provides a list of user-selected active TableColumns.

Example

// See implementation for more details on TableColumn type
  const [activeColumns, userSettingsLoaded] = useActiveColumns({
    columns,
    showNamespaceOverride: false,
    columnManagementID,
  });
  return userSettingsAreLoaded ? <VirtualizedTable columns={activeColumns} {...otherProps} /> : null
Parameter Name Description

options

Which are passed as a key-value map

\{TableColumn[]} options.columns

An array of all available TableColumns

{boolean} [options.showNamespaceOverride]

(optional) If true, a namespace column is included, regardless of column management selections

{string} [options.columnManagementID]

(optional) A unique ID used to persist and retrieve column management selections to and from user settings. Usually a group/version/kind (GVK) string for a resource.

A tuple containing the current user selected active columns (a subset of options.columns), and a boolean flag indicating whether user settings have been loaded.