Packages@robojs/sync
SyncDraggableProps<T, ClientData>
Interface: SyncDraggableProps<T, ClientData>
Props for SyncDraggable component.
Type Parameters
Properties
| Property | Type | Description |
|---|---|---|
as? | null | keyof IntrinsicElements | Element type to render (default: 'div', null for no wrapper) |
bounds? | DragBounds | Position bounds |
children | ReactNode | (props) => ReactNode | Children to render - can be ReactNode or render function |
className? | string | CSS class name for wrapper element |
id | (null | string)[] | Key suffix for state synchronization |
initial | T | Initial state (must include x, y) |
interpolate? | InterpolateConfig<T> | Interpolation config for smooth remote updates |
normalize? | boolean | Use 0-1 viewport coordinates (default: true) |
onDrag? | (state: T) => void | Called on each drag update |
onDragEnd? | (state: T) => void | Called when drag ends |
onDragStart? | (state: T) => void | Called when drag starts |
onStateChange? | (state: T, prevState: T) => void | Called when state changes (from any source) |
style? | CSSProperties | CSS styles for wrapper element |
throttle? | number | Milliseconds between updates |
