primitives

Label

Label — базовый примитив RevueUI (Reka UI + shadcn-совместимый API).

Загрузка превью…

src/ui/label/Label.vue

<!-- Radix `Label` → Reka UI `Label`, тот же примитив. -->
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { computed } from "vue"
import { Label as LabelPrimitive, type LabelProps } from "reka-ui"
import { cn } from "@/lib/utils"

const props = defineProps<
  LabelProps & {
    /** Доп. классы. Имя `class` — соглашение shadcn-vue (не `className`). */
    class?: HTMLAttributes["class"]
  }
>()

const delegatedProps = computed(() => {
  const { class: _class, ...delegated } = props
  return delegated
})
</script>

<template>
  <LabelPrimitive
    data-slot="label"
    v-bind="delegatedProps"
    :class="
      cn(
        'cn-label flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed',
        props.class
      )
    "
  >
    <slot />
  </LabelPrimitive>
</template>

src/ui/label/index.ts

export { default as Label } from "./Label.vue"

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/label.json

Зависимости реестра

npm-зависимости

  • reka-ui

Источник: порт из ReUI (Keenthemes, MIT)