Skip to main content

Built and signed on GitHub Actions

🌊 Lightweight HTML templating library for any-side rendering

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 days ago (0.7.6)
class Client

Client side renderer.

Constructors

new
Client(options?: ClientOptions)

Client constructor.

Properties

readonly
context: Record<PropertyKey, any>

Rendering context.

All properties assigned to this object are available during rendering.

Changes to this object are reactive and will trigger a re-render of related elements. This is achieved using Context, which leverages Proxy handlers.

Note

You cannot reassign this property directly to ensure reactivity is maintained. To achieve a similar effect, use Object.assign().

Methods

flush(): Promise<void>

Flush the reactive render queue of Renderer.

render<T extends Arg<Renderer["render"]>>(
element?: T,
): Promise<T>

Start rendering all subtrees marked with the *mizu attribute.

const mizu = new Client({ context: { foo: "bar" } })
await mizu.render()

Static Properties

readonly
default: Client

Default Client instance.

Default options for Client.

These default options are merged with the provided options when creating a new Client instance.

Add Package

deno add jsr:@mizu/render

Import symbol

import { Client } from "@mizu/render/client";

---- OR ----

Import directly with a jsr specifier

import { Client } from "jsr:@mizu/render/client";

Add Package

npx jsr add @mizu/render

Import symbol

import { Client } from "@mizu/render/client";

Add Package

yarn dlx jsr add @mizu/render

Import symbol

import { Client } from "@mizu/render/client";

Add Package

pnpm dlx jsr add @mizu/render

Import symbol

import { Client } from "@mizu/render/client";

Add Package

bunx jsr add @mizu/render

Import symbol

import { Client } from "@mizu/render/client";