Skip to main contentWhere does your team stand on AI adoption?
CONTACT SALESSTART BUILDING

Builder Blueprints

Landing pages
Blog Article
Hero Section
Navigation Links
Announcement Bar
Product Details
Product Editorial
Homepage
Request a blueprintGo to developer docs

Integrate Navigation Links

Navigation links are often best as minimal, structured data that your team mates can edit with a form interface.

Model definition

A structured data model named navigation-links is all you need, with a couple fields:

nametypenotes

links

list

with subfields:

  • url: type url
  • text: type text

Example Code

// pages/your-page.jsx import { builder } from '@builder.io/react'; // Replace with your Public API Key. builder.init(YOUR_API_KEY); export async function getStaticProps() { const links = await builder.get('navigation-links', { // You can use options for queries, sorting, and targeting here // https://github.com/BuilderIO/builder/blob/main/packages/core/docs/interfaces/GetContentOptions.md }).promise(); return { props: { links: links || null, }, revalidate: 5, }; } export default function Home({ links }) { return ( <> <header> <nav> {links.data.links.map((link, index) => ( <a key={index} href={link.data.url}> {link.data.label} </a> ))} </nav> </header> {/* Put the rest of your page here. */} <RestOfYourPage /> </> ); }