Back to Twenty

Links

packages/twenty-docs/twenty-ui/navigation/links.mdx

2.2.03.6 KB
Original Source
<Frame> </Frame>

A stylized link component for displaying contact information.

<Tabs> <Tab title="Usage">
jsx
import { BrowserRouter as Router } from 'react-router-dom';

import { ContactLink } from 'twenty-ui/navigation';

export const MyComponent = () => {
  const handleLinkClick = (event) => {
    console.log('Contact link clicked!', event);
  };

  return (
    <Router>
      <ContactLink
        className
        href="mailto:[email protected]"
        onClick={handleLinkClick}
      >
        [email protected]
      </ContactLink>
    </Router>
  );
};
</Tab> <Tab title="Props">
PropsTypeDescription
classNamestringOptional name for additional styling
hrefstringThe target URL or path for the link
onClickfunctionCallback function to be triggered when the link is clicked
childrenReact.ReactNodeThe content to be displayed inside the link
</Tab> </Tabs>

A stylized link component for displaying links.

<Tabs> <Tab title="Usage">
jsx
import { RawLink } from "/navigation";
import { BrowserRouter as Router } from "react-router-dom";

export const MyComponent = () => {
  const handleLinkClick = (event) => {
    console.log("Contact link clicked!", event);
  };

  return (
    <Router>
      <RawLink className href="/contact" onClick={handleLinkClick}>
        Contact Us
      </RawLink>
    </Router>
  );
};

</Tab> <Tab title="Props">
PropsTypeDescription
classNamestringOptional name for additional styling
hrefstringThe target URL or path for the link
onClickfunctionCallback function to be triggered when the link is clicked
childrenReact.ReactNodeThe content to be displayed inside the link
</Tab> </Tabs>

A rounded-styled link with a Chip component for links.

<Tabs> <Tab title="Usage">
jsx
import { RoundedLink } from "/navigation";
import { BrowserRouter as Router } from "react-router-dom";

export const MyComponent = () => {
  const handleLinkClick = (event) => {
    console.log("Contact link clicked!", event);
  };

  return (
    <Router>
      <RoundedLink href="/contact" onClick={handleLinkClick}>
        Contact Us
      </RoundedLink>
    </Router>
  );
};
</Tab> <Tab title="Props">
PropsTypeDescription
hrefstringThe target URL or path for the link
childrenReact.ReactNodeThe content to be displayed inside the link
onClickfunctionCallback function to be triggered when the link is clicked
</Tab> </Tabs>

Stylized social links, with support for various social link types, such as URLs, LinkedIn, and X (or Twitter).

<Tabs> <Tab title="Usage">
jsx
import { SocialLink } from "twenty-ui/navigation";
import { BrowserRouter as Router } from "react-router-dom";

export const MyComponent = () => {
  return (
    <Router>
      <SocialLink
        type="twitter"
        href="https://twitter.com/twentycrm"
      ></SocialLink>
    </Router>
  );
};
</Tab> <Tab title="Props">
PropsTypeDescription
hrefstringThe target URL or path for the link
childrenReact.ReactNodeThe content to be displayed inside the link
typestringThe type of social links. Options include: url, LinkedIn, and Twitter
onClickfunctionCallback function to be triggered when the link is clicked
</Tab> </Tabs>