Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →You can customize stream alerts with CSS and JavaScript in StreamElements by adding an AlertBox to an overlay, enabling custom code for the event type you want to change, and editing its template in the Code Editor. CSS handles appearance and animation; HTML controls the alert’s structure; JavaScript can work with widget events and timing. Preview the result, then test it in the browser source in your actual streaming scene.
Choose the right alert workflow
For an event-specific alert in StreamElements, start with the native AlertBox. It displays live events from a queue, and its custom-code settings are attached to individual alert types. Use a Custom Widget instead when you need a more general-purpose overlay element, configurable editor fields, or JavaScript that responds to widget lifecycle and event-received notifications. These are distinct workflows, not interchangeable names for the same editor. See StreamElements’ overlay setup guide and its overlay documentation.
If you prefer preset visuals and a more guided setup, Streamlabs documents an Alert Box workflow with themes, test controls, and a browser-source URL. Its theme workflow is a lower-code alternative, not the same thing as writing HTML, CSS, and JavaScript for an AlertBox. Details: Streamlabs’ alert setup guide.
Customize an event in the StreamElements AlertBox
- Create an overlay. In the StreamElements Overlay Editor, create an overlay and select a canvas resolution that matches the scene or browser-source dimensions you plan to use. Keep the overlay’s intended placement and available screen area in mind when choosing dimensions.
- Add an AlertBox. Add the native AlertBox widget to the overlay, open its options, and select the tab for the event you want to customize—for example, Followers.
- Enable custom code for that event. In the selected event’s settings, turn on Enable custom CSS. Open the Overlay Editor’s Code Editor and edit the alert’s HTML, CSS, and JavaScript there. The setting is per alert type, so configure each event type you want to style rather than assuming one change applies to every alert.
- Use the template values for that event. Insert only variables supported for the particular event. The available values vary: examples include
{{name}}for the person associated with an event,{{amount}}where an amount applies,{{tier}}for subscription tiers,{{sender}}for a gifted-subscription sender,{{currency}}for tips, and{{message}}or{{messageRaw}}for user messages. Media variables include{{image}},{{video}}, and{{audio}};{{widgetDuration}}gives a duration in seconds. Consult the AlertBox custom-code reference for the current variables and examples. - Save and test in the destination scene. Check the overlay preview, then trigger representative events and inspect the alert through the browser source in your streaming software. Confirm the size, position, visibility, text wrapping, and animation in the scene where viewers will see it.
Build a simple responsive alert
This pattern illustrates the division of work: the HTML supplies a container and event text, CSS styles and animates it, and a JavaScript timer can remove an exit class after the configured duration. Adapt the markup and variables to the event type and template supported by your AlertBox; this is a starting pattern, not a complete drop-in template for every event.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
HTML
<div class="alert">
<div class="alert__title">{{name}}</div>
<div class="alert__message">{{message}}</div>
</div>
CSS
.alert {
box-sizing: border-box;
width: min(90vw, 560px);
padding: 20px 24px;
border: 2px solid #78e6ff;
border-radius: 16px;
background: rgba(12, 18, 34, 0.94);
color: #fff;
font: 700 24px/1.25 system-ui, sans-serif;
overflow-wrap: anywhere;
animation: alert-in 350ms ease-out both;
}
.alert__title {
color: #78e6ff;
font-size: 1.15em;
}
.alert__message {
margin-top: 8px;
font-size: 0.8em;
font-weight: 500;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
@keyframes alert-in {
from { opacity: 0; transform: translateY(18px) scale(0.96); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
.alert.is-exiting {
opacity: 0;
transform: translateY(-10px);
transition: opacity 250ms ease-in, transform 250ms ease-in;
}
JavaScript timing
For a Custom Widget, StreamElements documents onWidgetLoad and onEventReceived as widget events. Their event data should be handled according to the current reference rather than assumed undocumented payload structures. A minimal timer pattern for an alert element is:
const alertElement = document.querySelector('.alert');
if (alertElement) {
const durationSeconds = Number('{{widgetDuration}}');
const durationMs = Number.isFinite(durationSeconds) && durationSeconds > 0
? durationSeconds * 1000
: 8000;
window.setTimeout(() => {
alertElement.classList.add('is-exiting');
}, Math.max(0, durationMs - 250));
}
The documented duration value is in seconds, while JavaScript’s setTimeout takes milliseconds; multiply seconds by 1,000. The fallback above is an example default, not a StreamElements setting. Align the timer with the alert’s configured duration and exit animation so it does not disappear too early or linger after the platform removes it. Check the platform’s own custom-code examples before relying on template interpolation in a particular script context.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
When a Custom Widget is the better fit
A Custom Widget gives you separate HTML, CSS, JavaScript, and FIELDS tabs. Use it when you want editor-configurable settings—such as a text label or color choice—or need to react to widget loading and incoming events outside the native AlertBox’s event-specific template. StreamElements’ Custom Widget tutorial and widget structure reference document the editor, fields, event listeners, and sandbox.
Practical boundaries
- Keep the widget’s JavaScript and DOM handling minimal. The documented environment is a protected sandbox, with limitations including no access to cookies,
console.*, or IndexedDB storage. - Do not assume session-data keys or event payload shapes are permanent; the documentation warns that session-data keys may change. Use current documented fields and verify the values for the event you are handling.
- External libraries can be included, but adding a dependency introduces availability and behavior risks. Prefer code that does not depend on an external script unless it materially helps the alert.
- Use CSS that tolerates different overlay canvas dimensions and unusually long names or messages. Test line breaks, punctuation, and special characters in the actual scene.
Test alerts before going live
- Preview in the editor. Check that the chosen event template renders and that the CSS selector matches the markup used for that alert.
- Trigger test events. Test every event type you changed, including one with a long name or message when the event supports text. Verify media URLs and amount, tier, or currency fields only where relevant.
- Check the streaming-software scene. Confirm the browser source is enabled, positioned correctly, sized to the overlay, and visible above the game or other scene content. An editor preview alone does not confirm the browser-source scene is correct.
- Check timing and repeat behavior. Verify the enter and exit animations complete within the widget’s duration. Test more than one alert in succession so queue behavior and lingering elements do not obscure later events.
Streamlabs users can add their Alert Box as a browser source, use its documented test controls, and filter event types for a browser-source Widget URL. The exact controls differ from StreamElements; follow the Streamlabs setup steps for that workflow.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Troubleshoot common alert problems
| Symptom | Likely cause | What to check |
|---|---|---|
| Alert looks unchanged | Custom code is not enabled for the event being tested, or the selector does not match the alert markup. | Open that event’s AlertBox tab, confirm custom code is enabled, and compare the CSS selector with the HTML class or element. |
| Name or message is blank | The variable is unsupported for that event, misspelled, or not present in the sample event. | Check the current AlertBox variable reference and test a relevant event type; variables differ by event. |
| Alert works in preview but not in the scene | The browser source may have different dimensions, placement, visibility, or refresh state. | Inspect the source in the actual scene, confirm it uses the intended overlay, and check its size and layer order. |
| Text is clipped or runs off screen | The content is longer than the layout allows, or fixed dimensions do not fit the canvas. | Use wrapping rules such as overflow-wrap: anywhere, a responsive width, and test long text at the target source dimensions. |
| Exit animation is cut off or the alert lingers | The timer units or delay do not match the configured duration and animation length. | Convert seconds to milliseconds for setTimeout, then account for the exit transition and the platform’s widget duration. |
| JavaScript behavior fails in a Custom Widget | The code relies on unavailable sandbox APIs or undocumented event/session data. | Remove reliance on cookies, console.*, or IndexedDB, and use current documented event fields and lifecycle handlers. |
| One event type is styled but another is not | AlertBox custom code and settings are configured per event type. | Configure and test each alert tab that should use the design. |
Or let it run in the cloud
If your goal is to keep a pre-recorded YouTube stream running rather than customize its on-screen alerts, StreamNeo is a separate option: upload a recording or build a playlist, add your YouTube stream key, and go live. It loops uploaded videos from the cloud, so nothing has to stay on at home. The stream plays the uploaded quality up to 4K 60fps at one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card; monthly service is $9.99 per month. StreamNeo streams to YouTube only. See StreamNeo or its pricing page, then start the free day.
Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




