Link
Links allow users to navigate to different pages or external resources.
Installation
Usage
Props
Link
Extends Pressable
props.
Prop | Type | Default | Description |
---|---|---|---|
href | string | - | The URL that the link points to. |
label | string | - | The text content of the link. |
variant | 'default' | 'visited' | 'dark-background' | 'default' | The visual style variant of the link. |
external | boolean | false | When true, displays an external link icon. |
visited | boolean | false | When true, applies visited link styling. |
focus | boolean | false | When true, applies focus ring styling. |
className | string | - | Additional Tailwind classes to apply. |
Examples
Default Link
External Link
Visited Link
Dark Background
Focus State
Styling
The Link component uses Tailwind CSS classes for styling through class-variance-authority (cva). Default styling includes:
- Font: Source Sans Pro
- Base text size with 162% line height
- Underlined text
- Primary color (default variant)
- Focus ring when focused
- External link icon spacing (when external)
- Visited state color
- Dark background variant for contrast
States
Links have several visual states:
- Default: Primary color
- Visited: Violet color
- Focus: Blue focus ring
- Dark background: Light primary color
- External: Includes external link icon
Accessibility
The Link component:
- Uses semantic link structure
- Supports keyboard navigation
- Maintains WCAG color contrast requirements
- Provides visual feedback for interaction states
- Includes external link indicators where appropriate
- Uses proper text spacing for readability