Inline messages in four semantic colors (info, success, warning, danger). Supports dismiss, action links, action buttons, and list content.
DefaultRendered example
Update Available
A new version is available. Please update to the latest version.
Successfully Subscribed
Success! You've subscribed to our newsletter. Welcome aboard!
Credit Card Expires Soon
Your credit card expires soon. Please update your payment information.
Invalid Email Address
The email address you entered is invalid. Please try again.
Usage Example
@alert.Alert(alert.Config{Title:"Update Available",Description:"A new version is available.",Tone:alert.ToneInfo,})
Built-in text: the development API provides expressions.Alert for application defaults, request preferences, and individual component overrides. Read the expression guide.
Dismissible
Dismissible: true adds a close button that fades the alert out via an Alpine transition.
DismissibleRendered example
Update Available
A new version is available. Please update to the latest version.
Successfully Subscribed
Success! You've subscribed to our newsletter. Welcome aboard!
Credit Card Expires Soon
Your credit card expires soon. Please update your payment information.
Invalid Email Address
The email address you entered is invalid. Please try again.
@alert.Alert(alert.Config{Title:"Update Available",Description:"A new version is available.",Tone:alert.ToneInfo,Link:&alert.LinkConfig{Label:"Details",Href:"#"},})
With List
Pass ListItems to render a bulleted list under the description.
With ListRendered example
Password is not strong
The password you entered does not meet the requirements. Make sure your password:
has minimum 8 characters
includes both upper and lower cases
contains at least one number
Password Requirements
In order to keep your account secure, make sure your password:
has minimum 8 characters
includes both upper and lower cases
contains at least one number
With List
@alert.Alert(alert.Config{Title:"Password Requirements",Description:"Make sure your password:",Tone:alert.ToneInfo,ListItems:[]string{"has minimum 8 characters","includes both upper and lower cases","contains at least one number",},})
With Action Buttons
Attach an Action config for primary + dismiss buttons.
With Action ButtonsRendered example
Update Available
A new version is available. Please update to the latest version.
Successfully Subscribed
Success! You've subscribed to our newsletter. Welcome aboard!
Credit Card Expires Soon
Your credit card expires soon. Please update your payment information.
Invalid Email Address
The email address you entered is invalid. Please try again.
With Action Buttons
@alert.Alert(alert.Config{Title:"Update Available",Description:"A new version is available.",Tone:alert.ToneInfo,Action:&alert.ActionConfig{PrimaryLabel:"Update Now",PrimaryOnClick:"alert('Updating...')",DismissLabel:"Dismiss",},})
Go API
v0.4.0
The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.
Goshtoso can store preferences and demo state in your browser. Some examples use cookies and IndexedDB to persist local demo state. There is no analytics, advertising, or third-party tracking. You can use the site without storage, but preferences and some examples will reset or stop persisting. Details in our Privacy Policy.