Navigation Menu
Atom
Navigation Menu leva a pessoa para outro destino. Ele não executa ação destrutiva.
Exemplos copiáveis
React
React
import * as React from "react"
type NavItem = { label: string; href: string; current?: boolean }
export function PulsoNavigationMenu({ items }: { items: NavItem[] }) {
return (
<nav aria-label="Navegação principal">
<ul className="flex flex-wrap gap-2">
{items.map((item) => (
<li key={item.href}>
<a aria-current={item.current ? "page" : undefined} href={item.href} className={[
"inline-flex rounded-[var(--radius-sm)] px-3 py-2 text-sm font-medium",
item.current ? "bg-[var(--primary-soft)] text-[var(--primary)]" : "text-[var(--fg-muted)] hover:bg-[var(--muted)] hover:text-[var(--fg)]",
].join(" ")}>{item.label}</a>
</li>
))}
</ul>
</nav>
)
}<PulsoNavigationMenu items={[{ label: "Foundations", href: "/foundations", current: true }, { label: "Components", href: "/components" }]} />Regras
- Navigation Menu navega; não confirma ação.
- Use
aria-currentpara página ativa. - Labels precisam ser curtos e previsíveis.
- Não esconda destinos essenciais atrás de hover apenas.
Last updated on