Packages
Multi-surface application runtime for Elixir. One TEA module renders to terminal, browser (LiveView), SSH, and MCP (agents). 30+ widgets, flexbox + CSS grid, AI agent runtime, distributed swarm with CRDTs, time-travel debugging, session recording, sandboxed REPL, and agentic commerce.
Current section
Files
Jump to
Current section
Files
lib/raxol/ui/components/input/text_input/renderer.ex
defmodule Raxol.UI.Components.Input.TextInput.Renderer do
@moduledoc """
Handles rendering logic for the TextInput component.
This includes display value formatting, style management, and visual feedback.
"""
use Phoenix.Component
@doc """
Renders the text input component with appropriate styling and visual feedback.
"""
def render(assigns) do
~H"""
<div class="text-input">
<input
type="text"
value={@value}
placeholder={@placeholder}
class={[
"text-input__field",
@error && "text-input__field--error",
@warning && "text-input__field--warning"
]}
phx-keydown="keydown"
phx-keyup="keyup"
phx-blur="blur"
phx-focus="focus"
/>
<%= if @error do %>
<div class="text-input__error">
<%= @error %>
</div>
<% end %>
<%= if @warning do %>
<div class="text-input__warning">
<%= @warning %>
</div>
<% end %>
</div>
"""
end
# Private helpers
end