Documentation
¶
Overview ¶
Package spatial ranks focusable elements by their position within the active focus scope. Navigate moves keyboard focus to a candidate in the requested direction, leaving focus unchanged when no candidate is available.
Index ¶
Constants ¶
const ( // DirectionUp navigates toward the top of the screen. DirectionUp = dom.DirectionUp // DirectionDown navigates toward the bottom of the screen. DirectionDown = dom.DirectionDown // DirectionLeft navigates toward the left side of the screen. DirectionLeft = dom.DirectionLeft // DirectionRight navigates toward the right side of the screen. DirectionRight = dom.DirectionRight )
Variables ¶
This section is empty.
Functions ¶
func Candidates ¶
Candidates returns the focusable elements in dir from the current focus, ranked by suitability (lowest score first). It is exposed for advanced use such as showing a navigation preview. Most callers want Navigate.