Skip to content
Skillpedia
Websites & UI (frontend)7.6k · #13168

native-navigation

What it does

This skill sets out when to use a real link for navigation in an Agent-Native app, rather than a button that moves the page with code. It keeps Cmd-click, middle-click and keyboard use working. It is for developers building navigation in the interface.

When to use it

  • ✓When you are adding a button or card that should open another page in the app.
  • ✓When a navigation control does not respond to Cmd-click or middle-click.
  • ✓When you need to decide between an internal link and an external one.

Skill link

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/native-navigation/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/native-navigation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you change the project cards so they open the project page and still work with Cmd-click?”

5 new skills a week. 1 minute to read.

How it works

The developer uses a router link for pages inside the app, a plain link for external or new-tab pages, and wraps a button in a link where needed.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Native Navigation

Rule

Pure navigation must render a real React Router <Link> for same-SPA routes, a native <a href> for external/public or explicit new-tab destinations, or a shadcn Button asChild wrapper around one. Do not use a button whose only job is to call navigate(), window.open(), or window.location.

Why

Browser modifier-click, middle-click, keyboard activation, accessibility, and normal client-side routing come from real links. Imperative JavaScript navigation hides the destination and blocks those browser semantics.

How

import { Link } from "react-router";

<Link to={`/items/${item.id}`}>...</Link>

<Button asChild>
  <Link to="/settings">Settings</Link>
</Button>

<a href={previewUrl} target="_blank" rel="noopener noreferrer">
  Preview
</a>
  • Use Link for same-SPA internal routes.
  • Use <a> when the URL is external, crosses an app/public boundary, is an auth or sign-in destination, or intentionally opens in a new tab.
  • Preserve query strings and hashes in to or href.
  • For cards with nested actions, link only the non-interactive card region or use a transparent Link overlay; never nest links or buttons.
  • If selection mode changes click behavior, prevent default only for an unmodified primary click and preserve modified clicks.

Keep imperative navigation for post-mutation redirects, OAuth and popup flows, downloads, media/blob URLs, playback, keyboard shortcuts, and stateful tabs.

Review

Search for onClick={() => navigate, window.open, window.location, onAuxClick, and buttons whose only purpose is routing. For each candidate, confirm whether it is pure navigation or a stateful workflow before changing it.

Verify the rendered DOM exposes an href, then test normal click, Cmd/Ctrl-click, middle-click, keyboard Enter, and nested controls where applicable. Run oxfmt and focused app tests or typechecks for the touched package.

Related Skills

  • client-side-routing
  • frontend-design
  • shadcn-ui
FAQ

Why not use a button to navigate?

Buttons hide the destination and block browser behaviors like Cmd-click and middle-click.

When is code navigation still right?

The skill says to keep it for redirects after an update, and for sign-in and popup flows.

What about cards with buttons inside?

The skill says to link only the non-interactive part of the card, and never nest links or buttons.

Details

Original description by the author

Use when adding or reviewing UI navigation so internal routes preserve normal SPA behavior plus Cmd/Ctrl-click and middle-click new-tab semantics.

repo: BuilderIO/agent-native

Popularity

GitHub stars
7.6k
Ranking position
#13168
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills