跳转到主内容

仅 CSS Tailwind CSS 链接主要颜色、次要颜色、强调色和中性颜色变体。将鼠标悬停在下划线和普通样式上。 WCAG AA 可访问,可与 Django、HTMX、Laravel、React 和任何堆栈配合使用。

Link components style anchor elements with visual hierarchy and semantic meaning. The Frutjam link system supports multiple colors, hover effects, sizes, and decoration options through Tailwind CSS utility classes. Perfect for text links, navigation, and call-to-action elements, links maintain accessibility standards with proper focus management and underline toggle options.

CSS-only, no JavaScript required. WCAG AA accessible and framework-agnostic — works with Django, HTMX, Laravel, React, and any stack.

Class Type Description
linkBaseStyled anchor with underline and color
link-hoverStyleUnderline visible only on hover
link-xsSizeExtra small
link-smSizeSmall
link-mdSizeMedium (default)
link-lgSizeLarge
link-xlSizeExtra large
link-2xlSize2× extra large
link-primaryColorPrimary theme color
link-secondaryColorSecondary theme color
link-accentColorAccent theme color
link-neutralColorNeutral theme color
link-infoColorInfo semantic color
link-successColorSuccess semantic color
link-warningColorWarning semantic color
link-errorColorError semantic color

Basic Usage

<a class="link">Link</a>
<a className="link">Link</a>

Apply semantic link colors to match your theme or to convey meaning (such as using link-error for destructive actions or link-success for confirmation).

html
1
2
3
4
5
6
7
8
<a class="link link-primary">Primary link</a>
<a class="link link-secondary">Secondary link</a>
<a class="link link-accent">Accent link</a>
<a class="link link-success">Success link</a>
<a class="link link-info">Info link</a>
<a class="link link-warning">Warning link</a>
<a class="link link-error">Error link</a>
<a class="link link-neutral">Neutral link</a>

Scale your hyperlinks to match the surrounding typography. These utility classes range from extra small for footer "legal" text to 2X large for high-impact hero sections.

html
1
2
3
4
5
6
<a class="link link-xs">Primary link</a>
<a class="link link-sm">Secondary link</a>
<a class="link link-md">Accent link</a>
<a class="link link-lg">Success link</a>
<a class="link link-xl">Info link</a>
<a class="link link-2xl">Warning link</a>

By default, you can choose to hide the underline and only reveal it on hover. This is a common design pattern for cleaner navigation menus and dashboard sidebars.

html
<a class="link link-hover">Hover this link</a>