header (cellium v0.1.0)

View Source

Header widget module for displaying section titles.

This module provides a simple header widget for displaying prominent text, typically used for section titles, headings, or labels in the UI.

Usage

Basic header:

header:new(page_title, "Settings")

Header with custom color:

{header, [{id, title}, {color, cyan}], "Application Settings"}

Properties

  • text (string or binary): The header text to display
  • color (atom): Text color. Inherited from widget properties

Display

The header renders as plain text at the specified position. It does not change appearance when focused (render and render_focused behave the same).

Common Use Cases

  • Page or section titles
  • Category labels
  • Divider labels in forms or menus

Summary

Functions

Creates a new header widget with the specified text.

Renders the header text.

Renders the header in focused state (identical to unfocused).

Functions

new(Id, Text)

-spec new(term(), string() | binary()) -> map().

Creates a new header widget with the specified text.

render(Widget, Buffer)

-spec render(map(), map()) -> map().

Renders the header text.

render_focused(Widget, Buffer)

-spec render_focused(map(), map()) -> map().

Renders the header in focused state (identical to unfocused).