B4A Library [B4X][B4A] B4XDaisyAlert - Cross-platform DaisyUI Alert Component

Hi Fam

I am sharing a new custom view class, B4XDaisyAlert, which ports the versatile Alert component from the DaisyUI library to B4X. It is designed to be highly customizable and easy to integrate into B4A, B4i, and B4J projects.

1771947238224.png
1771947275949.png
1771947326367.png


Key Features:
Cross-Platform: Compatible with B4A, B4i, and B4J (via XUI).
Multiple Styles: Supports solid, soft, outline, and dash visual styles.
Contextual Variants: Built-in themes for info, success, warning, and error.
Flexible Sizing: Accepts standard dip values or Tailwind-like tokens (e.g., "full", "12", "320px").
Dynamic Actions: Easily add action buttons (e.g., "Accept", "Deny") with responsive layout support.
Icon Support: Built-in SVG icon handling with automatic or manual coloring.

PS: We are yet to create buttons

B4X:
' Initialize the alert
Dim alert As B4XDaisyAlert
alert.Initialize(Me, "alert")

' Configure properties
alert.Variant = "info"
alert.AlertStyle = "soft"
alert.Title = "Update Available"
alert.Text = "A new version of the application is ready to install."
alert.IconAsset = "circle-question-regular.svg"

' Add to parent view
alert.AddToParent(Root, 10dip, 10dip, 300dip, 0)

' Add Action Button
alert.AddActionButton("Install Now", "install_tag")


Related Content

 
Top