Packages

🌈 Ink bindings for Gleam! ✨

Current section

Files

Jump to
glink src glink use_focus_manager.gleam
Raw

src/glink/use_focus_manager.gleam

pub type Output {
Output(
/// Enable focus management for all components.
enable_focus: fn() -> Nil,
/// Disable focus management for all components. Currently active component (if there's one) will lose its focus.
disable_focus: fn() -> Nil,
/// Switch focus to the next focusable component.
/// If there's no active component right now, focus will be given to the first focusable component.
/// If active component is the last in the list of focusable components, focus will be switched to the first component.
focus_next: fn() -> Nil,
/// Switch focus to the previous focusable component.
/// If there's no active component right now, focus will be given to the first focusable component.
/// If active component is the first in the list of focusable components, focus will be switched to the last component.
focus_previous: fn() -> Nil,
/// Switch focus to the element with provided ID.
/// If there's no element with that ID, focus will be given to the first focusable component.
focus: fn(String) -> Nil,
)
}