Skip to content

FocusableHandle

Base handle shared by all focusable elements

blur(): void;

Programmatically blur (unfocus) this element

void


focus(): void;

Programmatically focus this element

void


scrollIntoView(options?): void;

Scroll the nearest parent ScrollView to make this element visible. Behaves like the DOM Element.scrollIntoView() method. No-op if the element is not inside a ScrollView.

ParameterTypeDescription
options?ScrollIntoViewOptionsAlignment options (default: { block: "nearest" })

void

const inputRef = useRef<InputHandle>(null);
// Minimal scroll — just enough to make it visible
inputRef.current?.scrollIntoView();
// Center the element in the viewport
inputRef.current?.scrollIntoView({ block: "center" });
PropertyModifierTypeDescription
isFocusedreadonlybooleanWhether this element is currently focused