Skip to main content

Built and signed on GitHub Actions

🌊 Lightweight HTML templating library for any-side rendering

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
a day ago (0.6.3)
class Mizu

Client side renderer.

Constructors

new
Mizu(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 { Mizu } from "@mizu/render/client";

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @mizu/render

Import symbol

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

Add Package

yarn dlx jsr add @mizu/render

Import symbol

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

Add Package

pnpm dlx jsr add @mizu/render

Import symbol

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

Add Package

bunx jsr add @mizu/render

Import symbol

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