The link text content
Container element with link inside, or null if required params are missing
// Basic headline with link (paragraph wrapper)
const headline = createTextWithLink({
text: 'Read the full story',
url: 'https://example.com/article'
});
// Heading with link
const headingLink = createTextWithLink({
text: 'Article Title',
url: '/articles/123',
containerTag: 'h2',
openInNewTab: false
});
// With accessibility label
const accessibleLink = createTextWithLink({
text: 'Learn more',
url: '/about',
ariaLabel: 'Learn more about our mission and values'
});
Creates a text element containing a link (useful for headlines, titles, etc.)
Creates a container element (paragraph by default) with an anchor link inside. The link opens in a new tab with security attributes by default.