> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infilsense.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grid Snapping & Bounds

> Understand tab dragging, magnetic snapping, screen clamping, and flyout positioning.

Tabs use Roblox's native `UIDragDetector` with pixel-offset positioning. The library adds a grid constraint and viewport-aware clamping on top of the native drag behavior.

## Grid snapping

Grid snapping is enabled by default with a **10 pixel** grid:

```text theme={null}
Settings.GridSnap = true
Settings.GridSize = 10
```

During a drag, X and Y offsets are rounded to the nearest grid multiple. When the drag ends, the final position is snapped again and stored in `TabPositions`.

## Built-in settings

The automatic `Settings` tab includes:

| Control | Behavior |
| :- | :- |
| **Grid Snapping** | Enables or disables magnetic snapping. |
| **Grid Snap Size** | Selects 5-20 px in 5 px increments. |
| **Reset Tab Positions** | Clears saved tab position/state and restores the initial stack. |

The selected grid settings persist through the JSON configuration file.

## Screen bounds

Tab positions are clamped using the current viewport size. The tab header is **200 px** wide, so the X offset stays between `0` and `viewportWidth - 200`; the Y offset stays between `0` and `viewportHeight - 20`.

New tabs start at an X offset of **10 px** and at a Y position based on the GUI inset, with a minimum starting height of **40 px**. Existing tabs are re-clamped when the viewport size changes.

## Flyouts

Selection and context-menu flyouts are positioned beside the source tab. When the right side has insufficient room, they flip to the left. Their height is limited by the available screen space.

Tooltips use similar boundary-aware placement and can flip horizontally or vertically near screen edges.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.