# Link A link is an interactive, clickable element, usually text or an icon, that directs users to another page, website, or a specific section within the same page, acting as a fundamental tool for navigation and accessing more information **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-link--introduction ## Variants documented in Storybook - DefaultLinks: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-link--defaultlinks - NeutralLinks: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-link--neutrallinks ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Link. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Default Links — Small Variant HTML: ```html Default Link Small open_in_new Link Link open_in_new Default Link Disabled ``` React: ```jsx import React from 'react'; const LinkExample1Demo = () => ( <> {/* Variant: default Link Small - Text Only */} Default Link Small {/* Variant: default Link Small - Leading Icon */} open_in_new Link {/* Variant: default Link Small - Trailing Icon */} Link open_in_new {/* Variant: default Link Small - disabled */} Default Link Disabled > ); export default LinkExample1Demo; ``` Angular: ```html Default Link Small open_in_new Link Link open_in_new Default Link Disabled ``` ### 2. Default Links — Medium Variant HTML: ```html Default Link Medium open_in_new Link Link open_in_new Default Link Disabled ``` React: ```jsx import React from 'react'; const LinkExample2Demo = () => ( <> {/* Variant: default Link Medium - Text Only */} Default Link Medium {/* Variant: default Link Medium - Leading Icon */} open_in_new Link {/* Variant: default Link Medium - Trailing Icon */} Link open_in_new {/* Variant: default Link Medium - disabled */} Default Link Disabled > ); export default LinkExample2Demo; ``` Angular: ```html Default Link Medium open_in_new Link Link open_in_new Default Link Disabled ``` ### 3. Introduction — Introduction HTML: ```html
A link is an interactive, clickable element, usually text or an icon, that directs users to another page, website, or a specific section within the same page, acting as a fundamental tool for navigation and accessing more information
Visual demonstration of various link sizes and color types.
Quickly copy sizing and variant utility classes for text links.
|
Default Link Small (14px)
ux4g-text-link-sm
|
|
Default Link Medium (16px)
ux4g-text-link-md
|
|
Neutral Link Small (14px)
ux4g-text-link-neutral-sm
|
|
Neutral Link Medium (16px)
ux4g-text-link-neutral-md
|
A link is an interactive, clickable element, usually text or an icon, that directs users to another page, website, or a specific section within the same page, acting as a fundamental tool for navigation and accessing more information
Visual demonstration of various link sizes and color types.
{/* default Showcase */}Quickly copy sizing and variant utility classes for text links.
|
Default Link Small (14px)
ux4g-text-link-sm
|
|
Default Link Medium (16px)
ux4g-text-link-md
|
|
Neutral Link Small (14px)
ux4g-text-link-neutral-sm
|
|
Neutral Link Medium (16px)
ux4g-text-link-neutral-md
|
A link is an interactive, clickable element, usually text or an icon, that directs users to another page, website, or a specific section within the same page, acting as a fundamental tool for navigation and accessing more information
Visual demonstration of various link sizes and color types.
Quickly copy sizing and variant utility classes for text links.
|
Default Link Small (14px)
ux4g-text-link-sm
|
|
Default Link Medium (16px)
ux4g-text-link-md
|
|
Neutral Link Small (14px)
ux4g-text-link-neutral-sm
|
|
Neutral Link Medium (16px)
ux4g-text-link-neutral-md
|