Collection
Track a collection of DOM elements in the exact order they're rendered in the DOM and watch the DOM for any change to their order.
import "./style.css";
import * as Ariakit from "@ariakit/react";
export default function Example() {
const length = collection.useState((state) => state.renderedItems.length);
return (
<div>Items count: {length}</div>
);
}
API
Follow updates
Join 1,000+ subscribers and receive monthly updates with the latest improvements on Components.