惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
博客园 - Franky
IT之家
IT之家
V
Visual Studio Blog
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
博客园 - 叶小钗
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
罗磊的独立博客
小众软件
小众软件
Jina AI
Jina AI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Stop Rewriting UI Components for Every Project
Nathan C. · 2026-06-15 · via DEV Community

Nathan C.

Ever started a new project and found yourself rebuilding the same modal, dropdown, toast notification, tabs, and switches for the 20th time?

I got tired of that.

So I built UltraHTML, a lightweight UI library that gives you modern components with simple HTML and JavaScript, no framework required.


Getting Started

Include the CSS and JS files:

<link rel="stylesheet" href="dist/ultra.css">
<script src="dist/ultra.js"></script>

Initialize UltraHTML:

Ultra.init();

Done.


Buttons

UltraHTML includes two button styles out of the box:

  • ultra-button — a clean, modern button.
  • ultra-button-wave — adds a wave/ripple-style interaction effect.

Basic button:

<button class="ultra-button">
  Simple Button
</button>

Wave button:

<button class="ultra-button ultra-button-wave">
  Wave Button
</button>

Buttons use UltraHTML's default green theme, but because they're standard HTML elements, you can easily customize them with CSS.

For example, here's a red button that displays a popup message:

<button
  onclick="Ultra.popupmsg('Hello from UltraHTML!')"
  class="ultra-button ultra-button-wave"
  style="background-color: red">
  Show Popup
</button>

You can create buttons that match your site's branding without learning a separate theming system:

<button class="ultra-button" style="background-color: #3b82f6;">
  Blue Button
</button>

<button class="ultra-button ultra-button-wave" style="background-color: #f59e0b;">
  Orange Button
</button>

<button class="ultra-button ultra-button-wave" style="background-color: #ef4444;">
  Red Button
</button>

UltraHTML handles the styling and interactions while still giving you full control over how your buttons look.


Modal Example

Need to display important information?

<script>
window.addEventListener("load", () => {
    Ultra.init();

    Ultra.modal({
        head: "Important",
        text: "You need to reset your password",
        buttonText: "Reset",
        buttonAction: (modal) => {
            console.log("Going to reset page...");
            modal.remove();
        }
    });
});
</script>

If buttonAction is omitted, the modal automatically closes when the button is clicked.

For simple informational dialogs, you only need:

<script>
Ultra.modal({
    head: "Welcome",
    text: "Thanks for visiting!",
    buttonText: "OK"
});
</script>

Add a buttonAction callback only when you need custom behavior, such as navigating to another page, submitting data, or running additional code before closing the modal.

Features:

  • Custom title
  • Custom text
  • Custom button labels
  • Automatic close behavior
  • Optional callback support
  • Clean styling out of the box

Popup Notifications

<button onclick="Ultra.popupmsg('Hello from UltraHTML!')">
  Show Popup
</button>

Instant toast-style messages with one line of code.


Dropdowns

<div class="ultra-dropdown">
  <button class="ultra-dropdown-btn">
    Choose Option
  </button>

  <div class="ultra-dropdown-content">
    <a href="#">Action One</a>
    <a href="#">Action Two</a>
    <a href="#">Action Three</a>
  </div>
</div>


Tabs

<div class="ultra-tab-container">
  <div class="ultra-tab tab-active">Active Tab</div>
  <div class="ultra-tab">Inactive Tab</div>
  <div class="ultra-tab tab-disabled">Disabled Tab</div>
</div>


Chips

<div class="ultra-chip">
  Clickable Chip
</div>

<div class="ultra-chip chip-permanent">
  Permanent Chip
</div>

Image chips:

<div class="ultra-chip">
  <img src="https://picsum.photos/43/43">
  Image Chip
</div>


Switches

<label class="ultra-switch">
  <input type="checkbox" class="ultra-switch-input">
  <span class="ultra-switch-slider"></span>
</label>


Custom Right-Click Menus

<div class="ultra-context-menu">
  <div class="item">📝 Edit</div>
  <div class="item">❌ Delete</div>
  <div class="item">🔗 Copy Link</div>
</div>

Initialize once:

Ultra.init();

and UltraHTML handles the rest.


Why I Built UltraHTML

Many UI libraries are powerful, but they're also huge, framework-dependent, or overkill for smaller projects.

UltraHTML focuses on:

  • Simplicity
  • Speed
  • Lightweight code
  • Modern styling
  • Framework independence

Sometimes you just want a modal without installing 50 packages.


What's Next?

I'm actively developing UltraHTML and adding new components.

GitHub: https://github.com/Natuworkguy/UltraHTML

I'd love feedback, feature requests, and contributions.

What component would you want to see added next?