Component

HoldPosition

Hold the content, move across three fixed positions, and release it to permanently keep the chosen slot until you move it again.

01 / Preview

Try it yourself.

Preview Interactive

Hold, move across the track, then release. The position stays put.

Mechanism
1
Press and hold the content.
2
Move left, middle, or right while holding.
3
Release it and the chosen position remains.

02 / Usage

Put it somewhere.

example.tsxTSX
import { HoldPosition } from "gra-ui";
import "gra-ui/styles.css";

export function Parked() {
  return <HoldPosition>Leave this in the middle</HoldPosition>;
}

03 / API

Small surface area.

PropTypeDescription
childrenReactNodeThe content moved between three fixed positions.