Link

A link in the colour of the words around it, underlined on hover, opening another page through Next's link.

import { Link } from "@produkto/ui/Link";

const Example = () => <Link href="#">Link</Link>;

export default Example;

Usage

import { Link } from "@produkto/ui/Link";
<Link href="/">Link</Link>

Examples

Underline

A link is underlined on hover by default; underline keeps the line under it, for a link inside a sentence, its words darkening on hover.

Content goes here, with a link and an underlined link inside the text.

import { Link } from "@produkto/ui/Link";
import { Text } from "@produkto/ui/Text";

const Example = () => (
  <Text as="p" className="max-w-sm">
    Content goes here, with a <Link href="#">link</Link> and an{" "}
    <Link href="#" underline>
      underlined link
    </Link>{" "}
    inside the text.
  </Text>
);

export default Example;

Muted

muted writes it in the muted grey, darkening on hover, for quiet links such as a footer's, beside one in the colour of the words around it.

import { Link } from "@produkto/ui/Link";

const Example = () => (
  <div className="flex flex-wrap items-center gap-4">
    <Link href="#">Link</Link>
    <Link href="#" muted>
      Link
    </Link>
  </div>
);

export default Example;

Sizes

size sets its words on the body scale, as Text's does, for a link that stands on its own; without it the link keeps the size of the words around it.

import { Link } from "@produkto/ui/Link";
import type { TextSize } from "@produkto/ui/Text";

const sizes: TextSize[] = ["xs", "sm", "base", "lg"];

const Example = () => (
  <div className="flex flex-col gap-2">
    {sizes.map((size) => (
      <Link key={size} href="#" size={size}>
        Link
      </Link>
    ))}
  </div>
);

export default Example;

With icon

An Icon beside the words sits on their line at their size, here marking a link that opens another site.

import { LinkSquare02Icon } from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";
import { Link } from "@produkto/ui/Link";

const Example = () => (
  <Link href="#" rel="noopener noreferrer" target="_blank">
    Link
    <Icon icon={LinkSquare02Icon} />
  </Link>
);

export default Example;

API Reference

Link

LinkProps · components/Link/Link.types.ts
PropTypeDefault
underlineboolean-
mutedboolean-
sizeTextSize"xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl"-
hrefundefined-

It also takes the props of NextLink, <button>.