Buttons

Link Button

A link dressed as a button: the URL can be copied and opened in a new tab — a button with onClick loses all of that.

  • button
  • link
  • external
  • a11y

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/button-016?lang=en

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "button-016" (Link Button) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/button-016.json

Registry item: https://vibeui.ru/r/button-016.json
Installs to: components/vibeui/button-016.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A link dressed as a button: the URL can be copied and opened in a new tab — a button with onClick loses all of that.

A link styled as a button: an external-link glyph, rel="noopener noreferrer" and a screen-reader note about the new tab. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Button016 } from "@/components/vibeui/button-016"

<Button016 label="Open the docs" href="https://example.com" external />

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-button-016-* palette — do not swap it for your theme tokens
- the <a> tag: a button with router.push loses middle-click, URL copying and the status bar
- rel="noopener noreferrer" with target="_blank" — otherwise the new tab can reach yours
- the hidden new-tab note: the glyph is not read aloud
- the border-drawn external glyph
- the visible focus ring

## 6. You may change
- label and href
- external — whether to open a new tab
- tone — neutral or accent
- height and radius to match neighbouring buttons

## 7. Rules
- A new tab is not always a favour: use it for external URLs and keep internal ones in place.
- If the link downloads a file, say so and name the format and size.
- Inside Next.js wrap it in <Link> or swap the tag in your copy.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/button-016.json
https://vibeui.ru/r/button-016.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-button-016-*. Серверный: хуков нет. Это <a>, а не <button>: сохраняются контекстное меню, средний клик и статусная строка. Для внешней ссылки проставляются target="_blank" и rel="noopener noreferrer", рисуется значок и добавляется скрытая строка «откроется в новой вкладке».

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Button016Props = Omit<ComponentPropsWithoutRef<"a">, "children"> & {
  label?: string
  href?: string
  /** Открывать в новой вкладке: тогда об этом говорится вслух и значком. */
  external?: boolean
  tone?: "neutral" | "accent"
}

// Идея компонента: ссылка, которая выглядит кнопкой, но остаётся ссылкой.
// Её можно открыть в новой вкладке, скопировать адрес и увидеть в статусной
// строке — с <button onClick={router.push}> всё это теряется. У внешней
// ссылки есть значок и сказано словами, что она уходит на другой сайт.
const STYLES = `
:where([data-vibeui-block="button-016"]){
--vibeui-button-016-fg:oklch(0.3 0.014 265);
--vibeui-button-016-bg:oklch(1 0 0);
--vibeui-button-016-border:oklch(0.9 0.006 265);
--vibeui-button-016-hover:oklch(0.96 0.004 265);
--vibeui-button-016-accent:oklch(0.55 0.17 265);
--vibeui-button-016-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="button-016"]{
display:inline-flex;align-items:center;gap:0.4375rem;
height:2.25rem;padding:0 0.875rem;box-sizing:border-box;
border:1px solid var(--vibeui-button-016-border);border-radius:0.625rem;
background:var(--vibeui-button-016-bg);color:var(--vibeui-button-016-fg);
font-family:var(--vibeui-button-016-font);font-size:0.8125rem;font-weight:600;line-height:1;
text-decoration:none;
transition:background-color .16s ease;
}
[data-vibeui-block="button-016"][data-tone="accent"]{
border-color:transparent;background:var(--vibeui-button-016-accent);color:oklch(0.99 0.01 265);
}
[data-vibeui-block="button-016"]:hover{background:var(--vibeui-button-016-hover)}
[data-vibeui-block="button-016"][data-tone="accent"]:hover{background:var(--vibeui-button-016-accent);filter:brightness(0.95)}
[data-vibeui-block="button-016"]:focus-visible{outline:2px solid var(--vibeui-button-016-accent);outline-offset:2px}
/* Значок внешней ссылки: рамка и стрелка из бордюров. */
[data-vibeui-block="button-016"] [data-part="out"]{position:relative;flex:none;width:0.75rem;height:0.75rem;opacity:.75}
[data-vibeui-block="button-016"] [data-part="out"]::before{
content:"";position:absolute;left:0;bottom:0;width:0.5625rem;height:0.5625rem;
border:1.5px solid currentColor;border-top-color:transparent;border-right-color:transparent;
border-radius:0.125rem;
}
[data-vibeui-block="button-016"] [data-part="out"]::after{
content:"";position:absolute;right:0;top:0;width:0.4375rem;height:0.4375rem;
border-top:1.5px solid currentColor;border-right:1.5px solid currentColor;
}
/* Пояснение про новую вкладку — только для скринридера: значок его не
   заменяет, а текст рядом с кнопкой был бы шумом. */
[data-vibeui-block="button-016"] [data-part="sr"]{
position:absolute;width:1px;height:1px;overflow:hidden;
clip-path:inset(50%);white-space:nowrap;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="button-016"] *{animation:none!important;transition:none!important}}
`

/**
 * Ссылка в виде кнопки: адрес копируется, вкладка открывается.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Button016({
  label = "Открыть документацию",
  href = "#",
  external = true,
  tone = "neutral",
  className,
  style,
  ...props
}: Button016Props) {
  return (
    <>
      <style href="vibeui-button-016" precedence="medium">
        {STYLES}
      </style>
      <a
        {...props}
        data-vibeui-block="button-016"
        data-tone={tone}
        href={href}
        className={className}
        style={style as CSSProperties}
        {...(external
          ? { target: "_blank", rel: "noopener noreferrer" }
          : null)}
      >
        {label}
        {external ? (
          <>
            <span data-part="out" aria-hidden="true" />
            <span data-part="sr">(откроется в новой вкладке)</span>
          </>
        ) : null}
      </a>
    </>
  )
}