Packages

A platform agnostic Elm-like framework (soft-fork of Lustre)

Current section

Files

Jump to
agnostic src agnostic@platform@opentui@attribute.erl
Raw

src/agnostic@platform@opentui@attribute.erl

-module(agnostic@platform@opentui@attribute).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/agnostic/platform/opentui/attribute.gleam").
-export([width/1, height/1, min_width/1, min_height/1, max_width/1, max_height/1, width_/1, height_/1, min_width_/1, min_height_/1, max_width_/1, max_height_/1, id/1, visible/1, opacity/1, z_index/1, buffered/1, live/1, enable_layout/1, selectable/1, flex_direction/1, flex_grow/1, flex_shrink/1, flex_wrap/1, flex_basis/1, align_items/1, align_self/1, justify_content/1, gap/1, gap_/1, row_gap/1, row_gap_/1, column_gap/1, column_gap_/1, padding/1, padding_top/1, padding_bottom/1, padding_left/1, padding_right/1, margin/1, margin_top/1, margin_bottom/1, margin_left/1, margin_right/1, padding_/1, padding_top_/1, padding_bottom_/1, padding_left_/1, padding_right_/1, margin_/1, margin_top_/1, margin_bottom_/1, margin_left_/1, margin_right_/1, border_style/1, border_color/1, focused_border_color/1, custom_border_chars/1, fg/1, bg/1, color/1, background_color/1, focused_background_color/1, focused_text_color/1, text_color/1, selection_bg/1, selection_fg/1, placeholder_color/1, cursor_color/1, selected_background_color/1, selected_text_color/1, description_color/1, selected_description_color/1, added_bg/1, removed_bg/1, context_bg/1, added_content_bg/1, removed_content_bg/1, context_content_bg/1, added_sign_color/1, removed_sign_color/1, added_line_number_bg/1, removed_line_number_bg/1, line_number_fg/1, line_number_bg/1, ascii_color/1, bold/1, italic/1, underline/1, strikethrough/1, dim/1, blink/1, inverse/1, hidden_text/1, placeholder/1, value/1, initial_value/1, title/1, wrap_mode/1, truncate/1, language/1, filetype/1, content/1, conceal/1, draw_unstyled_text/1, streaming/1, overflow/1, focusable/1, position/1, top/1, top_/1, right/1, right_/1, bottom/1, bottom_/1, left/1, left_/1, should_fill/1, title_alignment/1, title_color/1, max_length/1, min_length/1, show_cursor/1, scroll_margin/1, scroll_speed/1, cursor_style/2, view/1, show_line_numbers/1, options/1, selected_index/1, show_scroll_indicator/1, wrap_selection/1, show_description/1, item_spacing/1, fast_scroll_step/1, tab_width/1, show_scroll_arrows/1, show_underline/1, orientation/1, slider_value/1, min/1, max/1, view_port_size/1, ascii_text/1, font/1, line_number_offset/1, sticky_scroll/1, sticky_start/1, viewport_culling/1]).
-export_type([border_characters/0, cursor_style/0, select_option/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" TUI attribute helpers for OpenTUI. These map to @opentui/core renderable\n"
" properties using Lustre's standard attribute system.\n"
"\n"
).
-type border_characters() :: {border_characters,
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary()}.
-type cursor_style() :: {cursor_style, binary(), boolean()}.
-type select_option() :: {select_option, binary(), binary()}.
-file("src/agnostic/platform/opentui/attribute.gleam", 48).
?DOC(" Set the width of a TUI element.\n").
-spec width(integer()) -> agnostic@vdom@vattr:attribute(any()).
width(Value) ->
agnostic@attribute:attribute(
<<"width"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 54).
?DOC(" Set the height of a TUI element.\n").
-spec height(integer()) -> agnostic@vdom@vattr:attribute(any()).
height(Value) ->
agnostic@attribute:attribute(
<<"height"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 60).
?DOC(" Set the minimum width.\n").
-spec min_width(integer()) -> agnostic@vdom@vattr:attribute(any()).
min_width(Value) ->
agnostic@attribute:attribute(
<<"min-width"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 66).
?DOC(" Set the minimum height.\n").
-spec min_height(integer()) -> agnostic@vdom@vattr:attribute(any()).
min_height(Value) ->
agnostic@attribute:attribute(
<<"min-height"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 72).
?DOC(" Set the maximum width.\n").
-spec max_width(integer()) -> agnostic@vdom@vattr:attribute(any()).
max_width(Value) ->
agnostic@attribute:attribute(
<<"max-width"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 78).
?DOC(" Set the maximum height.\n").
-spec max_height(integer()) -> agnostic@vdom@vattr:attribute(any()).
max_height(Value) ->
agnostic@attribute:attribute(
<<"max-height"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 87).
?DOC(
" Set the width using a string value. Accepts \"auto\", percentages like \"50%\",\n"
" or numeric strings like \"42\".\n"
).
-spec width_(binary()) -> agnostic@vdom@vattr:attribute(any()).
width_(Value) ->
agnostic@attribute:attribute(<<"width"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 94).
?DOC(
" Set the height using a string value. Accepts \"auto\", percentages, or\n"
" numeric strings.\n"
).
-spec height_(binary()) -> agnostic@vdom@vattr:attribute(any()).
height_(Value) ->
agnostic@attribute:attribute(<<"height"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 100).
?DOC(" Set the minimum width using a string value.\n").
-spec min_width_(binary()) -> agnostic@vdom@vattr:attribute(any()).
min_width_(Value) ->
agnostic@attribute:attribute(<<"min-width"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 106).
?DOC(" Set the minimum height using a string value.\n").
-spec min_height_(binary()) -> agnostic@vdom@vattr:attribute(any()).
min_height_(Value) ->
agnostic@attribute:attribute(<<"min-height"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 112).
?DOC(" Set the maximum width using a string value.\n").
-spec max_width_(binary()) -> agnostic@vdom@vattr:attribute(any()).
max_width_(Value) ->
agnostic@attribute:attribute(<<"max-width"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 118).
?DOC(" Set the maximum height using a string value.\n").
-spec max_height_(binary()) -> agnostic@vdom@vattr:attribute(any()).
max_height_(Value) ->
agnostic@attribute:attribute(<<"max-height"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 126).
?DOC(" Set the element id.\n").
-spec id(binary()) -> agnostic@vdom@vattr:attribute(any()).
id(Value) ->
agnostic@attribute:attribute(<<"id"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 132).
?DOC(" Set element visibility.\n").
-spec visible(boolean()) -> agnostic@vdom@vattr:attribute(any()).
visible(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"visible"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"visible"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 141).
?DOC(" Set element opacity (0.0 to 1.0).\n").
-spec opacity(float()) -> agnostic@vdom@vattr:attribute(any()).
opacity(Value) ->
agnostic@attribute:attribute(
<<"opacity"/utf8>>,
gleam_stdlib:float_to_string(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 147).
?DOC(" Set the z-index for layering.\n").
-spec z_index(integer()) -> agnostic@vdom@vattr:attribute(any()).
z_index(Value) ->
agnostic@attribute:attribute(
<<"z-index"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 153).
?DOC(" Enable or disable double-buffered rendering.\n").
-spec buffered(boolean()) -> agnostic@vdom@vattr:attribute(any()).
buffered(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"buffered"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"buffered"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 162).
?DOC(" Enable or disable live updates.\n").
-spec live(boolean()) -> agnostic@vdom@vattr:attribute(any()).
live(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"live"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"live"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 171).
?DOC(" Enable or disable layout participation.\n").
-spec enable_layout(boolean()) -> agnostic@vdom@vattr:attribute(any()).
enable_layout(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"enable-layout"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"enable-layout"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 180).
?DOC(" Enable or disable text selection.\n").
-spec selectable(boolean()) -> agnostic@vdom@vattr:attribute(any()).
selectable(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"selectable"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(
<<"selectable"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 191).
?DOC(" Set the flex direction: \"row\" or \"column\".\n").
-spec flex_direction(binary()) -> agnostic@vdom@vattr:attribute(any()).
flex_direction(Value) ->
agnostic@attribute:attribute(<<"flex-direction"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 197).
?DOC(" Set the flex grow factor.\n").
-spec flex_grow(integer()) -> agnostic@vdom@vattr:attribute(any()).
flex_grow(Value) ->
agnostic@attribute:attribute(
<<"flex-grow"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 203).
?DOC(" Set the flex shrink factor.\n").
-spec flex_shrink(integer()) -> agnostic@vdom@vattr:attribute(any()).
flex_shrink(Value) ->
agnostic@attribute:attribute(
<<"flex-shrink"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 209).
?DOC(" Set flex wrap behavior: \"nowrap\", \"wrap\", \"wrap-reverse\".\n").
-spec flex_wrap(binary()) -> agnostic@vdom@vattr:attribute(any()).
flex_wrap(Value) ->
agnostic@attribute:attribute(<<"flex-wrap"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 215).
?DOC(" Set the flex basis. Accepts \"auto\" or a numeric/percent string.\n").
-spec flex_basis(binary()) -> agnostic@vdom@vattr:attribute(any()).
flex_basis(Value) ->
agnostic@attribute:attribute(<<"flex-basis"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 221).
?DOC(" Set the alignment of items on the cross axis.\n").
-spec align_items(binary()) -> agnostic@vdom@vattr:attribute(any()).
align_items(Value) ->
agnostic@attribute:attribute(<<"align-items"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 228).
?DOC(
" Set the alignment of this element on the cross axis (overrides parent's\n"
" align-items for this element).\n"
).
-spec align_self(binary()) -> agnostic@vdom@vattr:attribute(any()).
align_self(Value) ->
agnostic@attribute:attribute(<<"align-self"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 234).
?DOC(" Set the alignment of items on the main axis.\n").
-spec justify_content(binary()) -> agnostic@vdom@vattr:attribute(any()).
justify_content(Value) ->
agnostic@attribute:attribute(<<"justify-content"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 240).
?DOC(" Set the gap between flex items.\n").
-spec gap(integer()) -> agnostic@vdom@vattr:attribute(any()).
gap(Value) ->
agnostic@attribute:attribute(
<<"gap"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 246).
?DOC(" Set the gap between flex items using a string value (for percentages).\n").
-spec gap_(binary()) -> agnostic@vdom@vattr:attribute(any()).
gap_(Value) ->
agnostic@attribute:attribute(<<"gap"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 252).
?DOC(" Set the gap between rows.\n").
-spec row_gap(integer()) -> agnostic@vdom@vattr:attribute(any()).
row_gap(Value) ->
agnostic@attribute:attribute(
<<"row-gap"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 258).
?DOC(" Set the gap between rows using a string value.\n").
-spec row_gap_(binary()) -> agnostic@vdom@vattr:attribute(any()).
row_gap_(Value) ->
agnostic@attribute:attribute(<<"row-gap"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 264).
?DOC(" Set the gap between columns.\n").
-spec column_gap(integer()) -> agnostic@vdom@vattr:attribute(any()).
column_gap(Value) ->
agnostic@attribute:attribute(
<<"column-gap"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 270).
?DOC(" Set the gap between columns using a string value.\n").
-spec column_gap_(binary()) -> agnostic@vdom@vattr:attribute(any()).
column_gap_(Value) ->
agnostic@attribute:attribute(<<"column-gap"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 278).
?DOC(" Set the padding on all sides.\n").
-spec padding(integer()) -> agnostic@vdom@vattr:attribute(any()).
padding(Value) ->
agnostic@attribute:attribute(
<<"padding"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 284).
?DOC(" Set the top padding.\n").
-spec padding_top(integer()) -> agnostic@vdom@vattr:attribute(any()).
padding_top(Value) ->
agnostic@attribute:attribute(
<<"padding-top"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 290).
?DOC(" Set the bottom padding.\n").
-spec padding_bottom(integer()) -> agnostic@vdom@vattr:attribute(any()).
padding_bottom(Value) ->
agnostic@attribute:attribute(
<<"padding-bottom"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 296).
?DOC(" Set the left padding.\n").
-spec padding_left(integer()) -> agnostic@vdom@vattr:attribute(any()).
padding_left(Value) ->
agnostic@attribute:attribute(
<<"padding-left"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 302).
?DOC(" Set the right padding.\n").
-spec padding_right(integer()) -> agnostic@vdom@vattr:attribute(any()).
padding_right(Value) ->
agnostic@attribute:attribute(
<<"padding-right"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 308).
?DOC(" Set the margin on all sides.\n").
-spec margin(integer()) -> agnostic@vdom@vattr:attribute(any()).
margin(Value) ->
agnostic@attribute:attribute(
<<"margin"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 314).
?DOC(" Set the top margin.\n").
-spec margin_top(integer()) -> agnostic@vdom@vattr:attribute(any()).
margin_top(Value) ->
agnostic@attribute:attribute(
<<"margin-top"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 320).
?DOC(" Set the bottom margin.\n").
-spec margin_bottom(integer()) -> agnostic@vdom@vattr:attribute(any()).
margin_bottom(Value) ->
agnostic@attribute:attribute(
<<"margin-bottom"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 326).
?DOC(" Set the left margin.\n").
-spec margin_left(integer()) -> agnostic@vdom@vattr:attribute(any()).
margin_left(Value) ->
agnostic@attribute:attribute(
<<"margin-left"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 332).
?DOC(" Set the right margin.\n").
-spec margin_right(integer()) -> agnostic@vdom@vattr:attribute(any()).
margin_right(Value) ->
agnostic@attribute:attribute(
<<"margin-right"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 340).
?DOC(" Set the padding on all sides using a string value.\n").
-spec padding_(binary()) -> agnostic@vdom@vattr:attribute(any()).
padding_(Value) ->
agnostic@attribute:attribute(<<"padding"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 346).
?DOC(" Set the top padding using a string value.\n").
-spec padding_top_(binary()) -> agnostic@vdom@vattr:attribute(any()).
padding_top_(Value) ->
agnostic@attribute:attribute(<<"padding-top"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 352).
?DOC(" Set the bottom padding using a string value.\n").
-spec padding_bottom_(binary()) -> agnostic@vdom@vattr:attribute(any()).
padding_bottom_(Value) ->
agnostic@attribute:attribute(<<"padding-bottom"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 358).
?DOC(" Set the left padding using a string value.\n").
-spec padding_left_(binary()) -> agnostic@vdom@vattr:attribute(any()).
padding_left_(Value) ->
agnostic@attribute:attribute(<<"padding-left"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 364).
?DOC(" Set the right padding using a string value.\n").
-spec padding_right_(binary()) -> agnostic@vdom@vattr:attribute(any()).
padding_right_(Value) ->
agnostic@attribute:attribute(<<"padding-right"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 370).
?DOC(" Set the margin on all sides using a string value.\n").
-spec margin_(binary()) -> agnostic@vdom@vattr:attribute(any()).
margin_(Value) ->
agnostic@attribute:attribute(<<"margin"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 376).
?DOC(" Set the top margin using a string value.\n").
-spec margin_top_(binary()) -> agnostic@vdom@vattr:attribute(any()).
margin_top_(Value) ->
agnostic@attribute:attribute(<<"margin-top"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 382).
?DOC(" Set the bottom margin using a string value.\n").
-spec margin_bottom_(binary()) -> agnostic@vdom@vattr:attribute(any()).
margin_bottom_(Value) ->
agnostic@attribute:attribute(<<"margin-bottom"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 388).
?DOC(" Set the left margin using a string value.\n").
-spec margin_left_(binary()) -> agnostic@vdom@vattr:attribute(any()).
margin_left_(Value) ->
agnostic@attribute:attribute(<<"margin-left"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 394).
?DOC(" Set the right margin using a string value.\n").
-spec margin_right_(binary()) -> agnostic@vdom@vattr:attribute(any()).
margin_right_(Value) ->
agnostic@attribute:attribute(<<"margin-right"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 402).
?DOC(" Set the border style: \"single\", \"double\", \"round\", \"bold\", \"none\".\n").
-spec border_style(binary()) -> agnostic@vdom@vattr:attribute(any()).
border_style(Value) ->
agnostic@attribute:attribute(<<"border-style"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 408).
?DOC(" Set the border color.\n").
-spec border_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
border_color(Value) ->
agnostic@attribute:attribute(<<"border-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 414).
?DOC(" Set the border color when the element is focused.\n").
-spec focused_border_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
focused_border_color(Value) ->
agnostic@attribute:attribute(<<"focused-border-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 1111).
-spec encode_border_characters(border_characters()) -> gleam@json:json().
encode_border_characters(Chars) ->
gleam@json:object(
[{<<"topLeft"/utf8>>, gleam@json:string(erlang:element(2, Chars))},
{<<"topRight"/utf8>>, gleam@json:string(erlang:element(3, Chars))},
{<<"bottomLeft"/utf8>>, gleam@json:string(erlang:element(4, Chars))},
{<<"bottomRight"/utf8>>,
gleam@json:string(erlang:element(5, Chars))},
{<<"horizontal"/utf8>>, gleam@json:string(erlang:element(6, Chars))},
{<<"vertical"/utf8>>, gleam@json:string(erlang:element(7, Chars))},
{<<"topT"/utf8>>, gleam@json:string(erlang:element(8, Chars))},
{<<"bottomT"/utf8>>, gleam@json:string(erlang:element(9, Chars))},
{<<"leftT"/utf8>>, gleam@json:string(erlang:element(10, Chars))},
{<<"rightT"/utf8>>, gleam@json:string(erlang:element(11, Chars))},
{<<"cross"/utf8>>, gleam@json:string(erlang:element(12, Chars))}]
).
-file("src/agnostic/platform/opentui/attribute.gleam", 420).
?DOC(" Set custom border characters.\n").
-spec custom_border_chars(border_characters()) -> agnostic@vdom@vattr:attribute(any()).
custom_border_chars(Chars) ->
agnostic@attribute:property(
<<"customBorderChars"/utf8>>,
encode_border_characters(Chars)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 428).
?DOC(" Set the foreground (text) color.\n").
-spec fg(binary()) -> agnostic@vdom@vattr:attribute(any()).
fg(Value) ->
agnostic@attribute:attribute(<<"fg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 434).
?DOC(" Set the background color.\n").
-spec bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
bg(Value) ->
agnostic@attribute:attribute(<<"bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 440).
?DOC(" Alias for fg (foreground color).\n").
-spec color(binary()) -> agnostic@vdom@vattr:attribute(any()).
color(Value) ->
fg(Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 447).
?DOC(
" Set background color for Box components.\n"
" Note: For Text components, use `bg` instead.\n"
).
-spec background_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
background_color(Value) ->
agnostic@attribute:attribute(<<"background-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 454).
?DOC(
" Set the background color when focused (Textarea/Input only).\n"
" Note: BoxRenderable does not support this - use focused_border_color instead.\n"
).
-spec focused_background_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
focused_background_color(Value) ->
agnostic@attribute:attribute(<<"focused-background-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 460).
?DOC(" Set the text color when focused (Textarea/Input only).\n").
-spec focused_text_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
focused_text_color(Value) ->
agnostic@attribute:attribute(<<"focused-text-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 466).
?DOC(" Set the text color (Textarea/Input).\n").
-spec text_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
text_color(Value) ->
agnostic@attribute:attribute(<<"text-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 472).
?DOC(" Set the selection background color.\n").
-spec selection_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
selection_bg(Value) ->
agnostic@attribute:attribute(<<"selection-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 478).
?DOC(" Set the selection foreground color.\n").
-spec selection_fg(binary()) -> agnostic@vdom@vattr:attribute(any()).
selection_fg(Value) ->
agnostic@attribute:attribute(<<"selection-fg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 484).
?DOC(" Set the placeholder text color.\n").
-spec placeholder_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
placeholder_color(Value) ->
agnostic@attribute:attribute(<<"placeholder-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 490).
?DOC(" Set the cursor color.\n").
-spec cursor_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
cursor_color(Value) ->
agnostic@attribute:attribute(<<"cursor-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 496).
?DOC(" Set the background color for the selected item in a select list.\n").
-spec selected_background_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
selected_background_color(Value) ->
agnostic@attribute:attribute(<<"selected-background-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 502).
?DOC(" Set the text color for the selected item in a select list.\n").
-spec selected_text_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
selected_text_color(Value) ->
agnostic@attribute:attribute(<<"selected-text-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 508).
?DOC(" Set the color for item descriptions in a select list.\n").
-spec description_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
description_color(Value) ->
agnostic@attribute:attribute(<<"description-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 514).
?DOC(" Set the description color for the selected item in a select list.\n").
-spec selected_description_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
selected_description_color(Value) ->
agnostic@attribute:attribute(<<"selected-description-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 520).
?DOC(" Set the background color for added lines in a diff view.\n").
-spec added_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
added_bg(Value) ->
agnostic@attribute:attribute(<<"added-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 526).
?DOC(" Set the background color for removed lines in a diff view.\n").
-spec removed_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
removed_bg(Value) ->
agnostic@attribute:attribute(<<"removed-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 532).
?DOC(" Set the background color for context lines in a diff view.\n").
-spec context_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
context_bg(Value) ->
agnostic@attribute:attribute(<<"context-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 538).
?DOC(" Set the content background for added lines in a diff view.\n").
-spec added_content_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
added_content_bg(Value) ->
agnostic@attribute:attribute(<<"added-content-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 544).
?DOC(" Set the content background for removed lines in a diff view.\n").
-spec removed_content_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
removed_content_bg(Value) ->
agnostic@attribute:attribute(<<"removed-content-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 550).
?DOC(" Set the content background for context lines in a diff view.\n").
-spec context_content_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
context_content_bg(Value) ->
agnostic@attribute:attribute(<<"context-content-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 556).
?DOC(" Set the sign color for added lines in a diff view.\n").
-spec added_sign_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
added_sign_color(Value) ->
agnostic@attribute:attribute(<<"added-sign-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 562).
?DOC(" Set the sign color for removed lines in a diff view.\n").
-spec removed_sign_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
removed_sign_color(Value) ->
agnostic@attribute:attribute(<<"removed-sign-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 568).
?DOC(" Set the background for added line numbers in a diff view.\n").
-spec added_line_number_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
added_line_number_bg(Value) ->
agnostic@attribute:attribute(<<"added-line-number-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 574).
?DOC(" Set the background for removed line numbers in a diff view.\n").
-spec removed_line_number_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
removed_line_number_bg(Value) ->
agnostic@attribute:attribute(<<"removed-line-number-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 580).
?DOC(" Set the foreground color for line numbers.\n").
-spec line_number_fg(binary()) -> agnostic@vdom@vattr:attribute(any()).
line_number_fg(Value) ->
agnostic@attribute:attribute(<<"line-number-fg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 586).
?DOC(" Set the background color for line numbers.\n").
-spec line_number_bg(binary()) -> agnostic@vdom@vattr:attribute(any()).
line_number_bg(Value) ->
agnostic@attribute:attribute(<<"line-number-bg"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 592).
?DOC(" Set the color for an ASCIIFont element.\n").
-spec ascii_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
ascii_color(Value) ->
agnostic@attribute:attribute(<<"ascii-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 600).
?DOC(" Make text bold.\n").
-spec bold(boolean()) -> agnostic@vdom@vattr:attribute(any()).
bold(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"bold"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"bold"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 609).
?DOC(" Make text italic.\n").
-spec italic(boolean()) -> agnostic@vdom@vattr:attribute(any()).
italic(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"italic"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"italic"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 618).
?DOC(" Underline text.\n").
-spec underline(boolean()) -> agnostic@vdom@vattr:attribute(any()).
underline(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"underline"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"underline"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 627).
?DOC(" Strikethrough text.\n").
-spec strikethrough(boolean()) -> agnostic@vdom@vattr:attribute(any()).
strikethrough(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"strikethrough"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"strikethrough"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 636).
?DOC(" Dim text.\n").
-spec dim(boolean()) -> agnostic@vdom@vattr:attribute(any()).
dim(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"dim"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"dim"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 645).
?DOC(" Make text blink.\n").
-spec blink(boolean()) -> agnostic@vdom@vattr:attribute(any()).
blink(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"blink"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"blink"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 654).
?DOC(" Invert text foreground and background colors.\n").
-spec inverse(boolean()) -> agnostic@vdom@vattr:attribute(any()).
inverse(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"inverse"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"inverse"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 663).
?DOC(" Hide text (renders as invisible but still takes up space).\n").
-spec hidden_text(boolean()) -> agnostic@vdom@vattr:attribute(any()).
hidden_text(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"hidden-text"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"hidden-text"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 674).
?DOC(" Set placeholder text for inputs.\n").
-spec placeholder(binary()) -> agnostic@vdom@vattr:attribute(any()).
placeholder(Value) ->
agnostic@attribute:attribute(<<"placeholder"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 680).
?DOC(" Set the value of an input element.\n").
-spec value(binary()) -> agnostic@vdom@vattr:attribute(any()).
value(Value) ->
agnostic@attribute:attribute(<<"value"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 686).
?DOC(" Set the initial value of a textarea element.\n").
-spec initial_value(binary()) -> agnostic@vdom@vattr:attribute(any()).
initial_value(Value) ->
agnostic@attribute:attribute(<<"initial-value"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 692).
?DOC(" Set a title.\n").
-spec title(binary()) -> agnostic@vdom@vattr:attribute(any()).
title(Value) ->
agnostic@attribute:attribute(<<"title"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 698).
?DOC(" Set the text wrap mode: \"none\", \"char\", \"word\".\n").
-spec wrap_mode(binary()) -> agnostic@vdom@vattr:attribute(any()).
wrap_mode(Value) ->
agnostic@attribute:attribute(<<"wrap-mode"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 704).
?DOC(" Truncate text that overflows.\n").
-spec truncate(boolean()) -> agnostic@vdom@vattr:attribute(any()).
truncate(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"truncate"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"truncate"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 715).
?DOC(" Set the programming language for syntax highlighting.\n").
-spec language(binary()) -> agnostic@vdom@vattr:attribute(any()).
language(Value) ->
agnostic@attribute:attribute(<<"language"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 721).
?DOC(" Set the filetype (alias for language).\n").
-spec filetype(binary()) -> agnostic@vdom@vattr:attribute(any()).
filetype(Value) ->
agnostic@attribute:attribute(<<"filetype"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 727).
?DOC(" Set the text content of a text, code, or markdown element.\n").
-spec content(binary()) -> agnostic@vdom@vattr:attribute(any()).
content(Value) ->
agnostic@attribute:property(<<"content"/utf8>>, gleam@json:string(Value)).
-file("src/agnostic/platform/opentui/attribute.gleam", 733).
?DOC(" Enable or disable text concealing in code/markdown.\n").
-spec conceal(boolean()) -> agnostic@vdom@vattr:attribute(any()).
conceal(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"conceal"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"conceal"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 742).
?DOC(" Enable or disable drawing of unstyled text in code blocks.\n").
-spec draw_unstyled_text(boolean()) -> agnostic@vdom@vattr:attribute(any()).
draw_unstyled_text(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"draw-unstyled-text"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"draw-unstyled-text"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 751).
?DOC(" Enable or disable streaming mode for code/markdown.\n").
-spec streaming(boolean()) -> agnostic@vdom@vattr:attribute(any()).
streaming(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"streaming"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"streaming"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 765).
?DOC(" Set overflow behavior: \"hidden\", \"scroll\", \"visible\".\n").
-spec overflow(binary()) -> agnostic@vdom@vattr:attribute(any()).
overflow(Value) ->
agnostic@attribute:attribute(<<"overflow"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 778).
?DOC(
" Make an element focusable for keyboard navigation (Tab to move between\n"
" elements via `focus_next`/`focus_previous` effects).\n"
"\n"
" Note: `input`, `textarea`, `select`, `tab_select`, and `scrollbox` are\n"
" focusable by default. Use this attribute to make `box` elements focusable,\n"
" or to disable focus on normally-focusable elements with `focusable(False)`.\n"
).
-spec focusable(boolean()) -> agnostic@vdom@vattr:attribute(any()).
focusable(Value) ->
case Value of
true ->
agnostic@attribute:attribute(<<"focusable"/utf8>>, <<"true"/utf8>>);
false ->
agnostic@attribute:attribute(<<"focusable"/utf8>>, <<"false"/utf8>>)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 789).
?DOC(" Set the position type: \"relative\" or \"absolute\".\n").
-spec position(binary()) -> agnostic@vdom@vattr:attribute(any()).
position(Value) ->
agnostic@attribute:attribute(<<"position"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 795).
?DOC(" Set the top position offset.\n").
-spec top(integer()) -> agnostic@vdom@vattr:attribute(any()).
top(Value) ->
agnostic@attribute:attribute(
<<"top"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 801).
?DOC(" Set the top position offset using a string value.\n").
-spec top_(binary()) -> agnostic@vdom@vattr:attribute(any()).
top_(Value) ->
agnostic@attribute:attribute(<<"top"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 807).
?DOC(" Set the right position offset.\n").
-spec right(integer()) -> agnostic@vdom@vattr:attribute(any()).
right(Value) ->
agnostic@attribute:attribute(
<<"right"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 813).
?DOC(" Set the right position offset using a string value.\n").
-spec right_(binary()) -> agnostic@vdom@vattr:attribute(any()).
right_(Value) ->
agnostic@attribute:attribute(<<"right"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 819).
?DOC(" Set the bottom position offset.\n").
-spec bottom(integer()) -> agnostic@vdom@vattr:attribute(any()).
bottom(Value) ->
agnostic@attribute:attribute(
<<"bottom"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 825).
?DOC(" Set the bottom position offset using a string value.\n").
-spec bottom_(binary()) -> agnostic@vdom@vattr:attribute(any()).
bottom_(Value) ->
agnostic@attribute:attribute(<<"bottom"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 831).
?DOC(" Set the left position offset.\n").
-spec left(integer()) -> agnostic@vdom@vattr:attribute(any()).
left(Value) ->
agnostic@attribute:attribute(
<<"left"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 837).
?DOC(" Set the left position offset using a string value.\n").
-spec left_(binary()) -> agnostic@vdom@vattr:attribute(any()).
left_(Value) ->
agnostic@attribute:attribute(<<"left"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 845).
?DOC(" Fill the box with the background color.\n").
-spec should_fill(boolean()) -> agnostic@vdom@vattr:attribute(any()).
should_fill(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"should-fill"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"should-fill"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 854).
?DOC(" Set the title alignment: \"left\", \"center\", \"right\".\n").
-spec title_alignment(binary()) -> agnostic@vdom@vattr:attribute(any()).
title_alignment(Value) ->
agnostic@attribute:attribute(<<"title-alignment"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 860).
?DOC(" Set the box title color. Falls back to the border color when unset.\n").
-spec title_color(binary()) -> agnostic@vdom@vattr:attribute(any()).
title_color(Value) ->
agnostic@attribute:attribute(<<"title-color"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 868).
?DOC(" Set the maximum input length.\n").
-spec max_length(integer()) -> agnostic@vdom@vattr:attribute(any()).
max_length(Value) ->
agnostic@attribute:attribute(
<<"max-length"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 876).
?DOC(
" Set the minimum input length (input elements only). While the value is\n"
" shorter than this, submit (Enter) is rejected and no enter event fires.\n"
" Must not exceed `max_length` — OpenTUI throws otherwise.\n"
).
-spec min_length(integer()) -> agnostic@vdom@vattr:attribute(any()).
min_length(Value) ->
agnostic@attribute:attribute(
<<"min-length"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 882).
?DOC(" Show or hide the cursor.\n").
-spec show_cursor(boolean()) -> agnostic@vdom@vattr:attribute(any()).
show_cursor(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"show-cursor"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"show-cursor"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 896).
?DOC(
" Set the editor's caret-follow scroll margin as a fraction of the editor's\n"
" own viewport (e.g. 0.2 means the editor scrolls once the caret comes within\n"
" 20% of the top/bottom edge). Out-of-range values are clamped by OpenTUI.\n"
"\n"
" Only applicable to textarea and input elements. This tunes the\n"
" *intra-editor* caret follow — it is unrelated to `scrollbox` scrolling.\n"
).
-spec scroll_margin(float()) -> agnostic@vdom@vattr:attribute(any()).
scroll_margin(Value) ->
agnostic@attribute:attribute(
<<"scroll-margin"/utf8>>,
gleam_stdlib:float_to_string(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 902).
?DOC(" Set the scroll speed.\n").
-spec scroll_speed(integer()) -> agnostic@vdom@vattr:attribute(any()).
scroll_speed(Value) ->
agnostic@attribute:attribute(
<<"scroll-speed"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 1104).
-spec encode_cursor_style(binary(), boolean()) -> gleam@json:json().
encode_cursor_style(Style, Blinking) ->
gleam@json:object(
[{<<"style"/utf8>>, gleam@json:string(Style)},
{<<"blinking"/utf8>>, gleam@json:bool(Blinking)}]
).
-file("src/agnostic/platform/opentui/attribute.gleam", 908).
?DOC(" Set the cursor style. Pass style name and whether it should blink.\n").
-spec cursor_style(binary(), boolean()) -> agnostic@vdom@vattr:attribute(any()).
cursor_style(Style, Blinking) ->
agnostic@attribute:property(
<<"cursorStyle"/utf8>>,
encode_cursor_style(Style, Blinking)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 918).
?DOC(" Set the diff view mode: \"unified\" or \"split\".\n").
-spec view(binary()) -> agnostic@vdom@vattr:attribute(any()).
view(Value) ->
agnostic@attribute:attribute(<<"view"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 924).
?DOC(" Show or hide line numbers.\n").
-spec show_line_numbers(boolean()) -> agnostic@vdom@vattr:attribute(any()).
show_line_numbers(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"show-line-numbers"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"show-line-numbers"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 1095).
-spec encode_select_options(list(select_option())) -> gleam@json:json().
encode_select_options(Opts) ->
gleam@json:array(
Opts,
fun(Opt) ->
gleam@json:object(
[{<<"name"/utf8>>, gleam@json:string(erlang:element(2, Opt))},
{<<"description"/utf8>>,
gleam@json:string(erlang:element(3, Opt))}]
)
end
).
-file("src/agnostic/platform/opentui/attribute.gleam", 935).
?DOC(" Set select options. Each option is a tuple of (name, description).\n").
-spec options(list(select_option())) -> agnostic@vdom@vattr:attribute(any()).
options(Opts) ->
agnostic@attribute:property(<<"options"/utf8>>, encode_select_options(Opts)).
-file("src/agnostic/platform/opentui/attribute.gleam", 941).
?DOC(" Set the currently selected index.\n").
-spec selected_index(integer()) -> agnostic@vdom@vattr:attribute(any()).
selected_index(Value) ->
agnostic@attribute:attribute(
<<"selected-index"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 947).
?DOC(" Show or hide the scroll indicator.\n").
-spec show_scroll_indicator(boolean()) -> agnostic@vdom@vattr:attribute(any()).
show_scroll_indicator(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"show-scroll-indicator"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"show-scroll-indicator"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 956).
?DOC(" Enable or disable wrapping at the ends of the selection list.\n").
-spec wrap_selection(boolean()) -> agnostic@vdom@vattr:attribute(any()).
wrap_selection(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"wrap-selection"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"wrap-selection"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 965).
?DOC(" Show or hide item descriptions.\n").
-spec show_description(boolean()) -> agnostic@vdom@vattr:attribute(any()).
show_description(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"show-description"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"show-description"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 974).
?DOC(" Set the spacing between items.\n").
-spec item_spacing(integer()) -> agnostic@vdom@vattr:attribute(any()).
item_spacing(Value) ->
agnostic@attribute:attribute(
<<"item-spacing"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 980).
?DOC(" Set the number of items to skip when fast-scrolling.\n").
-spec fast_scroll_step(integer()) -> agnostic@vdom@vattr:attribute(any()).
fast_scroll_step(Value) ->
agnostic@attribute:attribute(
<<"fast-scroll-step"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 988).
?DOC(" Set the tab width.\n").
-spec tab_width(integer()) -> agnostic@vdom@vattr:attribute(any()).
tab_width(Value) ->
agnostic@attribute:attribute(
<<"tab-width"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 994).
?DOC(" Show or hide scroll arrows.\n").
-spec show_scroll_arrows(boolean()) -> agnostic@vdom@vattr:attribute(any()).
show_scroll_arrows(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"show-scroll-arrows"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"show-scroll-arrows"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 1003).
?DOC(" Show or hide the underline.\n").
-spec show_underline(boolean()) -> agnostic@vdom@vattr:attribute(any()).
show_underline(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"show-underline"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"show-underline"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 1014).
?DOC(" Set the slider orientation: \"horizontal\" or \"vertical\".\n").
-spec orientation(binary()) -> agnostic@vdom@vattr:attribute(any()).
orientation(Value) ->
agnostic@attribute:attribute(<<"orientation"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 1020).
?DOC(" Set the slider value (property-based, accepts Float).\n").
-spec slider_value(float()) -> agnostic@vdom@vattr:attribute(any()).
slider_value(Value) ->
agnostic@attribute:property(<<"value"/utf8>>, gleam@json:float(Value)).
-file("src/agnostic/platform/opentui/attribute.gleam", 1026).
?DOC(" Set the slider minimum value.\n").
-spec min(float()) -> agnostic@vdom@vattr:attribute(any()).
min(Value) ->
agnostic@attribute:property(<<"min"/utf8>>, gleam@json:float(Value)).
-file("src/agnostic/platform/opentui/attribute.gleam", 1032).
?DOC(" Set the slider maximum value.\n").
-spec max(float()) -> agnostic@vdom@vattr:attribute(any()).
max(Value) ->
agnostic@attribute:property(<<"max"/utf8>>, gleam@json:float(Value)).
-file("src/agnostic/platform/opentui/attribute.gleam", 1038).
?DOC(" Set the slider viewport size (for scrollbar-style sliders).\n").
-spec view_port_size(float()) -> agnostic@vdom@vattr:attribute(any()).
view_port_size(Value) ->
agnostic@attribute:property(
<<"viewPortSize"/utf8>>,
gleam@json:float(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 1046).
?DOC(" Set the text for an ASCIIFont element.\n").
-spec ascii_text(binary()) -> agnostic@vdom@vattr:attribute(any()).
ascii_text(Value) ->
agnostic@attribute:attribute(<<"ascii-text"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 1052).
?DOC(" Set the font for an ASCIIFont or Select element.\n").
-spec font(binary()) -> agnostic@vdom@vattr:attribute(any()).
font(Value) ->
agnostic@attribute:attribute(<<"font"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 1060).
?DOC(" Set the line number offset.\n").
-spec line_number_offset(integer()) -> agnostic@vdom@vattr:attribute(any()).
line_number_offset(Value) ->
agnostic@attribute:attribute(
<<"line-number-offset"/utf8>>,
erlang:integer_to_binary(Value)
).
-file("src/agnostic/platform/opentui/attribute.gleam", 1068).
?DOC(" Enable or disable sticky scroll behavior.\n").
-spec sticky_scroll(boolean()) -> agnostic@vdom@vattr:attribute(any()).
sticky_scroll(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"sticky-scroll"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"sticky-scroll"/utf8>>,
<<"false"/utf8>>
)
end.
-file("src/agnostic/platform/opentui/attribute.gleam", 1077).
?DOC(" Set the sticky start direction: \"bottom\", \"top\", \"left\", \"right\".\n").
-spec sticky_start(binary()) -> agnostic@vdom@vattr:attribute(any()).
sticky_start(Value) ->
agnostic@attribute:attribute(<<"sticky-start"/utf8>>, Value).
-file("src/agnostic/platform/opentui/attribute.gleam", 1083).
?DOC(" Enable or disable viewport culling for scrollbox performance.\n").
-spec viewport_culling(boolean()) -> agnostic@vdom@vattr:attribute(any()).
viewport_culling(Value) ->
case Value of
true ->
agnostic@attribute:attribute(
<<"viewport-culling"/utf8>>,
<<"true"/utf8>>
);
false ->
agnostic@attribute:attribute(
<<"viewport-culling"/utf8>>,
<<"false"/utf8>>
)
end.