Anchor
A text link, internal or external.
A static page with IzzyBlazor's script. No circuit.
A text link in the accent color. External opens it in a new tab, with an icon and a note for screen readers.
Usage
Read the <Anchor Href="/docs">docs</Anchor>.
<Anchor Href="https://github.com/..." External>GitHub</Anchor>Internal and external links
Use External to open a link in a new tab, with an icon and a note for screen readers.
Preview
Read the install guide before you begin.
The source is on GitHub (opens in a new tab).
Code
<Stack Gap="3" Grow>
<TextBlock>Read the <Anchor Href="docs/get-started/blazor-web-app">install guide</Anchor> before you begin.</TextBlock>
<TextBlock>The source is on <Anchor Href="https://github.com/enabledevmode/izzyblazor" External>GitHub</Anchor>.</TextBlock>
</Stack>Underline and color
Use Underline for links whose place already says "link", and Inherit to take the color of the text around it.
Preview
Prices exclude tax. See the billing terms for details.
Code
<Stack Gap="3" Grow>
<Row Gap="6" Wrap>
<Anchor Href="docs/components">Always</Anchor>
<Anchor Href="docs/components" Underline="AnchorUnderline.Hover">On hover</Anchor>
<Anchor Href="docs/components" Underline="AnchorUnderline.None">None</Anchor>
</Row>
<TextBlock Size="TextSize.Sm" Color="Color.Muted">
Prices exclude tax. See the <Anchor Href="docs/components" Inherit>billing terms</Anchor> for details.
</TextBlock>
</Stack>Mode support
| Feature | Off | Static | Live |
|---|---|---|---|
| Everything | Yes | Yes | Yes |
Off: JavaScript disabled. Static: a static SSR page with IzzyBlazor's script. Live: an interactive page (Server, WebAssembly or Auto).
Accessibility
- It renders a native
awith anhref, so Enter and focus work as the browser defines them. - The link text is its name, so write text that makes sense on its own, not "Click here".
- An external link says it opens a new tab (
NewTabLabel), even withHideExternalIcon. AnchorUnderline.HoverandAnchorUnderline.Noneleave only color to mark the link in text; keep them for links whose place says "link", such as a nav.
Parameters
| Prop | Type | Default |
|---|---|---|
HrefWhere it goes. | string | Required |
ExternalOpens in a new tab (target="_blank" rel="noopener noreferrer"), with an icon after the text. | bool | false |
HideExternalIconLeaves out an external link's icon, for repeated links where it would be noise (a list of lessons, say). | bool | false |
UnderlineWhen it's underlined. | AnchorUnderline | AnchorUnderline.Always |
InheritUses the surrounding text color instead of the accent, still underlined, for links in muted text or on colored backgrounds. | bool | false |
NewTabLabelRead to screen readers after an external link's text. | string? | "(opens in a new tab)" |
ChildContentThe link text. | RenderFragment? |
Plus 16 item props and 4 common props.
Full APISee also
- Button: submits, resets, links or runs C#.
- IconButton: a square button with a required label.
- Prose: styles plain HTML, such as rendered Markdown.