Navigation

Brand Navmenu

A whole site header: wordmark on the left, sections in the middle, sign-in and the primary action on the right, shedding parts when narrow.

  • navmenu
  • header
  • brand
  • cta

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/navmenu-007?lang=en

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "navmenu-007" (Brand Navmenu) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/navmenu-007.json

Registry item: https://vibeui.ru/r/navmenu-007.json
Installs to: components/vibeui/navmenu-007.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A whole site header: wordmark on the left, sections in the middle, sign-in and the primary action on the right, shedding parts when narrow.

A site header: a wordmark with a logo mark, sections with drop-down lists, a secondary link and the primary button on the right. When narrow, only the wordmark and the button remain — a container query removes the rest. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Navmenu007 } from "@/components/vibeui/navmenu-007"

<Navmenu007
  brand="Canvas"
  actionLabel="Start"
  entries={[{ label: "Product", items: ["Editor", "Templates"] }]}
/>

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-navmenu-007-* palette — do not swap it for your theme tokens (bg-primary, text-primary-foreground and the like)
- the single primary button on the right: two equally loud actions in a header cancel each other out
- flex:1 on the middle section instead of spacers — the right group stays at the edge whatever the section count
- the wordmark as a link to the home page: it is the first place people return to from anywhere
- the container query that removes the links in a narrow header: otherwise the button is pushed off the edge
- the shared name attribute on <details>: it is how sections close one another

## 6. You may change
- the entries array: sections and their children
- brand and actionLabel — the wordmark and the primary button caption
- the accent through the accent prop — it colours the logo mark and the primary button
- the header height and the corner radius

## 7. Rules
- In the narrow view the sections simply disappear: a mobile navigation variant has to sit alongside.
- The logo mark is a gradient square: swap in your own, keeping the 1.375rem size.
- Escape does not close a <details>: that is the element's behaviour, not a bug.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/navmenu-007.json
https://vibeui.ru/r/navmenu-007.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-navmenu-007-*. Серверный: хуков нет, разделы с подпунктами — <details> с общим атрибутом name. Средняя часть растягивается flex:1, поэтому правая группа остаётся у края при любой ширине. Знак логотипа нарисован градиентом, а не картинкой. На узкой ширине контейнерный запрос убирает ссылки и вторичное действие, оставляя логотип и главную кнопку.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import type { CSSProperties } from "react"

export type Navmenu007Entry = {
  label: string
  items?: string[]
  href?: string
}

export type Navmenu007Props = {
  brand?: string
  entries?: Navmenu007Entry[]
  actionLabel?: string
  secondaryLabel?: string
  accent?: string
  className?: string
  style?: CSSProperties
}

