Link
Basic link display, use Anchor under the hood.
Link with icon
import { IoExitOutline } from "swash/Icon";
import { Link } from "swash/Link";
export const Example = () => {
return (
<Link icon={<IoExitOutline />} href="https://google.com">
Go to Google
</Link>
);
};
Render as child
Use asChild
to render the link as the child. Useful to use a RouterLink
.
import { Link as RouterLink } from "react-router-dom";
import { Link } from "swash/Link";
export const Example = () => {
return (
<Link asChild>
<RouterLink to="/">Home</RouterLink>
</Link>
);
};