Skip to content
SoDialog 0.3.11 · 零运行时必需依赖

Modern Dialogs
for Every Web Project

一套轻量、框架无关、面向现代 Web 应用的 Dialog 解决方案。

npm install sodialogv0.3.11
release-dialog.ts Ready
import { confirmModal } from 'sodialog'

const approved = await confirmModal({
  title: 'Deploy to production?',
  content: 'All checks have passed.',
  confirmText: 'Deploy now',
})
WHY SODIALOG

Everything a dialog library should be.
Nothing it shouldn't.

一套专注、可预测的交互基础设施。保持宿主项目的技术选择权,不把依赖树变成意外。

00

零强依赖

无需框架运行时、jQuery、Popper 或 Bootstrap。

TS

TypeScript First

从选项到返回句柄,公共 API 均有完整类型。

Promise API

用 async/await 编排 confirm、prompt 与表单流程。

Framework Agnostic

同一套核心能力服务原生项目和主流框架。

A11Y

Accessibility Friendly

原生 dialog 语义、键盘路径与焦点恢复。

M

Mobile Friendly

响应式尺寸、触控友好,并覆盖窄屏交互。

~

Lightweight

聚焦 Dialog 领域,不携带大型 UI Framework。

EXPRESSIVE BY DEFAULT

Simple API. Serious capability.

从简单提醒到完整业务流程,保持代码清晰、类型安全并且容易维护。

example.ts
import { openModal } from 'sodialog'

openModal({
  title: 'Deployment ready',
  content: 'Your changes are live.',
  footerButtons: [
    { label: 'Got it', role: 'confirm', action: 'destroy' },
  ],
})
TypeScriptUTF-8
BUILT FOR THE LONG RUN

Choose less complexity.

SoDialog 聚焦现代 Dialog 体验,同时保留框架独立、轻量和可维护的核心优势。

SolutionPromise APIFramework agnosticRequired UI runtimeMaintenance
Native AlertNoneBrowser-limited
Bootstrap ModalBootstrap JSFramework coupled
SweetAlert2Package runtimeGeneral-purpose
SoDialog RecommendedNoneFocused & typed
WORKS WHERE YOU WORK

One library. Every modern stack.

Bootstrap 是兼容对象,而不是依赖。SoDialog 的核心始终属于 Web Platform。

JSVanilla JS
TSTypeScript
BBootstrap
TWTailwind
React
VVue
NNext.js
NuNuxt
DOCUMENTATION

Build something thoughtful.

从首次安装到高级主题和完整 API,每个入口都为快速找到答案而设计。

READY WHEN YOU ARE

Your next dialog starts here.

零强依赖。完整 TypeScript 类型。几分钟即可接入。

Built for the open web. Bootstrap compatible, never Bootstrap dependent.

Released under the MIT License.