@itwin/itwinui-react
Version:
A react component library for iTwinUI
36 lines (35 loc) • 1.18 kB
TypeScript
import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
type AnchorProps = {
/**
* Whether the anchor links to an external site.
*
* When true, there will be an icon added at the end of the anchor text. This is useful
* to indicate that the link will open in a new tab.
*
* Not all external links should open in a new tab, so this prop should be used with caution.
*/
isExternal?: boolean;
/**
* Whether the anchor should be underlined in its idle state.
*
* By default, the anchor is underlined only on hover, or when using a high-contrast theme.
*/
underline?: boolean;
};
/**
* A consistently styled anchor component.
*
* Supports polymorphic `as` prop for use with `Link` components from routers,
* or to render as a button.
*
* @example
* <Anchor href='/'>Home</Anchor>
* <Anchor href='/projects'>Projects</Anchor>
* <Anchor href='/help' underline>Help</Anchor>
*
* @example
* <Anchor as={Link} to='/'>Home</Anchor>
* <Anchor as='button' onClick={() => {}}>click me</Anchor>
*/
export declare const Anchor: PolymorphicForwardRefComponent<"a", AnchorProps>;
export {};