Skip to content

ColumnsPanelTrigger API

API reference docs for the React ColumnsPanelTrigger component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import { ColumnsPanelTrigger } from '@mui/x-data-grid/components';
// or
import { ColumnsPanelTrigger } from '@mui/x-data-grid';
// or
import { ColumnsPanelTrigger } from '@mui/x-data-grid-pro';
// or
import { ColumnsPanelTrigger } from '@mui/x-data-grid-premium';

Learn about the difference by reading this guide on minimizing bundle size.



A button that opens and closes the columns panel. It renders the baseButton slot.

Props

A ref for imperative actions. It currently only supports focusVisible() action.

Type:func
| { current?: { focusVisible: func } }


If true, the ripples are centered. They won't start at the cursor interaction position.

Type:bool

Default:false


Override or extend the styles applied to the component.

Type:func
| string


The color of the component. It supports both default and custom theme colors, which can be added as shown in the palette customization guide.

Type:'error'
| 'info'
| 'inherit'
| 'primary'
| 'secondary'
| 'success'
| 'warning'

Default:'primary'


If true, the component is disabled.

Type:bool


If true, no elevation is used.

Type:bool

Default:false


If true, the keyboard focus ripple is disabled.

Type:bool

Default:false


If true, the ripple effect is disabled.
⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure to highlight the element by applying separate styles with the .Mui-focusVisible class.

Type:bool

Default:false


If true, the touch ripple effect is disabled.

Type:bool

Default:false


Element placed after the children.

Type:node


If true, the base button will have a keyboard focus ripple.

Type:bool

Default:false


This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It's a polyfill for the CSS :focus-visible selector. The rationale for using this feature is explained here. A polyfill can be used to apply a focus-visible class to other components if needed.

Type:string


If true, the button will take up the full width of its container.

Type:bool

Default:false


The URL to link to when the button is clicked. If defined, an a element will be used as the root node.

Type:string


The component used to render a link when the href prop is provided.

Type:elementType

Default:'a'


Callback fired when the component is focused with a keyboard. We trigger a onFocus callback too.

Type:func


A function to customize rendering of the component.

Type:element
| func


The size of the component. small is equivalent to the dense button styling.

Type:'large'
| 'medium'
| 'small'


Element placed before the children.

Type:node


The system prop that allows defining system overrides as well as additional CSS styles.

See the `sx` page for more details.

Type:Array<func
| object
| bool>
| func
| object


Props applied to the TouchRipple element.

Type:object


A ref that points to the TouchRipple element.

Type:any


The variant to use.

Type:'contained'
| 'outlined'
| 'text'

Default:'text'


The ref is forwarded to the root element.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

STATE

State class applied to the root element if disabled={true}.


STATE

State class applied to the ButtonBase root element if the button is keyboard focused.


Styles applied to the root element if color="error".

Rule name:colorError


Styles applied to the root element if color="info".

Rule name:colorInfo


Styles applied to the root element if color="inherit".

Rule name:colorInherit


Styles applied to the root element if color="primary".

Rule name:colorPrimary


Styles applied to the root element if color="secondary".

Rule name:colorSecondary


Styles applied to the root element if color="success".

Rule name:colorSuccess


Styles applied to the root element if color="warning".

Rule name:colorWarning


Styles applied to the root element if variant="contained".

Rule name:contained


Deprecated

Styles applied to the root element if variant="contained" and color="error".

Rule name:containedError


Deprecated

Styles applied to the root element if variant="contained" and color="info".

Rule name:containedInfo


Deprecated

Styles applied to the root element if variant="contained" and color="inherit".

Rule name:containedInherit


Deprecated

Styles applied to the root element if variant="contained" and color="primary".

Rule name:containedPrimary


Deprecated

Styles applied to the root element if variant="contained" and color="secondary".

Rule name:containedSecondary


Deprecated

Styles applied to the root element if size="large" and variant="contained".

Rule name:containedSizeLarge


Deprecated

Styles applied to the root element if size="medium" and variant="contained".

Rule name:containedSizeMedium


Deprecated

Styles applied to the root element if size="small" and variant="contained".

Rule name:containedSizeSmall


Deprecated

Styles applied to the root element if variant="contained" and color="success".

Rule name:containedSuccess


Deprecated

Styles applied to the root element if variant="contained" and color="warning".

Rule name:containedWarning


Styles applied to the root element if disableElevation={true}.

Rule name:disableElevation


Styles applied to the endIcon element if supplied.

Rule name:endIcon


Styles applied to the root element if fullWidth={true}.

Rule name:fullWidth


Styles applied to the icon element if supplied

Rule name:icon


Deprecated

Styles applied to the icon element if supplied and size="large".

Rule name:iconSizeLarge


Deprecated

Styles applied to the icon element if supplied and size="medium".

Rule name:iconSizeMedium


Deprecated

Styles applied to the icon element if supplied and size="small".

Rule name:iconSizeSmall


Styles applied to the root element if variant="outlined".

Rule name:outlined


Deprecated

Styles applied to the root element if variant="outlined" and color="error".

Rule name:outlinedError


Deprecated

Styles applied to the root element if variant="outlined" and color="info".

Rule name:outlinedInfo


Deprecated

Styles applied to the root element if variant="outlined" and color="inherit".

Rule name:outlinedInherit


Deprecated

Styles applied to the root element if variant="outlined" and color="primary".

Rule name:outlinedPrimary


Deprecated

Styles applied to the root element if variant="outlined" and color="secondary".

Rule name:outlinedSecondary


Deprecated

Styles applied to the root element if size="large" and variant="outlined".

Rule name:outlinedSizeLarge


Deprecated

Styles applied to the root element if size="medium" and variant="outlined".

Rule name:outlinedSizeMedium


Deprecated

Styles applied to the root element if size="small" and variant="outlined".

Rule name:outlinedSizeSmall


Deprecated

Styles applied to the root element if variant="outlined" and color="success".

Rule name:outlinedSuccess


Deprecated

Styles applied to the root element if variant="outlined" and color="warning".

Rule name:outlinedWarning


Styles applied to the root element.

Rule name:root


Styles applied to the root element if size="large".

Rule name:sizeLarge


Styles applied to the root element if size="medium".

Rule name:sizeMedium


Styles applied to the root element if size="small".

Rule name:sizeSmall


Styles applied to the startIcon element if supplied.

Rule name:startIcon


Styles applied to the root element if variant="text".

Rule name:text


Deprecated

Styles applied to the root element if variant="text" and color="error".

Rule name:textError


Deprecated

Styles applied to the root element if variant="text" and color="info".

Rule name:textInfo


Deprecated

Styles applied to the root element if variant="text" and color="inherit".

Rule name:textInherit


Deprecated

Styles applied to the root element if variant="text" and color="primary".

Rule name:textPrimary


Deprecated

Styles applied to the root element if variant="text" and color="secondary".

Rule name:textSecondary


Deprecated

Styles applied to the root element if size="large" and variant="text".

Rule name:textSizeLarge


Deprecated

Styles applied to the root element if size="medium" and variant="text".

Rule name:textSizeMedium


Deprecated

Styles applied to the root element if size="small" and variant="text".

Rule name:textSizeSmall


Deprecated

Styles applied to the root element if variant="text" and color="success".

Rule name:textSuccess


Deprecated

Styles applied to the root element if variant="text" and color="warning".

Rule name:textWarning



You can override the style of the component using one of these customization options:

Source code

If you did not find the information in this page, consider having a look at the implementation of the component for more detail.