Skip to content
Data displayGenerated from the public API

ColumnVisibilityMenu

Show and hide columns without losing the user's arrangement.

@luc/ui/data-table

Examples

Default

Shown inside a real table, which is the only context the component renders in.

Six prepared research runs with performance and metadata columns.
Equity
BTC-USDVolatility carryPausedRange2.0041.7%-29.1%34156.7%Sep 13
AAPLCross-sectional momentumLiveStress1.73-3.8%-32.4%39440.2%Aug 24
NDXVolatility carryLiveStress1.5523.0%-26.0%42345.5%Sep 9
NVDAMean reversionPausedStress1.32-2.0%-15.0%53293.3%Aug 19
NDXMean reversionFailedTrend0.4825.4%-13.7%29759.9%Sep 9
MSFTTrend breakoutFailedRange0.339.4%-26.8%22323.3%Sep 21

Usage

import { ColumnVisibilityMenu } from "@luc/ui/data-table";
<DataTable
  columns={columns}
  data={runs}
  ariaLabel="Research runs"
  enableColumnVisibility
  toolbar={<DataTableToolbar actions={<ColumnVisibilityMenu />} />}
/>

Package setup — peer requirements, the stylesheet and the provider — is on installation.

API

Read from the published TypeScript API, so a prop that is not listed here does not exist and a default that is listed is the one the compiler sees.

Exported symbols
ExportKindSignature
ColumnVisibilityMenu2 documented props({ label, className }: ColumnVisibilityMenuProps) => import("@types/react").JSX.Element

ColumnVisibilityMenu props

Type: ColumnVisibilityMenuProps

Values the compiler reads from the declaration.

ColumnVisibilityMenu props
PropTypeDefaultNotes
className?string | undefined—
label?string | undefined—

Guidelines

Do

  • Reach for it when a table has more columns than the viewport shows and the reader decides which ones matter.
  • Keep the identifying column pinned through `columnPinning`, so hiding a column never removes the row's name.

Don't

  • Use it to hide the column the table is sorted or filtered by; hide optional metadata, not the key.

Accessibility

It is a menu button inside the table toolbar. The table keeps the name it was given (`ariaLabel` or `caption`), and the header row it changes stays a real header row.

Family

Data display

Dense, sortable, scannable: the surfaces a real product reads numbers from.

17 documented entries in this family. Open the family index

Luc UI v1.0ColumnVisibilityMenudark theme