Get Started
Components
Dev Tools
More Guides
Linkify
A Linkify component is a UI tool that automatically detects and converts plain text URLs within a content area into clickable hyperlinks. This enhances user experience by allowing easy access to external resources without the need for manual formatting. Linkify typically recognizes various URL formats and ensures that they are presented in a visually distinct manner, making navigation seamless and intuitive.
# Demo
# Attributes
Name | Type | Default | Details |
---|---|---|---|
href | string | '' | URL to link to. If provided, renders an <a>. |
onClick | (e: MouseEvent) => void | Click handler. If href is not provided, renders a <span>. | |
className | string | '' | Custom CSS classes. |
target | string | Target for anchor links (e.g., _blank, _self). | |
rel | string | Rel attribute for anchor links. | |
children | ReactNode | Required | Content inside the link. |
# Usage
import { NLinkify } from 'nayan';
const Linkify = () => {
return (
<NLinkify>Checkout our new landing page at nayanui.com and new email hello@nayanui.com</NLinkify>
);
};
export default Linkify;
# Tags