LinkButton
A link-styled button component that appears as a text link but behaves as a button
Installation
Terminal
Import
Component.tsx
Basic
Basic button usage without href prop.
Renders as a <button> element with click handler.
As Internal Link
Basic link usage with href prop.
Renders as an <a> element for internal navigation.
As External Link
External link usage with automatic security handling.
Component automatically detects external links (href starting with "http" or "//")
and applies security attributes:
- If target is not specified, automatically sets target="_blank" to open in new tab
- Automatically adds rel="noopener noreferrer" to prevent security vulnerabilities
(if rel already exists, appends "noopener noreferrer" to existing value)
This prevents window.opener attacks and ensures safe external navigation.
Disabled
Disabled state prevents interaction and shows visual feedback.
Works for both links and buttons.
With Icons
Links with icons for better visual hierarchy.
Variants
Variants side by side for comparison.
API reference
| LinkButtonProps | Type | Default |
|---|---|---|
className | string |undefined | - |
disabled | boolean |undefined | - |
readOnly | boolean |undefined | - |
variant | undefined |"default" |"subtle" | - |