Get started with naive-ui CDN

MIT licensed

Naive-UI is a minimalist Vue.js UI component library.

Tags:
  • naive-ui
  • component library
  • ui framework
  • ui
  • vue

Stable version

Copied!

How to start using naive-ui CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with naive-ui CDN - cdnhub.io</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/naive-ui@2.38.1/dist/naive.min.css">
  <style>
    .naive-button--text {
      margin: 0 5px;
    }
  </style>
</head>
<body>
  <div id="app">
    <naive-ui>
      <template>
        <div>
          <naive-button @click="count++">Count is: {{ count }}</naive-button>
          <naive-button @click="count--">Decrement</naive-button>
          <naive-button type="text" @click="toggle">Toggle</naive-button>
          <naive-switch v-model="isSwitched" />
        </div>
      </template>
    </naive-ui>
  </div>
  <script src="https://cdn.cdnhub.io/naive-ui/2.38.1/index.prod.js"></script>
  <script>
    const { createApp } = Vue;

    createApp({
      data() {
        return {
          count: 0,
          isSwitched: false,
        };
      },
      methods: {
        toggle() {
          this.isSwitched = !this.isSwitched;
        },
      },
    }).mount('#app');
  </script>
</body>
</html>
Copied!
Copied!

All versions