Skip to content

Pill Button

Displays a pill-shaped button.

Create project?

Start with the default component set.

<script lang="ts">
  import { PillButton } from "$lib/components/ui/button/index.js";
  import ArrowRightIcon from "phosphor-svelte/lib/ArrowRightIcon";
</script>
 
<div
  class="hairline-frame w-full max-w-xl border border-border bg-card p-5 text-card-foreground"
>
  <div class="grid gap-5 sm:grid-cols-[1fr_auto] sm:items-end">
    <div class="grid gap-2">
      <h3 class="text-lg font-semibold">Create project?</h3>
      <p class="max-w-md text-sm/6 text-muted-foreground">
        Start with the default component set.
      </p>
    </div>
    <div class="flex flex-wrap gap-2 sm:justify-end">
      <PillButton href="/docs/installation">
        Create project
        <ArrowRightIcon data-icon="inline-end" />
      </PillButton>
      <PillButton href="/docs/components" variant="outline"
        >View components</PillButton
      >
    </div>
  </div>
</div>

Installation

Install the button component.

pnpm dlx jsrepo@latest add button

Usage

<script lang="ts">
  import { PillButton } from '$lib/components/ui/button/index.js';
</script>
<PillButton>Button</PillButton>

Examples

Default

<script lang="ts">
  import { PillButton } from "$lib/components/ui/button/index.js";
</script>
 
<PillButton>Button</PillButton>
<PillButton>Button</PillButton>

Outline

<script lang="ts">
  import { PillButton } from "$lib/components/ui/button/index.js";
</script>
 
<PillButton href="/docs/components" variant="outline"
  >View components</PillButton
>
<PillButton href="/docs/components" variant="outline">View components</PillButton>

With Icon

<script lang="ts">
  import { PillButton } from "$lib/components/ui/button/index.js";
  import ArrowRightIcon from "phosphor-svelte/lib/ArrowRightIcon";
</script>
 
<PillButton href="/docs/installation">
  Continue
  <ArrowRightIcon data-icon="inline-end" />
</PillButton>
<PillButton href="/docs/installation">
  Continue
  <ArrowRightIcon data-icon="inline-end" />
</PillButton>

Pair

Create project?

Start with the default component set.

<script lang="ts">
  import { PillButton } from "$lib/components/ui/button/index.js";
  import ArrowRightIcon from "phosphor-svelte/lib/ArrowRightIcon";
</script>
 
<div
  class="hairline-frame grid max-w-sm gap-4 border border-border bg-card p-4 text-card-foreground"
>
  <div class="grid gap-1">
    <h3 class="text-base font-semibold">Create project?</h3>
    <p class="text-sm/6 text-muted-foreground">
      Start with the default component set.
    </p>
  </div>
  <div class="flex flex-wrap justify-end gap-2">
    <PillButton variant="outline">Review settings</PillButton>
    <PillButton>
      Create project
      <ArrowRightIcon data-icon="inline-end" />
    </PillButton>
  </div>
</div>
<div class="hairline-frame grid max-w-sm gap-4 border border-border bg-card p-4">
  <div class="grid gap-1">
    <h3 class="text-base font-semibold">Create project?</h3>
    <p class="text-sm/6 text-muted-foreground">Start with the default component set.</p>
  </div>
  <div class="flex flex-wrap justify-end gap-2">
    <PillButton variant="outline">Review settings</PillButton>
    <PillButton>
      Create project
      <ArrowRightIcon data-icon="inline-end" />
    </PillButton>
  </div>
</div>