@cdc/data-table
v4.26.1
Published
React standalone data table component
Readme
@cdc/data-table
<CdcDataTable /> is a React component produced by the CDC for displaying a single piece of data in a card format. This package is part of the larger CDC Open Visualization project.
Installation and Usage
- Install the package in your React project
npm install @cdc/data-tableoryarn add @cdc/data-table. - Import the component and begin using in your code.
import CdcDataTable from '@cdc/data-table'
function App() {
return (
<div className="App">
<CdcDataTable config={configObj} />
</div>
);
}
export default App;Note, you must pass in a configuration object. Configuration objects can be created with the Editor package.
Sample config data can be found in packages/data-table/examples.
Properties
| Property | Type | Description | | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ | | config | String | A JavaScript object with the configuration for the data table. Pass either this or the configUrl property to setup your chart. |
