Reference

ClientOnly

Its block drawn in the browser alone, never in the static paint, a template or a PDF: a clock, the reader's own data. A placeholder { … } block is what those show in its place.

ClientOnly { … }

Since 6.2.0

No props to try.

Your local time

Example

wf

Card { Card.Body { Text("Your local time").muted.sm ClientOnly { placeholder { Skeleton(height: "28px", width: "120px") } Heading("{now(every: 1.seconds):.time}").h3 } } }

The window's width, which only a browser knows

wf

ClientOnly { placeholder { Text("…") } Text("This window is {viewport.width}px wide.") }

Related:

Host Element Portal

Props

This element takes no props of its own.

Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.

Flags and cases

A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.

No flags of its own.

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

children

Renders with the class wf-client-only, stable across releases, so a stylesheet may target it.

These controls list the props' cases; the example below shows them written.