@glimstone/vue

中文文档
4.5.4发布于 2026/11/16AGPL-3.0-onlyTypeScriptES Module近 30 天下载 4736

GlimStone's components for Vue

原始使用文档

@glimstone/vue

The components of GlimStone for Vue 3, on @glimstone/core. They are the same components as @glimstone/react, with the same names, the same behaviour contracts and the same look, as single-file components.

npm install @glimstone/core @glimstone/vue
import "@glimstone/core/tokens.css";
import { applyCachedAppearance, applyStoredLabelModes } from "@glimstone/core";
import { setGlyphResolver } from "@glimstone/vue";

applyCachedAppearance();
applyStoredLabelModes();
setGlyphResolver((key) => appGlyphs[key]);
<script setup lang="ts">
import { ref } from "vue";
import { Button, Toggle, useConfirm } from "@glimstone/vue";
import { Select } from "@glimstone/vue/Select";

const quiet = ref(true);
const zone = ref<string | null>("Europe/Vienna");
const { confirm, ConfirmHost } = useConfirm({ title: "Confirm", cancel: "Cancel", confirm: "Confirm" });
</script>

<template>
  <Toggle v-model="quiet" label="Quiet notifications" />
  <Select v-model="zone" label="Time zone" :options="zones" />
  <Button label="Delete" label-key="delete" @click="confirm('Delete the snapshot?')" />
  <ConfirmHost />
</template>
  • Values bind with v-model; listeners and attributes such as @click, class and aria-* fall through to the element.
  • A glyph is a component: setGlyphResolver returns one, and a glyph prop takes one.
  • The engines are composables: useLabelMode, useRainbow, useShape, useMotion, useAccent and useHue, each a writable ref that follows the document.
  • A component that waits for the app's answer, such as SignInCard or Fortress, takes async callbacks as props (:on-sign-in, or @sign-in, which Vue binds to the same prop), since an emitted event cannot answer.
  • Select, Combobox and Slider come from their own entries and need @zag-js/vue with their machine packages (@zag-js/select and @zag-js/menu, @zag-js/combobox, @zag-js/slider).
  • Vue counts useId() per app. A page that mounts several Vue apps gives each its own app.config.idPrefix.

版本与发布记录

@glimstone/vue 共发布 22 个版本,首次发布于 2026/11/04;过去 12 个月发布了 22 个版本。

版本发布日期距今
4.5.4latest2026/11/16今天
4.5.32026/11/16今天
4.5.22026/11/161 天前
4.5.12026/11/151 天前
4.5.02026/11/151 天前
4.4.12026/11/142 天前

关于 @glimstone/vue 的常见问题

@glimstone/vue 是什么?

GlimStone's components for Vue

如何安装 @glimstone/vue?

在项目目录运行 npm install @glimstone/vue,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.0)、@zag-js/vue(^1.48.0)、@zag-js/menu(^1.48.0)、@zag-js/tour(^1.48.0)、@zag-js/steps(^1.48.0)、@zag-js/timer(^1.48.0)、@zag-js/avatar(^1.48.0)、@zag-js/select(^1.48.0)、@zag-js/slider(^1.48.0)、@zag-js/marquee(^1.48.0)、@zag-js/carousel(^1.48.0)、@zag-js/combobox(^1.48.0)、@zag-js/splitter(^1.48.0)、@zag-js/accordion(^1.48.0)、@zag-js/pin-input(^1.48.0)、@zag-js/hover-card(^1.48.0)、@zag-js/pagination(^1.48.0)、@zag-js/tags-input(^1.48.0)、@zag-js/collapsible(^1.48.0)、@zag-js/date-picker(^1.48.0)、@zag-js/file-upload(^1.48.0)、@zag-js/scroll-area(^1.48.0)、@zag-js/angle-slider(^1.48.0)、@zag-js/rating-group(^1.48.0)、@zag-js/signature-pad(^1.48.0)、@zag-js/floating-panel(^1.48.0)、@internationalized/date(^3.12.4)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@glimstone/vue 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@glimstone/vue 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@glimstone/vue 可以商用吗?

@glimstone/vue 使用 AGPL-3.0-only 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@glimstone/vue 的下载量有多少?

根据 npm 官方下载统计,@glimstone/vue 在 2026/10/17 – 2026/11/15 这 30 天内被下载 4,736 次,日均约 158 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@glimstone/vue 还在维护吗?

最新版本 4.5.4 发布于 2026/11/16(今天);至今共发布 22 个版本,其中过去 12 个月发布了 22 个;首次发布于 2026/11/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。