// Идея компонента: полноценная шапка сайта — логотип слева, разделы по центру,
// вход и главное действие справа. Средняя часть растягивается через flex:1, и
// кнопка остаётся у правого края при любой ширине. Логотип — не картинка, а
// текст со знаком: он масштабируется, читается скринридером и ничего не грузит.
const STYLES = `
:where([data-vibeui-block="navmenu-007"]){
--vibeui-navmenu-007-bg:oklch(1 0 0);
--vibeui-navmenu-007-fg:oklch(0.22 0.014 265);
--vibeui-navmenu-007-muted:oklch(0.55 0.014 265);
--vibeui-navmenu-007-border:oklch(0.91 0.006 265);
--vibeui-navmenu-007-hover:oklch(0.55 0.02 265 / 8%);
--vibeui-navmenu-007-accent:oklch(0.55 0.2 262);
--vibeui-navmenu-007-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
container-type:inline-size;
}
[data-vibeui-block="navmenu-007"]{
box-sizing:border-box;width:100%;max-width:46rem;
font-family:var(--vibeui-navmenu-007-font);color:var(--vibeui-navmenu-007-fg);
}
[data-vibeui-block="navmenu-007"] [data-part="shell"]{
box-sizing:border-box;padding:0.5rem 0.625rem;
display:flex;align-items:center;gap:0.75rem;
background:var(--vibeui-navmenu-007-bg);
border:1px solid var(--vibeui-navmenu-007-border);border-radius:0.875rem;
}
[data-vibeui-block="navmenu-007"] [data-part="brand"]{
display:inline-flex;align-items:center;gap:0.5rem;
text-decoration:none;color:inherit;font-size:0.9375rem;font-weight:700;letter-spacing:-0.01em;
border-radius:0.5rem;
}
[data-vibeui-block="navmenu-007"] [data-part="brand"]:focus-visible{outline:2px solid var(--vibeui-navmenu-007-accent);outline-offset:3px}
/* Знак логотипа — два наложенных квадрата, нарисованных градиентом. */
[data-vibeui-block="navmenu-007"] [data-part="mark"]{
width:1.375rem;height:1.375rem;border-radius:0.4375rem;
background:linear-gradient(140deg,var(--vibeui-navmenu-007-accent),oklch(0.68 0.16 320));
box-shadow:inset 0 0 0 1px oklch(1 0 0 / 35%);
}
[data-vibeui-block="navmenu-007"] [data-part="links"]{display:flex;align-items:center;gap:0.125rem;flex:1}
[data-vibeui-block="navmenu-007"] [data-part="slot"]{position:relative}
[data-vibeui-block="navmenu-007"] [data-part="trigger"],
[data-vibeui-block="navmenu-007"] [data-part="plain"]{
list-style:none;cursor:pointer;text-decoration:none;color:inherit;
display:inline-flex;align-items:center;gap:0.375rem;
height:2rem;padding:0 0.625rem;border-radius:0.5rem;font-size:0.875rem;
}
[data-vibeui-block="navmenu-007"] [data-part="trigger"]::-webkit-details-marker{display:none}
[data-vibeui-block="navmenu-007"] [data-part="trigger"]:hover,
[data-vibeui-block="navmenu-007"] [data-part="plain"]:hover{background:var(--vibeui-navmenu-007-hover)}
[data-vibeui-block="navmenu-007"] [data-part="trigger"]:focus-visible,
[data-vibeui-block="navmenu-007"] [data-part="plain"]:focus-visible{outline:2px solid var(--vibeui-navmenu-007-accent);outline-offset:-2px}
[data-vibeui-block="navmenu-007"] [data-part="slot"][open] > [data-part="trigger"]{background:var(--vibeui-navmenu-007-hover)}
[data-vibeui-block="navmenu-007"] [data-part="caret"]{
width:0.375rem;height:0.375rem;margin-top:-0.1875rem;
border:1.5px solid var(--vibeui-navmenu-007-muted);border-left:0;border-top:0;transform:rotate(45deg);
}
[data-vibeui-block="navmenu-007"] [data-part="menu"]{
position:absolute;top:calc(100% + 0.5rem);left:0;z-index:30;
min-width:11rem;margin:0;padding:0.25rem;box-sizing:border-box;list-style:none;
background:var(--vibeui-navmenu-007-bg);
border:1px solid var(--vibeui-navmenu-007-border);border-radius:0.75rem;
box-shadow:0 20px 40px -22px oklch(0.2 0.03 265 / 42%);
}
[data-vibeui-block="navmenu-007"] [data-part="link"]{
display:block;padding:0.4375rem 0.5rem;border-radius:0.5rem;
text-decoration:none;color:inherit;font-size:0.875rem;
}
[data-vibeui-block="navmenu-007"] [data-part="link"]:hover{background:var(--vibeui-navmenu-007-hover)}
[data-vibeui-block="navmenu-007"] [data-part="link"]:focus-visible{outline:2px solid var(--vibeui-navmenu-007-accent);outline-offset:-2px}
[data-vibeui-block="navmenu-007"] [data-part="right"]{display:flex;align-items:center;gap:0.375rem}
[data-vibeui-block="navmenu-007"] [data-part="ghost"]{
text-decoration:none;color:var(--vibeui-navmenu-007-muted);font-size:0.875rem;
padding:0 0.5rem;border-radius:0.5rem;
}
[data-vibeui-block="navmenu-007"] [data-part="ghost"]:hover{color:var(--vibeui-navmenu-007-fg)}
[data-vibeui-block="navmenu-007"] [data-part="ghost"]:focus-visible{outline:2px solid var(--vibeui-navmenu-007-accent);outline-offset:2px}
[data-vibeui-block="navmenu-007"] [data-part="cta"]{
display:inline-flex;align-items:center;height:2rem;padding:0 0.875rem;
border-radius:0.5rem;text-decoration:none;white-space:nowrap;
background:var(--vibeui-navmenu-007-accent);color:oklch(1 0 0);
font-size:0.875rem;font-weight:600;
}
[data-vibeui-block="navmenu-007"] [data-part="cta"]:focus-visible{outline:2px solid var(--vibeui-navmenu-007-accent);outline-offset:2px}
/* В узкой шапке ссылки и вторичное действие уходят: место нужно логотипу и CTA. */
@container (max-width: 34rem){
[data-vibeui-block="navmenu-007"] [data-part="links"]{display:none}
[data-vibeui-block="navmenu-007"] [data-part="ghost"]{display:none}
[data-vibeui-block="navmenu-007"] [data-part="right"]{margin-left:auto}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="navmenu-007"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_ENTRIES: Navmenu007Entry[] = [
  { label: "Продукт", items: ["Редактор", "Шаблоны", "Аналитика"] },
  { label: "Решения", items: ["Студиям", "Магазинам", "Медиа"] },
  { label: "Цены", href: "#" },
  { label: "Блог", href: "#" },
]

/**
 * Шапка сайта: логотип слева, разделы по центру, действие справа.
 * Один файл, ноль зависимостей, собственная палитра, клиентского JS нет.
 */
export function Navmenu007({
  brand = "Полотно",
  entries = DEFAULT_ENTRIES,
  actionLabel = "Начать",
  secondaryLabel = "Войти",
  accent,
  className,
  style,
}: Navmenu007Props) {
  const palette = {
    ...(accent ? { "--vibeui-navmenu-007-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-navmenu-007" precedence="medium">
        {STYLES}
      </style>
      <div
        data-vibeui-block="navmenu-007"
        className={className}
        style={palette}
      >
        <header data-part="shell">
          <a data-part="brand" href="#">
            <span data-part="mark" aria-hidden="true" />
            {brand}
          </a>
          <nav data-part="links" aria-label="Разделы сайта">
            {entries.map((entry) =>
              entry.items ? (
                <details
                  key={entry.label}
                  data-part="slot"
                  name="vibeui-navmenu-007"
                >
                  <summary data-part="trigger">
                    {entry.label}
                    <span data-part="caret" aria-hidden="true" />
                  </summary>
                  <ul data-part="menu" aria-label={entry.label}>
                    {entry.items.map((item) => (
                      <li key={item}>
                        <a data-part="link" href="#">
                          {item}
                        </a>
                      </li>
                    ))}
                  </ul>
                </details>
              ) : (
                <a key={entry.label} data-part="plain" href={entry.href ?? "#"}>
                  {entry.label}
                </a>
              ),
            )}
          </nav>
          <div data-part="right">
            <a data-part="ghost" href="#">
              {secondaryLabel}
            </a>
            <a data-part="cta" href="#">
              {actionLabel}
            </a>
          </div>
        </header>
      </div>
    </>
  )
}