Provides unstyled, accessible UI components for Vue that integrate with Tailwind CSS.
Downloads / mo 12.6M
Stars 28.8K
Last release 1.7.23
License MIT $ npm install @headlessui/vue Copy
<template>
<div class="flex h-full w-screen items-start justify-center bg-gray-50 p-12">
<SwitchGroup as="div" class="flex items-center space-x-4">
<SwitchLabel>Enable notifications</SwitchLabel>
<Switch
as="button"
v-model="state"
:class="resolveSwitchClass({ checked: state })"
v-slot="{ checked }"
>
<span
class="inline-block h-5 w-5 transform rounded-full bg-white transition duration-200 ease-in-out"
:class="{ 'translate-x-5': checked, 'translate-x-0': !checked }"
/>
</Switch>
</SwitchGroup>
</div>
</template>
<script>
import { ref } from 'vue'
import { SwitchGroup, Switch, SwitchLabel } from '@headlessui/vue'
function classNames(...classes) {
return classes.filter(Boolean).join(' ')
}
export default {
components: { SwitchGroup, Switch, SwitchLabel },
setup() {
let state = ref(false)
return {
state,
resolveSwitchClass({ checked }) {
return classNames(
'focus:shadow-outline relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-hidden',
checked ? 'bg-indigo-600 hover:bg-indigo-800' : 'bg-gray-200 hover:bg-gray-400'
)
},
}
},
}
</script>
Ports Radix UI Primitives to Vue.
Downloads / mo 11.6M
Stars 7.0K
Last release 2.11.0
License MIT $ npm add reka-ui Copy
<script setup>
import { SwitchRoot, SwitchThumb } from 'reka-ui'
</script>
<template>
<SwitchRoot>
<SwitchThumb />
</SwitchRoot>
</template>
Builds Vue applications with themed components and data-table controls.
Downloads / mo 5.3M
Stars 41.0K
Last release 4.3.4
License MIT Strengths Tracks the system color preference . Use the system theme to follow operating-system light and dark settings. Includes data-table variants . Choose standard, server-backed, or virtualized table components. Limitations Validation shows the first error . Order rules so the most useful failure message appears first. $ pnpm add vuetify Copy
import { createApp } from 'vue'
// Vuetify
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
// Components
import App from './App.vue'
const vuetify = createVuetify({
components,
directives,
})
createApp(App).use(vuetify).mount('#app')
Provides a Vue UI library with a large component set, a theme designer, and theme alternatives such as Material, Bootstrap, and Tailwind.
Downloads / mo 4.1M
Last release 5.0.5
License PrimeUI License $ npm install primevue @primeuix/themes Copy
<template>
<Button>Verify</Button>
</template>
<script setup>
import Button from 'primevue/button';
</script>
PrimeVue examples From open-source projects on GitHub confirm1() {
this.$confirm.require({
message: 'Are you sure you want to proceed?',
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
rejectProps: {
label: 'Cancel',
severity: 'secondary',
outlined: true
},
acceptProps: {
label: 'Save'
},
accept: () => {
this.$toast.add({ severity: 'info', summary: 'Confirmed', detail: 'You have accepted', life: 3000 });
},
reject: () => {
this.$toast.add({ severity: 'error', summary: 'Rejected', detail: 'You have rejected', life: 3000 });
}
});
}
Show full example Provides a UI library for web apps built with Vue and Tailwind CSS.
Downloads / mo 3.9M
Stars 7.1K
Last release 4.12.2
License MIT $ npm install @nuxt/ui tailwindcss Copy
<template>
<UButton>
Button
</UButton>
</template>
Nuxt UI examples From open-source projects on GitHub export const useClipboard = () => {
const { copy: _copy, copied } = _useClipboard()
const toast = useToast()
const copy = async (source: string, optionsOptions?: toastOptions) => {
await _copy(source)
if (!copied.value) throw new Error('Could not copy to clipboard')
if (optionsOptions) {
toast.add(optionsOptions)
}
}
return {
copy,
copied
}
}
Show full example Provides Vue components with configurable styles and form controls.
Downloads / mo 3.1M
Stars 27.9K
Last release 2.14.8
License MIT Strengths Customizes styles through CSS variables . Change component variables without recompiling the SCSS theme. Includes sortable and filterable tables . Build table interfaces with sorting and filtering controls. Limitations Form fields need model paths . Set prop on form items for validation and field resets. $ npm install element-plus Copy
<template>
<el-button>I am ElButton</el-button>
</template>
<script setup lang="ts">
import { ElButton } from 'element-plus'
</script>
Element Plus examples From open-source projects on GitHub const message = (
message: string | VNode | (() => VNode),
params?: MessageParams
): MessageHandler => {
if (!params) {
return ElMessage({
message,
customClass: "pure-message"
});
} else {
const {
icon,
type = "info",
plain = false,
dangerouslyUseHTMLString = false,
customClass = "antd",
duration = 2000,
showClose = false,
offset = 16,
placement = "top",
appendTo = document.body,
grouping = false,
repeatNum = 1,
onClose
} = params;
return ElMessage({
message,
icon,
type,
plain,
dangerouslyUseHTMLString,
duration,
showClose,
offset,
placement,
appendTo,
grouping,
repeatNum,
// 全局搜 pure-message 即可知道该类的样式位置
customClass: customClass === "antd" ? "pure-message" : "",
onClose: () => (isFunction(onClose) ? onClose() : null)
});
}
};
Show full example Provides accessible cross-platform Vue.js components for SPA, PWA, SSR, SSG, mobile, and desktop apps.
Downloads / mo 2.0M
Stars 27.2K
Last release 2.35.5
License MIT $ pnpm add quasar@latest @quasar/extras@latest Copy
<template>
<div class="q-gutter-sm">
<q-btn label="Open dialog" color="primary" @click="show" />
</div>
</template>
<script setup>
import { useQuasar } from 'quasar'
const $q = useQuasar()
function show() {
$q.dialog({
title: 'Confirm',
message:
'Dismiss this dialog through the Cancel button, the backdrop or the ESC key.',
cancel: true
})
.onOk(() => {
console.log('OK')
})
.onCancel(reason => {
// reason is 'cancel', 'backdrop', 'escape' or 'programmatic'
console.log(`Dismissed through: ${reason}`)
})
}
</script>
Provides Vue components following the Ant Design system.
Downloads / mo 909.8K
Stars 21.7K
Last release 4.2.6
License MIT Strengths Customizes components through design tokens . Set shared or component-level tokens through ConfigProvider. Includes rule-based form validation . Assign validation rules and matching form-item names. Limitations Static messages lose provider context . Static message, modal, and notification methods do not inherit ConfigProvider context. $ npm i --save ant-design-vue@4.x Copy
<template>
<a-button>Add</a-button>
</template>
<script>
import { Button } from 'ant-design-vue';
const ButtonGroup = Button.Group;
export default {
components: {
AButton: Button,
AButtonGroup: ButtonGroup,
},
};
</script>
Ant Design Vue examples From open-source projects on GitHub function createConfirm(options: ModalOptionsEx) {
const iconType = options.iconType || 'warning';
Reflect.deleteProperty(options, 'iconType');
const opt: ModalFuncProps = {
centered: true,
icon: getIcon(iconType),
...options,
content: renderContent(options),
};
return Modal.confirm(opt);
}
Show full example