Skip to content

React package reference

Install:

npm i @skullmaster/react@beta @skullmaster/react@next

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.

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>

Applies tweaks to a child element without registering a new name:

<fieldset {...tweakForSkull({ hideSubTree: true })}>...</fieldset>
type SkullTweaks = {
hideSubTree?: boolean; // -> data-skip-skull
isTransparent?: boolean; // -> data-depth="-1"
};

<outDir>/registry.tsx exports Skeleton:

import { Skeleton } from "./skeletons/registry";
<Skeleton name="ProfileCard" />;

Renders DefaultBone until the named skeleton exists.