Skip to content

Commit

Permalink
docs: improve button docs with another link option (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeEmos authored Aug 26, 2024
1 parent 946eed2 commit 0199f25
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/docs/src/routes/docs/components/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,18 @@ import { buttonVariants } from "~/components/ui/button"
```tsx
<a class={buttonVariants({ variant: "outline" })}>Click here</a>
```

Alternatively, you can set the `as` parameter with the component you want to use as your link.
```tsx
import { A } from "@solidjs/router";
```

```tsx
<Button as={A} href="/login">Login</Button>
```

Or set it as `"a"`, in case you want to use the standard HTML anchor tag.

```tsx
<Button as="a" href="/login">Login</Button>
```

0 comments on commit 0199f25

Please sign in to comment.