[]previous and next page

islandAttributes

The attributes of an island's element: its id, strategy, media query and props.

The attributes of an island's element: its id, strategy, media query and props.

Import#

ts
import { islandAttributes } from "@shadow-js/dusk";

Signature#

ts
function islandAttributes(options: IslandOptions): Record<string, string>

Parameters#

Name Description
options The island's id, strategy and props.

Returns#

The attributes (spread them on the element).

Throws#

  • TypeError for an id or strategy that is not allowed, a media strategy without a query, or props that are not plain data (functions, class instances, bigint, NaN, cycles).
  • RangeError for props over the size limit.

Examples#

ts
<div {...islandAttributes({ id: "chart", client: "visible", props: { series } })}>{fallback}</div>