@buoy-gg/floating-tools-core
State and layout primitives used to build Buoy's floating tools. FloatingToolsStore manages position, drag state, hide/show behavior, and optional persistence. Your platform integration supplies input events, rendering, and animations.
To add the existing Buoy menu to an app, use @buoy-gg/core. Use this lower-level package when building a custom shell.
Install
npm install @buoy-gg/floating-tools-core
Check the package's peer dependencies for your target platform. The package also exports visual assets and icons; a headless store does not imply that every root export is free of UI dependencies.
Store lifecycle
import { FloatingToolsStore } from "@buoy-gg/floating-tools-core";
async function inspectInitialPosition() {
const store = new FloatingToolsStore({
screenWidth: 390,
screenHeight: 844,
enablePositionPersistence: false,
});
await store.initialize();
console.log(store.getSnapshot().position);
store.destroy();
}
Call this function to inspect an initial position without persistence. For an interactive shell, keep the store alive, subscribe to changes, update screen dimensions on resize, and destroy it when its owner unmounts. Supply a StorageAdapter to persist position.
The public types describe position, size, drag events, options, and drag results. Other exports include dial layout, settings state, easing, colors, usage ranking, and icons. Use the types for the installed version rather than importing private source paths.
Check dragging, hide/show, resizing, and persisted position using representative screen sizes. This package does not register inspection tools, establish account admission, or connect a broker by itself.