# Store Button

Link to your app on the App Store, Google Play, Galaxy Store or AppGallery with a badge that shows the store's mark and name, in black or as an outline.

Download badges for the App Store and Google Play

[Complete TSX file](/examples/store-button/default.tsx)

```tsx
"use client";

import { StoreButton } from "@/siteplane/components/store-button";

export default function Example() {
  return (
    <div className="flex flex-wrap items-center justify-center gap-3">
      <StoreButton href="#app-store" store="app-store" />
      <StoreButton href="#google-play" store="google-play" />
    </div>
  );
}
```

## Installation

Complete [one-time setup](/docs/installation/) first.

```bash
pnpm dlx shadcn@4.18.0 add @siteplane/store-button
```

With npm: `npx shadcn@4.18.0 add @siteplane/store-button`. [Registry JSON](/registry/store-button.json) lists source files and dependencies.

## Usage

```tsx
import { StoreButton } from "@/siteplane/components/store-button";

<StoreButton href="https://apps.apple.com/app/id000000000" store="app-store" />;
```

## Stores

`store` picks the store: `app-store`, `google-play`, `galaxy-store` or `app-gallery`. The badge shows the store’s mark before the store’s own wording, a small caption over its name: Download on the App Store, Get it on Google Play, Available on Galaxy Store and Explore it on AppGallery. Screen readers hear the same words as the name of the link. Set `aria-label` to name your app too, such as “Download Northlight on the App Store”.

## Appearance

`appearance="solid"`, the default, is a black badge with white text and the store’s mark in its colors, in light and dark themes. Its edge is light gray on a light page and white on a dark one. `appearance="outline"` has no fill: the text, the mark and the edge take the text color, for a light footer or a page where a row of black badges would weigh too much.

Every store, solid and outline

[Complete TSX file](/examples/store-button/appearance.tsx)

```tsx
"use client";

import { StoreButton } from "@/siteplane/components/store-button";

const stores = [
  "app-store",
  "google-play",
  "galaxy-store",
  "app-gallery",
] as const;

export default function Example() {
  return (
    <div className="flex flex-col items-center gap-4">
      {(["solid", "outline"] as const).map((appearance) => (
        <div className="flex flex-wrap justify-center gap-3" key={appearance}>
          {stores.map((store) => (
            <StoreButton
              appearance={appearance}
              href={`#${store}`}
              key={store}
              store={store}
            />
          ))}
        </div>
      ))}
    </div>
  );
}
```

## Sizes

Omit `size` to use the control size from `SiteplaneUIProvider`, as a [Button](/docs/components/button/#sizes) does, but never less than `md`: 40 px is the smallest App Store badge that Apple's guidelines allow on screen, so the badge is `md` at the default `sm` too. `md` is 40 px high with a 24 px mark, a 10 px caption and a 16 px name. `lg` is 44 px high and `xl` 48 px, and their mark, text and spacing are 10 and 20 percent larger. Each badge is as wide as its text.

The md, lg and xl sizes

[Complete TSX file](/examples/store-button/sizes.tsx)

```tsx
"use client";

import { StoreButton } from "@/siteplane/components/store-button";

export default function Example() {
  return (
    <div className="flex flex-col items-center gap-4">
      {(["md", "lg", "xl"] as const).map((size) => (
        <div className="flex flex-wrap justify-center gap-3" key={size}>
          <StoreButton href="#app-store" size={size} store="app-store" />
          <StoreButton href="#google-play" size={size} store="google-play" />
        </div>
      ))}
    </div>
  );
}
```

## Links

StoreButton renders a link. Set `href` to your app’s page in the store. Anchor props pass through, such as `target`, `rel` and `onClick` to count downloads. Keyboard focus, hover and press work as on [Button](/docs/components/button/).

## API reference

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| StoreButton.store | "app-store" \| "google-play" \| "galaxy-store" \| "app-gallery" | required | The store, which picks the mark, the caption and the name. |
| StoreButton.appearance | "solid" \| "outline" | "solid" | solid is the black badge with the store’s mark in its colors, outline has no fill and takes the text color. |
| StoreButton.size | "md" \| "lg" \| "xl" | provider / md | md is 40 px high, lg 44 px and xl 48 px with their mark, text and spacing 10 and 20 percent larger. Without it the badge takes the provider’s control size, md at sm. |
| StoreButton.href | string | unset | Your app’s page in the store. |
| StoreButton.aria-label | string | The store’s wording | The name of the link, such as “Download Northlight on the App Store”. |
`StoreButtonProps` extends the props of an `a` element except `children`, and
accepts a ref. `target`, `rel`, `className` and `onClick` work as on a link. The
root carries `data-store` and `data-appearance`. The types `StoreButtonStore`,
`StoreButtonAppearance` and `StoreButtonSize` are exported.

[Read the installed source](/source/store-button).

## Usage notes

These badges are drawn for Siteplane UI and are not the stores’ official badge artwork, which a store’s own guidelines may require. Store names and marks are trademarks of their owners.

Link each badge to the page of your app in that store, and show only the stores that list your app.
