Socket
Socket
Sign inDemoInstall

@commercetools-uikit/link

Package Overview
Dependencies
12
Maintainers
0
Versions
782
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/link

Links are used either to link to other UI routes, or to link to external pages. This component is a very thin wrapper over either a React Router Link, or a normal HTML tag.


Version published
Maintainers
0
Created

Readme

Source

Description

Links are used either to link to other UI routes, or to link to external pages. This component is a very thin wrapper over either a React Router Link, or a normal HTML <a> tag.

Installation

yarn add @commercetools-uikit/link
npm --save install @commercetools-uikit/link

Additionally install the peer dependencies (if not present)

yarn add react react-intl react-router-dom
npm --save install react react-intl react-router-dom

Usage

import Link from '@commercetools-uikit/link';

const Example = () => <Link to={'/foo/bar'}>Go to foo bar</Link>;
const ExampleWithExternal = () => (
  <Link isExternal={true} to={'https://kanyetothe.com'}>
    Go to external link
  </Link>
);

export default Example;

Properties

PropsTypeRequiredDefaultDescription
childrenReactNodeValue of the link.
Required if intlMessage is not provided.
intlMessageMessageDescriptorAn intl message object that will be rendered with FormattedMessage.
Required if children is not provided.
isExternalbooleanfalseA flag to indicate if the Link points to an external source. If true, a regular <a> is rendered instead of the default react-routers <Link />
tounion
Possible values:
string , LocationDescriptor
The URL that the Link should point to.
toneunion
Possible values:
'primary' , 'inverted', 'secondary'
'primary'Color of the link
onClickFunction
See signature.
Handler when the link is clicked.

Signatures

Signature onClick

(
  event: MouseEvent<HTMLLinkElement> | KeyboardEvent<HTMLLinkElement>
) => void

Keywords

FAQs

Last updated on 08 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc