The Link component routes a new view within the application router. It should be used instead of <a> to avoid reloading the page.
Usage
import { Link } from 'components/lib';
function MyComponent({ ...props }){
return (
<div>
<Link url='/' title='Home' text='Go to Home' />
</div>
);
}
Props
| Prop | Description | Required | Value |
|---|---|---|---|
| children | children to render | required if no text prop | component(s) |
| className | custom style | optional | SCSS or Tailwind |
| color | link color | optional | string (dark/light), default: primary |
| text | link text | required | string |
| title | link title | required | string |
| url | destination url | required | string |
Notes
- The
Linkcomponent uses theNavLinkfromreact-router-domfor internal routing and<a>for external links. - The
classNameprop allows for custom styling to be applied. - The
colorprop sets the link color and defaults to the primary color if not specified. - The
textandtitleprops provide the link text and title, respectively. - The
urlprop specifies the destination URL.