JSPM

  • Created
  • Published
  • Downloads 1009
  • Score
    100M100P100Q90413F
  • License EUPL-1.2

React 19 framework adapter for KoliBri - The accessible HTML-Standard.

Package Exports

  • @public-ui/react-v19

Readme

KoliBri - React-Adapter for React 19.x

npm license downloads issues pull requests size contributors

Motivation

Provide an adapter for React to use the KoliBri components.

Installation

Install the adapter with npm, pnpm or yarn:

npm i @public-ui/react-v19
pnpm i @public-ui/react-v19
yarn add @public-ui/react-v19

Usage

First, initialize KoliBri with a theme and create a React root:

import { defineCustomElements } from '@public-ui/components/dist/loader';
import { register } from '@public-ui/components';
import { DEFAULT } from '@public-ui/theme-default';

register(DEFAULT, defineCustomElements)
  .then(() => {
    ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
      <React.StrictMode>
        <App />
      </React.StrictMode>
    );
  })
  .catch((error) => {
    /* Handle errors */
  });

Then, you can import any component from @public-ui/react-v19 and render it within React components:

import React from 'react';
import type { FC } from 'react';
import { KolButton } from '@public-ui/react-v19';

export default (): FC => <KolButton _label="Hello World" />;

For available design tokens see the default theme README.