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

2.1.0 • Public • Published

KoliBri - Hydrate-Adapter

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 -g @public-ui/hydrate
pnpm i -g @public-ui/hydrate
yarn add -g @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);

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i @public-ui/hydrate

    Weekly Downloads

    15

    Version

    2.1.0

    License

    EUPL-1.2

    Unpacked Size

    1.62 MB

    Total Files

    5

    Last publish

    Collaborators

    • itzbund
    • m.oppitz