Top navigation bar with brand title, desktop link row on a secondary background, and a mobile hamburger that emits toggleMobileMenu. Uses design tokens for colors and typography; icons via @nuxt/icon.
Prop | Type | Default / Req. | Description |
---|---|---|---|
title | String | — | Main site title or logo text; defaults to the `logo` slot if provided. |
subtitle | String | — | Optional subtitle text (not rendered by default; for custom slots or extensions). |
links | Array | required | Array of navigation items. Each object must include `name` (String) and `path` (String). |
adress | String | — | Physical address (for custom footer/contact slots). |
phone | String | — | Contact phone number (for custom footer/contact slots). |
String | — | Contact email address (for custom footer/contact slots). |
logo
— Custom markup for the logo/title area; overrides default NuxtLink.hamburger
— Custom markup for the mobile menu button; defaults to an Icon component.desktopLinks
— Custom container or override for the desktop navigation links.Event | Description |
---|---|
0 |
@nuxt/icon
You may use these UI components in your own personal or commercial projects. You may not resell, redistribute, sublicense, or package them as standalone assets or template/library packs.
Full terms: End-User License Agreement
Below you can expand the main implementation file and any supporting components. Use the “Copy” button to grab a snippet straight to your clipboard.
These are the raw components that are required to run this example. Copy-paste them into your project. Most likely you will not change anything in these files, but you can if you want to. These are the components that are used in the main implementation file.
<script setup>
const props = defineProps({
title: String,
subtitle: String,
links: {
type: Array,
validate: (value) => {
return value.every((link) => link.name && link.path);
},
},
adress: String,
phone: String,
email: String,
});
const emit = defineEmits(["toggleMobileMenu"]);
</script>
<template>
<nav
class="bg-iq-primary sticky top-0 z-50 font-iq-paragraph leading-iq-paragraph tracking-iq-paragraph text-iq-paragraph-color"
aria-label="Główna nawigacja strony"
>
<div class="flex justify-between items-center p-4 md:p-0 shadow md:shadow-none">
<slot name="logo">
<NuxtLink
to="/"
class="text-3xl font-extrabold text-iq-secondary-color md:min-w-96 uppercase md:text-center h-full"
>{{ title }}</NuxtLink
>
</slot>
<!-- Hamburger -->
<div class="flex md:hidden">
<button
@click="emit('toggleMobileMenu')"
aria-label="Toggle navigation menu"
aria-controls="mobile-menu"
aria-haspopup="true"
class="text-2xl"
>
<slot name="hamburger">
<Icon name="material-symbols:menu" />
</slot>
</button>
</div>
<!-- Desktop -->
<div
class="hidden md:flex bg-iq-secondary flex-1 justify-around text-2xl transition h-full"
>
<slot name="desktopLinks">
<NuxtLink
v-for="link in links"
:key="link.path"
activeClass="text-center !text-black !bg-white w-full p-4 "
:to="link.path"
class="text-center text-iq-paragraph-secondary-color w-full hover:text-black p-4 hover:bg-white duration-700 transition h-full"
>
{{ link.name }}
</NuxtLink>
</slot>
</div>
</div>
</nav>
</template>
This is the main Vue file that uses the component. Copy-paste this into your project. In this code feel free to change anything you like, such as the component name, props, or class. This is the place where you control the main component.
<script setup>
const websiteName = "Website Name";
const links = [
{ name: "Get started", path: "/get-started" },
{ name: "Learn more", path: "/learn-more" },
{ name: "Components", path: "/components" },
{ name: "Some page", path: "/" },
{ name: "Contact", path: "/" },
];
function toggleMenu() {
// Logic to toggle the mobile menu
alert("Mobile menu toggled");
}
</script>
<template>
<NavSpringDesktop :links="links" :title="websiteName" @toggleMobileMenu="toggleMenu"/>
</template>
Decide whether you want a global design-system or a one-off inline snippet.
Complete @theme
block – import once and share across every component.
Copy the code below into main.css
file. It is most likely in assets/css/main.css
directory.
:style
binding – paste straight onto any of ours components.
Copy the code below and paste it into the :style
binding of the component.
I wish I could automate every little thing—but for now you’ll need to handle these final steps by hand. Apologies for the extra work!
iq-card-*
style Now that you’ve picked a card preset, copy its CSS into your @layer components
block in main.css
. This ensures every `iq-card
` wrapper will look just right.
iq-cta
iq-cta is the main call to action button class. It’s used in many places across the components. But for now it is only a single class that you can customize. You can copy the code below and paste it into your @layer components
block in main.css
. In future you will be able to fully customize it from our UI and choose from many presets.
I didn't have time to figure out consistency. Although there are no actions required, be mindful that the forms might not be entirely consistent with the design system. A quick once-over will keep everything looking sharp.