Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | <script lang="ts">
import type { HTMLAnchorAttributes } from "svelte/elements";
import classNames from "$lib/util/classNames";
import "./Link.scss";
// Note: All props not mentioned below will be passed directly to the <a/> element via $$props, e.g. href and target.
type $$Props = HTMLAnchorAttributes & {
class?: string;
external?: boolean;
alternate?: boolean;
};
// this isn't necessary but will suppress vite-plugin-svelte a11y warnings
export let href: string | null | undefined = "";
// additional classes to add
let className = "";
export { className as class };
// render as an external link, with the "launch" icon rendered ::after
export let external = false;
// render with the alternate variation, for use on darker backgrounds
export let alternate = false;
$: linkClassNames = classNames(
`usa-link`,
external && "usa-link--external",
alternate && "usa-link--alt",
className,
);
</script>
<a {...$$restProps} {href} class={linkClassNames} rel={external ? "external" : null} on:click>
<slot />
</a>
|