Precision fracturing
Pick an element and an impact point, and break it on cue.
const dialog = useRef<HTMLDialogElement>(null);
const { fracture } = useFracture();
async function destroy(event: React.MouseEvent) {
await fracture(dialog, { at: event });
onClose();
}
Source: examples/precise.tsx. Without React, use
await fracture(element, { at: event }) from
@abeall/fracture.