Raxol.UI.Components.FocusRing (Raxol v2.0.1)

View Source

Focus ring component for accessibility and keyboard navigation.

Provides visual focus indicators and manages focus state for UI components.

Summary

Functions

Adds a component to focus ring tracking.

Initializes focus ring configuration.

Removes a component from focus ring tracking.

Renders a focus ring around content.

Updates focus ring style.

Checks if a component should have focus ring.

Types

config()

@type config() :: %{
  enabled: boolean(),
  style: atom(),
  color: atom() | binary(),
  width: integer(),
  offset: integer(),
  components: [binary()]
}

Functions

add_component(config, component_id)

@spec add_component(config(), binary()) :: config()

Adds a component to focus ring tracking.

init(opts \\ [])

@spec init(keyword()) :: config()

Initializes focus ring configuration.

remove_component(config, component_id)

@spec remove_component(config(), binary()) :: config()

Removes a component from focus ring tracking.

render(content, config)

@spec render(binary(), config()) :: binary()

Renders a focus ring around content.

set_style(config, style)

@spec set_style(config(), atom()) :: config()

Updates focus ring style.

should_focus?(component_id, arg2)

@spec should_focus?(binary(), config()) :: boolean()

Checks if a component should have focus ring.