Top navigation bar with brand logo, desktop links with optional highlighted pill style, and a mobile hamburger button that emits a toggleMobile event. Uses design tokens for typography and color.
Prop | Type | Default / Req. | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
logo | String | Your logo | The text or branding rendered as the home link/logo. Can be replaced via the 'logo' slot. | ||||||||||||||||
links | Array | required | A list of navigation links to display in the desktop menu. Each link must have 'path' and 'name' as strings. Optionally, 'highlight' can be set to true to style the link as a primary button. | ||||||||||||||||
|
logo
— Custom markup to replace the default logo/home link content.Event | Description |
---|---|
toggleMobile | Emitted when the mobile menu toggle button is clicked. |
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 emit = defineEmits(["toggleMobile"]);
const props = defineProps({
logo: {
type: String,
default: "Your logo",
},
links: {
type: Array,
required: true,
validator: (v) => {
return v.every((link) => {
return typeof link.path === "string" && typeof link.name === "string";
});
},
},
});
</script>
<template>
<nav
class="flex items-center justify-between w-full font-iq-paragraph leading-iq-paragraph tracking-iq-paragraph text-iq-paragraph-color"
>
<!-- Logo / Home Link -->
<NuxtLink
to="/"
class="text-3xl md:text-4xl font-black drop-shadow-lg font-iq-header leading-iq-header tracking-iq-header text-iq-header-color"
>
<slot name="logo">{{ logo }}</slot>
</NuxtLink>
<!-- Nav Links (desktop) -->
<div class="hidden md:flex items-center gap-6 ">
<template v-for="(link, index) in links" :key="index">
<NuxtLink
:to="link.path"
:class="{
'text-center text-iq-paragraph-color/80 hover:text-iq-paragraph-color px-6 py-3 rounded-full bg-white/10 backdrop-blur-lg ring-1 ring-white/20 hover:bg-white/20 hover:ring-white/40 transition text-sm font-semibold uppercase': link.highlight,
'text-sm font-semibold uppercase text-iq-paragraph-color/80 hover:text-iq-paragraph-color transition': !link.highlight
}"
>
{{ link.name }}
</NuxtLink>
</template>
</div>
<!-- Hamburger (mobile) -->
<button
@click="emit('toggleMobile')"
class="p-2 rounded-lg bg-white/10 hover:bg-white/20 transition md:hidden"
aria-label="Open menu"
>
<!-- Hamburger Icon -->
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 text-white/80"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"
/>
</svg>
</button>
</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 links = [
{ name: "Home", path: "/" },
{ name: "Learn More", path: "/learn-more" },
{ name: "Get Started", path: "/get-started" },
{ name: "Components", path: "/components", highlight: true },
];
function toggleMobile() {
alert('Mobile menu toggled');
}
</script>
<template>
<NavSlimDesktop
class="max-w-7xl mx-auto px-6 py-8"
:links="links"
@toggleMobile="toggleMobile"
logo="Flex Ui Lib"
/>
</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.