Raxol.UI.Components.Button (Raxol v0.5.0)
View SourceA customizable button component.
This module provides a more sophisticated button component than the basic button element, with support for various styles and behaviors.
Example
alias Raxol.UI.Components.Button
Button.new("Save Changes", on_click: :save_clicked, style: :primary)
Summary
Functions
Creates a new button with the given label and options.
Renders the button as a basic element.
Types
@type t() :: map()
Functions
Creates a new button with the given label and options.
Options
:on_click
- Message to send when the button is clicked:style
- Button style (:primary, :secondary, :danger, :success, or a custom style map):disabled
- Whether the button is disabled:icon
- Icon to display before the label:full_width
- Whether the button should take full width:size
- Button size (:small, :medium, :large):tooltip
- Tooltip text to show on hover
Returns
A button component that can be used in a Raxol view.
Example
Button.new("Delete",
on_click: {:delete, item_id},
style: :danger,
icon: :trash
)
Renders the button as a basic element.
This is typically called by the renderer, not directly by users.