No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

Link

Links allow a user to navigate between pages, scroll to a have page section, access files, or even to handle email addresses.

usage
import { TextLink, IconLink, Link, TextLinkAsButton, IconLinkAsButton } from "@sharegate/orbit-ui";
sources
Github

A link style can optimized for text.

Editable example

Icon

A text link can contain icons.

Editable example

Start icon

Non standard start icons can be provided to handle special cases. However, think twice before adding start icons, end icons should be your go to.

Editable example

External

An external text link will render by default with rel="noopener noreferrer" attribute.

You should avoid opening an external link in a new window or tab since it can be disorienting for people. Only do it when it's necessary. For more information, see W3C recommendation.

Editable example

Variants

A link can use a different style.

Editable example

Disabled

A link can have disabled style, it's your responsability to make sure the link doesn't navigate anywhere when activated.

Editable example

Size

A link can vary in size.

Editable example

Button

A link can behave like a button by using the TextLinkAsButton component.

Editable example

React router

To integrate with a third-party routing library like React Router any link component can be rendered as a React Router Link or as any other custom component.

Editable example

A link content can be a single icon.

When using this variant, an accessible name must be provided through aria-label prop. See WCAG practices.

Editable example

Button

An icon link can behave like a button by using the IconLinkAsButton component.

Editable example

A link can have a more subtle appareance and only be noticeable when focused.

Image

A link content can be an image element.

SpaceX launch
Editable example

Shape

A link can use a different shape to match his content shape on focus state.

SpaceX launchSpaceX launchSpaceX launch
Editable example

API

usage
import { TextLink } from "@sharegate/orbit-ui";
slots
"left-icon", "text", "icon"
NameDescriptionDefault
autoFocus
Whether or not the link should autoFocus on render.
numberfalsetrue
-
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
disabled
Whether or not the link is disabled.
falsetrue
-
external
Whether or not this is an external link.
falsetrue
-
href
See MDN.
string
-
rel
See MDN.
string
-
size
A link can vary in size.
"sm" | "md" | "inherit" | ResponsiveValue<"sm" | "md" | "inherit">
-
slot
Slot to render into.
string
-
target
See MDN.
string
-
underline
The underline style.
"none""dotted""solid"
-
variant
The link style to use.
"negative""primary""accent"
-
usage
import { IconLink } from "@sharegate/orbit-ui";
NameDescriptionDefault
aria-label*
See WCAG.
string
-
autoFocus
Whether or not the link should autoFocus on render.
numberfalsetrue
-
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
disabled
Whether or not the link is disabled.
falsetrue
-
external
Whether or not this is an external link.
falsetrue
-
href
See MDN.
string
-
rel
See MDN.
string
-
slot
Slot to render into.
string
-
target
See MDN.
string
-
variant
The link style to use.
"negative""primary""accent"
-
usage
import { Link } from "@sharegate/orbit-ui";
NameDescriptionDefault
autoFocus
Whether or not the link should autoFocus on render.
numberfalsetrue
-
disabled
Whether or not the link is disabled.
falsetrue
-
external
Whether or not this is an external link.
falsetrue
-
href
See MDN.
string
-
rel
See MDN.
string
-
shape
The link shape.
"circular""rounded""box"
-
slot
Slot to render into.
string
-
target
See MDN.
string
-

TextLinkAsButton

usage
import { TextLinkAsButton } from "@sharegate/orbit-ui";
NameDescriptionDefault
autoFocus
Whether or not the link should autoFocus on render.
numberfalsetrue
-
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
disabled
Whether or not the link is disabled.
falsetrue
-
external
Whether or not this is an external link.
falsetrue
-
href
See MDN.
string
-
rel
See MDN.
string
-
size
A link can vary in size.
"sm" | "md" | "inherit" | ResponsiveValue<"sm" | "md" | "inherit">
-
slot
Slot to render into.
string
-
target
See MDN.
string
-
underline
The underline style.
"none""dotted""solid"
-
variant
The link style to use.
"negative""primary""accent"
-

IconLinkAsButton

usage
import { IconLinkAsButton } from "@sharegate/orbit-ui";
NameDescriptionDefault
aria-label*
See WCAG.
string
-
autoFocus
Whether or not the link should autoFocus on render.
numberfalsetrue
-
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
disabled
Whether or not the link is disabled.
falsetrue
-
external
Whether or not this is an external link.
falsetrue
-
href
See MDN.
string
-
rel
See MDN.
string
-
slot
Slot to render into.
string
-
target
See MDN.
string
-
variant
The link style to use.
"negative""primary""accent"
-