Component

CountedClone

It clones one HTML element solely to attach its existing child count as a data attribute, where it will help almost nobody.

01 / Preview

Try it yourself.

Preview Ready
One childdata-child-count="1"

02 / Usage

Put it somewhere.

example.tsxTSX
import { CountedClone } from "gra-ui";

export function Example() {
  return <CountedClone element={<span>One child</span>} />;
}

03 / API

Small surface area.

PropTypeDescription
elementReactElement<HTMLAttributes<HTMLElement>>The HTML element to clone and annotate.