AG Grid theme
AG Grid Theme is a package that adds Salt theme styles to AG Grid. The package contains CSS files only, and works with AG Grid from version 28 upwards which has CSS variable support. The examples provided below utilize AG Grid version 32.2.2.
When you want to use the Salt theme with AG Grid.
When you want to use a component that is not related to AG Grid.
Note
If you're using ag grid v33, please set { theme: "legacy" }
.
Refer to ag grid upgrade guide for more information.
Make sure to install the necessary AG Grid packages. You will need to install ag-grid-react
. You should also install any packages and modules that are necessary for your project, such as ag-grid-community
and ag-grid-enterprise
.
To install the @salt-ds/ag-grid-theme
package, run the command appropriate to your environment: yarn add @salt-ds/ag-grid-theme
or npm install @salt-ds/ag-grid-theme
To import the Salt AG Grid theme, use:
Then wrap your AG Grid with the corresponding class names shown below:
For light mode, use these CSS class name .ag-theme-salt-light
.
For dark mode, use these CSS class name .ag-theme-salt-dark
.
For compact
version, use these CSS class names:
For variants add additional CSS class names:
For editable fields, add the class name .editable-cell
to the cellClass
array in your column definition.
For fields displaying numeric values, add the class name .numeric-cell
to the cellClass
array in your column definition.
When you want to use the Salt theme with AG Grid.
When you want to use a component that is not related to AG Grid.
Note
If you're using ag grid v33, please set { theme: "legacy" }
.
Refer to ag grid upgrade guide for more information.
Make sure to install the necessary AG Grid packages. You will need to install ag-grid-react
. You should also install any packages and modules that are necessary for your project, such as ag-grid-community
and ag-grid-enterprise
.
To install the @salt-ds/ag-grid-theme
package, run the command appropriate to your environment: yarn add @salt-ds/ag-grid-theme
or npm install @salt-ds/ag-grid-theme
To import the Salt AG Grid theme, use:
Then wrap your AG Grid with the corresponding class names shown below:
For light mode, use these CSS class name .ag-theme-salt-light
.
For dark mode, use these CSS class name .ag-theme-salt-dark
.
For compact
version, use these CSS class names:
For variants add additional CSS class names:
For editable fields, add the class name .editable-cell
to the cellClass
array in your column definition.
For fields displaying numeric values, add the class name .numeric-cell
to the cellClass
array in your column definition.
When you want to use the Salt theme with AG Grid.
When you want to use a component that is not related to AG Grid.
Note
If you're using ag grid v33, please set { theme: "legacy" }
.
Refer to ag grid upgrade guide for more information.
Make sure to install the necessary AG Grid packages. You will need to install ag-grid-react
. You should also install any packages and modules that are necessary for your project, such as ag-grid-community
and ag-grid-enterprise
.
To install the @salt-ds/ag-grid-theme
package, run the command appropriate to your environment: yarn add @salt-ds/ag-grid-theme
or npm install @salt-ds/ag-grid-theme
To import the Salt AG Grid theme, use:
Then wrap your AG Grid with the corresponding class names shown below:
For light mode, use these CSS class name .ag-theme-salt-light
.
For dark mode, use these CSS class name .ag-theme-salt-dark
.
For compact
version, use these CSS class names:
For variants add additional CSS class names:
For editable fields, add the class name .editable-cell
to the cellClass
array in your column definition.
For fields displaying numeric values, add the class name .numeric-cell
to the cellClass
array in your column definition.