@public-ui/react
TypeScript icon, indicating that this package has built-in type declarations

2.2.10 • Public • Published

KoliBri - React-Adapter

npm license downloads issues pull requests size contributors

Motivation

Provide an adapter for React to use the KoliBri components.

Installation

You can install the adapter with npm, pnpm or yarn:

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

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/themes';

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 and render it within React components:

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

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

Package Sidebar

Install

npm i @public-ui/react

Weekly Downloads

1,396

Version

2.2.10

License

EUPL-1.2

Unpacked Size

54.1 kB

Total Files

6

Last publish

Collaborators

  • m.oppitz
  • itzbund