React package reference
Install:
npm i @skullmaster/react@beta @skullmaster/react@nextpnpm add @skullmaster/react@beta @skullmaster/react@nextyarn add @skullmaster/react@beta @skullmaster/react@nextSkullmaster (provider)
Section titled “Skullmaster (provider)”Mount once in your app entry (App.tsx, main.tsx, or layout.tsx):
import { Skullmaster } from "@skullmaster/react";
<Skullmaster />;Dev-only helper: enables the skull icon, hover highlighting of data-skullmaster elements, and the download button that posts the payload to the CLI server.
markAsSkull(name, tweaks?)
Section titled “markAsSkull(name, tweaks?)”Registers an element for skeleton generation. The name becomes the skeleton file name (<outDir>/skeletons/<name>.tsx).
<article {...markAsSkull("UserCard")}>...</article><section {...markAsSkull("Hero", { isTransparent: true })}>...</section>tweakForSkull(tweaks?)
Section titled “tweakForSkull(tweaks?)”Applies tweaks to a child element without registering a new name:
<fieldset {...tweakForSkull({ hideSubTree: true })}>...</fieldset>SkullTweaks
Section titled “SkullTweaks”type SkullTweaks = { hideSubTree?: boolean; // -> data-skip-skull isTransparent?: boolean; // -> data-depth="-1"};Generated registry
Section titled “Generated registry”<outDir>/registry.tsx exports Skeleton:
import { Skeleton } from "./skeletons/registry";
<Skeleton name="ProfileCard" />;Renders DefaultBone until the named skeleton exists.
