Skip to content

Issue #3 - [FEATURE] Add multiple alert box types and customization optionsΒ #7

@zenocross

Description

@zenocross

Description

Currently, alert boxes only display warning-type dialogs. The system needs support for different alert types (info, success, error, question) with appropriate icons and styling, plus the ability to create custom popups with configurable buttons.

Current Behavior

  • Alert boxes only show warning type
  • Limited to default warning icon and styling
  • Fixed button configuration

Expected Behavior

Alert system should support:

  • Multiple alert types: Info, Success, Warning, Error, Question
  • Type-specific icons: Each type displays an appropriate icon
  • Custom popups: Ability to define custom UI and button configurations
  • Flexible button options: Configurable number and labels of buttons

Use Cases

  • Info alerts: Display informational messages (e.g., "File uploaded successfully")
  • Success alerts: Confirm completed actions
  • Error alerts: Show error messages with appropriate severity
  • Question alerts: Prompt user decisions (e.g., "Save changes?")
  • Custom dialogs: Build specialized popups for unique workflows

Proposed Solution

Implement an enhanced alert API that accepts:

  • type parameter: 'info' | 'success' | 'warning' | 'error' | 'question'
  • icon parameter: Custom icon override
  • buttons parameter: Array of button configurations
  • customUI parameter: Optional custom content/layout

Example Usage

// Basic typed alert
puter.ui.alert({
  type: 'success',
  message: 'File uploaded successfully'
});

// Custom buttons
puter.ui.alert({
  type: 'question',
  message: 'Save changes before closing?',
  buttons: ['Save', 'Don\'t Save', 'Cancel']
});

Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAuto-created label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions