Components

Link

This component is styled to resemble a hyperlink and semantically renders an anchor or button.

Under the hood, Link is an extension of the Text component. By default it will inherit its font size from its parent unless a size is set with the fontSize prop.

import { Link } from '@sproutsocial/racine'

Properties

NameTypeDefaultDescriptionRequired?
externalboolean
Optional prop to make the URL open in a new tab
childrenReact.Node
hrefstring
Setting this prop will cause the component to be rendered as a link
disabledboolean
Disables user action and applies a disabled style to the component
onClick(e: SyntheticEvent<HTMLButtonElement>) => void
Can be used in addition to an href but still renders as a link. Omitting href will render as button
as
TypeStyledComponentsCommonProps
"as"
underlineboolean
qaObject{}

Recipes

External link

Link as a button
In some cases, you may want the styling of a link but the ability to use a click handler. The link will render as a button element if you omit the href.

Link inline with text
Link next to button