Link
An anchor element that derives its href from a directory, file, module export,
or from the RootProvider config.
The Link component is an anchor element that derives its href from a directory, file, or module export, or from the RootProvider config.
It supports the following variants:
Variants
-
source(default),edit,history,raw,blame,editor -
repository,owner,branch,issue
API Reference
Type
"source" | "edit" | "raw" | "blame" | "history" | "release" | "editor" | "repository" | "owner" | "branch" | "issue"Extends
ReleaseProperties
| Property | Type | Modifiers |
|---|---|---|
| rawTagName? | string | — |
Original tag name from the provider (e.g. GitHub | ||
| rawName? | string | — |
Original release name/title from the provider. | ||
| tag? | string | — |
Primary tag identifier, normalized from the underlying release. | ||
| name? | string | — |
Package or display name, normalized from the underlying release. | ||
| label | string | — |
Normalized label suitable for display. | ||
| toString | () => string | — |
String representation when rendered in a string context. | ||
| tagName? | string | — |
The release tag name. | ||
| htmlUrl | string | — |
The HTML URL to the release or releases overview when unavailable. | ||
| publishedAt? | string | — |
ISO timestamp for when the release was published, if provided by the host. | ||
| isDraft | boolean | — |
Indicates whether the release is marked as a draft. | ||
| isPrerelease | boolean | — |
Indicates whether the release is marked as a prerelease. | ||
| isFallback | boolean | — |
True when the response falls back to a generic releases page. | ||
| assets | Array<ReleaseAsset> | — |
Downloadable assets published alongside the release. | ||
| tarballUrl? | string | — |
Direct link to the tarball source archive, when available. | ||
| zipballUrl? | string | — |
Direct link to the zipball source archive, when available. | ||
Methods
| Method | Signature | Modifiers |
|---|---|---|
| toString | () => string | — |
String representation when rendered in a string context. Returnsstring | ||
Properties
| Property | Type | Modifiers |
|---|---|---|
| href | string | — |
The URL of the release. | ||
| tag? | string | — |
The tag of the release. | ||
| name? | string | — |
The name of the release. | ||
| label | `${string}@${string}` | — |
The tag and name of the release. | ||
| publishedAt? | string | — |
ISO timestamp for when the release was published, if provided by the host. | ||
| isPrerelease | boolean | — |
Indicates whether the release is marked as a prerelease. | ||
| isDraft | boolean | — |
Indicates whether the release is marked as a draft. | ||
Variant extends LinkVariant
| Property | Type | |
|---|---|---|
| css? | CSSObject | |
| source? | Source | |
| variant? | Variant | |
| packageName? | string | |
| release? | string | |
| refresh? | boolean | |
| asset? | true | string | RegExp | |
| archiveSource? | "zip" | "tar" | |
| compare? | string | |
| repository? | Repository | RepositoryConfig | string | |
| children? | React.ReactNode | (context: LinkContextFor<Variant>) => React.ReactNode | |
Variant extends LinkVariant
| Property | Type | |
|---|---|---|
| css? | CSSObject | |
| source | Source | |
| variant? | Variant | |
| options? | VariantOptions<Source, Variant> | |
| children? | React.ReactNode | (context: LinkContextFor<Variant>) => React.ReactNode | |
Variant does not extend LinkVariant and Variant extends LinkVariant
| Property | Type | |
|---|---|---|
| css? | CSSObject | |
| children? | React.ReactNode | (context: LinkContextFor<Variant>) => React.ReactNode | |
An anchor element that derives its href from a directory, file, module export,
or from the RootProvider config.
Properties
LinkProps<Source, Variant>Type Parameters
| Parameter | Constraint | Default |
|---|---|---|
Source | — | — |
Variant | LinkVariant | "source" |
Returns
Promise<string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined>Modifiers
async