JSPM

@public-ui/hydrate

3.0.6-rc.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 595
  • Score
    100M100P100Q99816F
  • License EUPL-1.2

Hydrate function for KoliBri - The accessible HTML-Standard.

Package Exports

  • @public-ui/hydrate

Readme

KoliBri - Hydrate-Adapter

npm license downloads issues pull requests size contributors

Motivation

Provide an adapter for Server Side Rendering of KoliBri components.

⚠️ Hydrate support is currently considered experimental.

Installation

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

npm i @public-ui/hydrate
pnpm i @public-ui/hydrate
yarn add @public-ui/hydrate

Usage

Call the renderToString method and pass it an HTML string containing KoliBri component tags. The method will return a Promise that resolves with an object containing the hydrated HTML.

import { renderToString } from '@public-ui/hydrate';

const inputHtml = `<kol-button _label="Hello World"_></kol-button>`;
const { html } = await renderToString(inputHtml);

Refer to the default theme README for information on customizing the output.