SbLink
Styled anchor element for navigation with support for external links, underline styles, and colors.
Parameters
| Parameter |
Type |
Default |
Description |
| Href |
string? |
null |
The URL to navigate to |
| Target |
string? |
null |
Link target (_blank, _self, etc.) |
| Rel |
string? |
null |
Custom rel attribute |
| Disabled |
bool |
false |
Whether the link is disabled |
| External |
bool |
false |
Shows external link indicator icon |
| Color |
SbColor |
Primary |
Link color (Default, Primary, Secondary, Success, Warning, Danger, Info, Muted) |
| Underline |
SbLinkUnderline |
Hover |
Underline behavior (Always, Hover, None) |
| Class |
string? |
null |
Additional CSS classes |
| Style |
string? |
null |
Inline styles |
| AdditionalAttributes |
Dictionary<string, object>? |
null |
Additional HTML attributes (e.g. aria-, data-) |
Events
| Event |
Type |
Description |
| OnClick |
EventCallback |
Fired when the link is clicked |
Templates / Slots (RenderFragments)
| Slot |
Type |
Description |
| ChildContent |
RenderFragment |
The link text or content |
Template Usage Examples
Basic Link
With Custom Content
CSS Classes
sb-link - Base class
sb-link--primary - Primary color
sb-link--secondary - Secondary color
sb-link--success - Success color
sb-link--warning - Warning color
sb-link--danger - Danger color
sb-link--info - Info color
sb-link--muted - Muted color
sb-link--default - Default color
sb-link--underline-always - Always show underline
sb-link--underline-hover - Underline on hover
sb-link--underline-none - No underline
sb-link--disabled - Disabled state
sb-link--external - External link styling
Accessibility
- Uses native
<a> element
aria-disabled set when disabled
tabindex="-1" when disabled to remove from tab order
rel="noopener noreferrer" automatically added for external links and target="_blank"
- External link indicator is hidden from screen readers
Examples
Basic Usage
External Link
Colors
Underline Styles
Disabled Link
In Text
With Click Handler