Skip to content
Page

Link

Inline hyperlink that marks external destinations.

import { Link } from "@pelagornis/page/components";

The preview above renders this file. Copy it into src/components/ to start from it.

src/components/LinkExample.tsx
import { Link, Stack } from "@pelagornis/page/components";
export default function LinkDemo() {
return (
<Stack direction="row" gap="sizeLarge" align="center" wrap>
<Link href="/guides/getting-started/">Getting started</Link>
<Link href="https://ui.pelagornis.com/" target="_blank">
RefineUI
</Link>
<Link href="https://ui.pelagornis.com/" target="_blank" showExternalIcon={false}>
Without icon
</Link>
<Link href="/" disabled>
Disabled
</Link>
</Stack>
);
}

Link can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.

src/content/docs/example.mdx
---
title: Example
---
import { Link } from "@pelagornis/page/components";
<Link href="https://ui.pelagornis.com/" target="_blank">RefineUI</Link>

pageMarkdoc() registers a link tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.

src/content/docs/example.mdoc
{% link href="https://ui.pelagornis.com/" target="_blank" %}RefineUI{% /link %}

Attributes use the same names and values as the React props.

Parts of the component and the data-refineui role each one renders.

PartRole
rootlink

States the component styles. Component states are exposed as data attributes.

KindStates
Pseudofocus-visible

Keys the component handles when it has focus.

KeyAction
Enteractivate