Veil UI
Components

Logo

A brand mark and wordmark lockup in three sizes.

Installation

$ npx veil-ui@latest add logo

Usage

import { Logo } from "@/components/ui/logo";

<Logo name="Veil UI" mark={<Mark />} />;

Examples

Basic

VVeil UI

Linked

Sizes

VVeil
VVeil
VVeil

API reference

PropTypeDefaultDescription
namestring—Wordmark text, also the accessible name when linked.
markReactNode—Optional square brand mark rendered before the name.
size"sm" | "md" | "lg""md"Lockup scale.
hrefstring—Wrap the lockup in a link, typically to the home page.

Accessibility

  • The wordmark is real text, so the logo keeps a readable accessible name.
  • When linked, the anchor contains that text and shows a visible focus ring.
  • Keep decorative marks decorative; the name already identifies the brand.

Vue and plain HTML

This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add logo --framework vue or switch the framework in components.json.

<script setup lang="ts">
import { cn } from "@/lib/utils";

defineOptions({ inheritAttrs: false });

const sizes = {
  sm: { root: "gap-1.5", mark: "size-6", name: "text-sm" },
  md: { root: "gap-2", mark: "size-8", name: "text-base" },
  lg: { root: "gap-2.5", mark: "size-10", name: "text-lg" },
} as const;

const props = withDefaults(
  defineProps<{
    name: string;
    size?: keyof typeof sizes;
    href?: string;
    class?: string;
  }>(),
  { size: "md" },
);
</script>

<template>
  <a
    v-if="props.href"
    :href="props.href"
    class="inline-flex rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
  >
    <div
      data-slot="logo"
      :class="
        cn('inline-flex items-center', sizes[props.size].root, props.class)
      "
      v-bind="$attrs"
    >
      <span
        v-if="$slots.mark"
        data-slot="logo-mark"
        :class="
          cn(
            'flex shrink-0 items-center justify-center overflow-hidden rounded-md',
            sizes[props.size].mark,
          )
        "
      >
        <slot name="mark" />
      </span>
      <span
        data-slot="logo-name"
        :class="cn('font-semibold tracking-tight', sizes[props.size].name)"
      >
        {{ props.name }}
      </span>
    </div>
  </a>
  <div
    v-else
    data-slot="logo"
    :class="cn('inline-flex items-center', sizes[props.size].root, props.class)"
    v-bind="$attrs"
  >
    <span
      v-if="$slots.mark"
      data-slot="logo-mark"
      :class="
        cn(
          'flex shrink-0 items-center justify-center overflow-hidden rounded-md',
          sizes[props.size].mark,
        )
      "
    >
      <slot name="mark" />
    </span>
    <span
      data-slot="logo-name"
      :class="cn('font-semibold tracking-tight', sizes[props.size].name)"
    >
      {{ props.name }}
    </span>
  </div>
</template>

On this page