Default#

Alert default example rendered by the production Go component.

Enable JavaScript to run the preview. Go source and install commands remain available.

Usage
data := components.AlertData{
    Icon:        icon, // caller-owned ui.Icon, optional
    Title:       "Sync complete",
    Description: "All local changes are safely on disk.",
}
components.Alert(canvas, theme, bounds, data)

Variants#

Alert variants example rendered by the production Go component.

Enable JavaScript to run the preview. Go source and install commands remain available.

Usage
plainData := components.AlertData{
    Icon: icon, Title: "Sync complete",
    Description: "All local changes are safely on disk.",
}
dangerData := components.AlertData{
    Variant: components.AlertDestructive, Icon: icon,
    Title: "Unable to delete project", Description: "Remove any release configurations that still use this project first.",
}
components.Alert(canvas, theme, plainBounds, plainData)
components.Alert(canvas, theme, dangerBounds, dangerData)

Installation

Copy the recipe into your own project.

Repository command
go run ./cmd/viva add --out ./components/local alert

Source-owned usage#

This preview calls the production Go component directly. Stable IDs, values and open state remain owned by the application; the component only paints and declares interaction semantics.

  • Read the linked component source for every option and visual decision.
  • Use the native command to verify system text, focus, accessibility and platform integration.
  • The browser preview validates shared layout and scene behavior, not native performance.

Verification boundary#

The examples cover representative states supported by the current API. They do not imply that every desktop backend has completed hardware validation.

Keyboard

Use Tab to move between controls and Ctrl/⌘ K to search the catalog. Inside a preview, the Go runtime handles keyboard input.