@stereopt/data-table
v0.2.5
Published
Simple reusable React data table component
Downloads
2,438
Maintainers
Readme
@stereopt/data-table
Simple React data table component packaged as an npm library.
Getting started
Install dependencies:
npm installBuild the package:
npm run buildRun the build in watch mode while developing:
npm run devUsage
import { DataTable } from '@stereopt/data-table';
import '@stereopt/data-table/styles.css';
export function Example() {
return <DataTable />;
}The package stylesheet ships the component utilities only. It does not include Tailwind preflight, so it will not reset the consuming application's global styles.
The components also inherit the host application's theme automatically when the app exposes common semantic CSS variables such as --background, --foreground, --primary, --muted, --border, and related tokens. If needed, you can override the library specifically with the prefixed variables --st-dt-*.
Tailwind Configuration
Since the package uses Tailwind CSS, your consumer application must configure Tailwind to scan the package files so it generates the required utility classes.
Tailwind v4 (CSS-first)
In your global CSS file:
@import "tailwindcss";
@import "@stereopt/data-table/tailwind-source.css";That's it! The tailwind-source.css file contains the @source directive that tells Tailwind where to scan for the component classes.
GitHub repository
Repository: https://github.com/StereoPT/data-table
npm publishing
- Update the
namefield inpackage.jsonif you want a different npm package name. - Bump the version in
package.json. - Log in to npm with
npm login. - Publish with
npm publish --access public.
If you use an npm scope such as @stereopt, make sure that scope exists in your npm organization.
