Pdf.Component.Alert (ex_pdf_components v1.0.1)

Copy Markdown View Source

Alert/Callout component for PDF documents.

Renders a colored notification box with an icon character, title, and message text. Supports info, warning, error, and success variants.

Examples

doc |> Pdf.Component.Alert.render({50, 700}, %{
  type: :info,
  title: "Note",
  message: "This is an informational message.",
  width: 400
})

doc |> Pdf.Component.Alert.render({50, 700}, %{
  type: :error,
  title: "Error",
  message: "Something went wrong. Please try again.",
  width: 400
})

Summary

Functions

Render an alert at {x, y}.

Functions

render(doc, arg, style \\ %{})

Render an alert at {x, y}.

Style options

  • :type:info (default), :success, :warning, or :error
  • :title — bold title text
  • :message — body message text (required)
  • :width — alert width (required)
  • :font — font name (default "Helvetica")
  • :padding — inner padding (default 12)
  • :border_radius — corner radius (default 5)
  • :icon — override icon character