> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Connect with Zernio button

Add the official Connect with Zernio button to your app, with copy-paste HTML and React, downloadable SVG and PNG files, and the brand rules.

The button starts the [OAuth flow](/oauth/quickstart): users click it, approve access on the Zernio consent screen, and come back to your app connected.

![Connect with Zernio buttons in the light, outline and dark themes](/docs-static/oauth/connect-button-themes.png)

## Before you start

You need a registered OAuth client and a server route that sends the user to `https://zernio.com/oauth/authorize`. The [quickstart](/oauth/quickstart) covers both.

## Add the button with HTML

Paste the CSS once and the link where the button goes. Replace the placeholders, or point `href` at your own route that builds the authorize URL with a fresh `state` and PKCE challenge.

```html
<style>
  .zernio-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 40px; padding: 0 16px; border: 1px solid #8F8C86; border-radius: 8px;
    background: #FFFFFF; color: #2D2D2D; text-decoration: none; white-space: nowrap;
    font: 500 15px/1 Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 150ms, border-color 150ms;
  }
  .zernio-btn svg { height: 18px; width: auto; flex: none; }
  .zernio-btn:hover { background: #F0EFEB; }
  .zernio-btn:active { background: #E6E4DE; }
  .zernio-btn:focus-visible { outline: 2px solid #2D2D2D; outline-offset: 2px; box-shadow: 0 0 0 2px #FFFFFF; }

  .zernio-btn--dark { background: #131010; border-color: #6B6565; color: #FFFFFF; }
  .zernio-btn--dark:hover { background: #2A2525; border-color: #8A8383; }
  .zernio-btn--dark:focus-visible { outline-color: #FFFFFF; box-shadow: 0 0 0 2px #131010; }
  .zernio-btn--dark:active { background: #3D3838; }
  .zernio-btn--outline { background: transparent; border-color: #2D2D2D; }
  .zernio-btn--outline:hover { background: #F0EFEB; }
  .zernio-btn--outline:active { background: #E6E4DE; }

  .zernio-btn--sm { height: 32px; padding: 0 12px; gap: 8px; border-radius: 6px; font-size: 13px; }
  .zernio-btn--sm svg { height: 14px; }
  .zernio-btn--lg { height: 48px; padding: 0 20px; gap: 12px; border-radius: 10px; font-size: 17px; }
  .zernio-btn--lg svg { height: 22px; }
  .zernio-btn--icon { width: 40px; padding: 0; }
  .zernio-btn--icon svg { height: 20px; }
</style>

<a class="zernio-btn"
   href="https://zernio.com/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=posts%3Aread%20posts%3Awrite&state=STATE&code_challenge=CODE_CHALLENGE&code_challenge_method=S256">
  <svg viewBox="0 0 488 495" aria-hidden="true" focusable="false">
    <path fill="#EB3514" d="M0.000396729 38.7447L0.000244141 223.356L287.133 147.974C322.914 138.58 355.395 171.549 345.469 207.186L265.401 494.644L448.484 494.644L486.425 308.414C489.592 292.87 484.861 276.765 473.79 265.403L229.302 14.4805C217.923 2.80178 201.386 -2.28979 185.409 0.965786L0.000396729 38.7447Z"/>
  </svg>
  Connect with Zernio
</a>
```

Add `zernio-btn--dark` or `zernio-btn--outline` for the other themes, and `zernio-btn--sm` or `zernio-btn--lg` for the other sizes. The icon-only button takes `zernio-btn--icon` and `aria-label="Connect with Zernio"` instead of the text.

Without Geist loaded, the text falls back to the system font. For exact type, or to skip the CSS, link the hosted image:

```html
<a href="YOUR_AUTHORIZE_ROUTE">
  <img src="https://zernio.com/brand/connect-button/connect-with-zernio-light-md.svg"
       height="40" alt="Connect with Zernio">
</a>
```

## Add the button in React

The same button as a component. It uses the CSS above, so add that to your stylesheet first.

```tsx
import type { ComponentPropsWithoutRef } from "react";

const ZERNIO_MARK =
  "M0.000396729 38.7447L0.000244141 223.356L287.133 147.974C322.914 138.58 355.395 171.549 345.469 207.186L265.401 494.644L448.484 494.644L486.425 308.414C489.592 292.87 484.861 276.765 473.79 265.403L229.302 14.4805C217.923 2.80178 201.386 -2.28979 185.409 0.965786L0.000396729 38.7447Z";

type ConnectWithZernioProps = ComponentPropsWithoutRef<"a"> & {
  href: string;
  theme?: "light" | "dark" | "outline";
  size?: "sm" | "md" | "lg";
  iconOnly?: boolean;
  label?: "Connect with Zernio" | "Sign in with Zernio";
};

export function ConnectWithZernio({
  theme = "light",
  size = "md",
  iconOnly = false,
  label = "Connect with Zernio",
  className,
  ...anchorProps
}: ConnectWithZernioProps) {
  const classes = ["zernio-btn"];
  if (theme !== "light") classes.push(`zernio-btn--${theme}`);
  if (iconOnly) classes.push("zernio-btn--icon");
  else if (size !== "md") classes.push(`zernio-btn--${size}`);
  if (className) classes.push(className);

  return (
    <a {...anchorProps} className={classes.join(" ")} aria-label={iconOnly ? label : undefined}>
      <svg viewBox="0 0 488 495" aria-hidden="true" focusable="false">
        <path fill="#EB3514" d={ZERNIO_MARK} />
      </svg>
      {iconOnly ? null : label}
    </a>
  );
}
```

```tsx
<ConnectWithZernio href="/auth/zernio/start" theme="dark" size="lg" />
<ConnectWithZernio href="/auth/zernio/start" iconOnly />
```

## Download the files

[Download every file as a zip](https://zernio.com/brand/connect-button/zernio-connect-button.zip), or link one directly at `https://zernio.com/brand/connect-button/<file>`.

| Part of the name | Values |
|---|---|
| Label | `connect-with-zernio`, `sign-in-with-zernio`, `zernio-icon` (the mark alone) |
| Theme | `light` and `outline` for light backgrounds, `dark` for dark ones |
| Size | `sm` (32 px tall), `md` (40 px), `lg` (48 px) |
| Format | `.svg`, `.png`, `@2x.png` |

For example, `connect-with-zernio-dark-lg.svg` or `zernio-icon-light-sm@2x.png`.

## Brand guidelines

**Do**

- Use the wording as provided: **Connect with Zernio** to link a Zernio workspace to an account in your app, or **Sign in with Zernio** when Zernio is how users log in.
- Keep every button, the icon-only one included, at least 32 px tall.
- Stretch the button to a container's width if you like, with its content centered.
- Leave clear space of at least half the button's height on every side.
- Pick the theme that stands out from the background behind it.

**Don't**

- Change, recolor, stretch, crop, rotate or redraw the Zernio mark or the button images.
- Put the light or outline button on a dark background.
- Change the wording or colors, or add other text inside the button.
- Suggest that Zernio sponsors, endorses or certifies your app.
- Use the button for anything other than connecting to Zernio.

## Related

- [OAuth quickstart](/oauth/quickstart)
- [Scopes](/oauth/scopes)
- [Consent screen](/oauth/consent-screen)