Skip to content

dracor-org/dracor-react

Repository files navigation

dracor-react

The DraCor React Component Library provides reusable react components for various DraCor and related projects.

The components are documented in storybook.

Installation

First add the DraCor React components to your react project:

npm i @dracor/react
# or
yarn add @dracor/react
# or
pnpm add @dracor/react

Then add the following two lines to your index.css file to import the DraCor Tailwind theme and make the tailwind compiler aware of the utility classes the DraCor components are using:

@import "@dracor/react/dracor.css";
@source "../node_modules/@dracor/react";

React Helmet integration

Several components optionally integrate with React Helmet, which is a peer dependency of this package:

npm i react-helmet-async

If you intend to make use of this integration you need to set up the HelmetProvider:

// index.tsx
import { HelmetProvider } from 'react-helmet-async';
import App from './App';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);

root.render(
  <HelmetProvider>
    <App />
  </HelmetProvider>
)

See https://github.com/staylor/react-helmet-async#usage for details.

Publication

To release a new version to npmjs.com you need to be a member of the dracor organization.

pnpm release

License

The components and documentation of this project are released under the MIT License.