Skip to content

CDN

v0.3.11 · Latest stable

Use fixed versions in production. Avoid @latest for production pages.

jsDelivr(推荐)

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/sodialog.css">

<script type="module">
  import { openModal } from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/sodialog.es.js'

  openModal({
    title: 'Hello',
    content: '<p>Loaded from jsDelivr.</p>',
  })
</script>

UNPKG(备用)

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/sodialog.css">

<script type="module">
  import { pushMessage } from 'https://unpkg.com/[email protected]/dist/sodialog.es.js'

  pushMessage('success', 'Loaded from UNPKG.')
</script>

UMD / IIFE

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/sodialog.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sodialog.umd.js"></script>

Docs Example Versions

Runnable HTML examples under /components/ resolve the CDN version through a shared loader. The default is maintained in /components/sodialog-loader.js, and you can temporarily override it with URL parameters:

  • ?sodialogVersion=latest
  • ?sodialogVersion=0.3.10

Use this for verification or CDN troubleshooting. Production pages should still copy a fixed-version URL from the snippets above.

Notes

  • jsDelivr is the recommended CDN.
  • UNPKG is a useful fallback.
  • Self-host the files when your CSP blocks external scripts.

Released under the MIT License.