LinkOut
This component forces external links to open in a new tab, overriding the default Starlight behavior.
The component adds the necessary attributes for external links and an indicator icon to the end of the linked content. The icon can be turned off, if necessary.
To use the component, the page must be in .mdx
format. Change the format from .md
to .mdx
if necessary. All your existing markdown will still be supported without issue.
Usage
Import the LinkOut
component like so:
Use the <LinkOut>
component within your content like so:
To disable the indicator icon, set the withIcon
prop to false
.
Build errors
Expected closing tag
Sometimes Starlight doesn’t like it when the first word of something (e.g., page, sentence, item in a list) is wrapped with the <LinkOut>
tag.
If you see an error similar to the one below, move the LinkOut to another word/phrase or add a word before the tag.
Working examples
With icon
Please consult the OpenPayments API for more information.
Without icon
Please consult the OpenPayments API for more information.