Skip to content

로그인 버튼 컴포넌트

logi SSO 버튼의 표준 사이즈 × 테마 조합. vanilla HTML + CSS variables — React/Vue/Svelte/Flutter 어느 스택에서도 복붙해서 색만 토큰으로 override 하면 그대로 동작합니다.

왜 vanilla 만 제공하나요

프레임워크별 NPM 패키지는 채택 데이터 본 후 Phase 2에 진행 예정입니다. 그 전에는 vanilla 가 모든 스택에서 동작하고, 디자인 변경 시 RP 가 한 줄로 token 만 바꿀 수 있어 가장 유연합니다.

QR 로그인 옵션은 logi 의 /oauth/authorize 페이지 안에 이미 통합돼 있어 별도 QR 버튼은 필요 없습니다 (QR 로그인 참고).

공통 CSS

한 번만 박아두면 아래 모든 사이즈가 동작합니다.

html
<style>
  :root {
    /* RP 가 자기 디자인 시스템에 맞춰 override 하세요 */
    --logi-button-bg:        #0F172A;  /* dark theme bg */
    --logi-button-fg:        #F8FAFC;  /* dark theme text */
    --logi-button-bg-light:  #FFFFFF;
    --logi-button-fg-light:  #0F172A;
    --logi-button-border:    rgba(15, 23, 42, 0.12);
    --logi-button-radius:    12px;
    --logi-button-font:      -apple-system, "Pretendard Variable", "Segoe UI", sans-serif;
  }

  .logi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--logi-button-bg);
    color: var(--logi-button-fg);
    border: 1px solid var(--logi-button-border);
    border-radius: var(--logi-button-radius);
    font-family: var(--logi-button-font);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.05s;
    user-select: none;
  }
  .logi-btn:hover  { opacity: 0.92; }
  .logi-btn:active { transform: scale(0.98); }

  .logi-btn--light {
    background: var(--logi-button-bg-light);
    color:      var(--logi-button-fg-light);
  }

  /* 사이즈 */
  .logi-btn--1x1 { width: 44px;  height: 44px; padding: 0; }
  .logi-btn--2x1 { height: 44px; padding: 0 1rem;          font-size: 0.9375rem; }
  .logi-btn--4x1 { height: 56px; padding: 0 1.5rem;        font-size: 1rem; width: 100%; }

  .logi-btn__logo { width: 20px; height: 20px; flex-shrink: 0; }
  .logi-btn--4x1 .logi-btn__logo { width: 24px; height: 24px; }
</style>

브랜드 아이콘 (동심원 SVG):

html
<svg class="logi-btn__logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
  <circle cx="12" cy="12" r="9"/>
  <circle cx="12" cy="12" r="4.5"/>
  <circle cx="12" cy="12" r="1.4" fill="currentColor"/>
</svg>

1x1 — 아이콘 전용 (44×44)

사이드바 / FAB / 모바일 헤더 / 액션바 같이 좁은 공간 — 텍스트 없이 로고만.

html
<a href="/auth/1pass/initiate" class="logi-btn logi-btn--1x1" aria-label="logi 로 로그인">
  <svg class="logi-btn__logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
    <circle cx="12" cy="12" r="9"/>
    <circle cx="12" cy="12" r="4.5"/>
    <circle cx="12" cy="12" r="1.4" fill="currentColor"/>
  </svg>
</a>

접근성

1x1 버튼은 텍스트가 없으므로 aria-label="logi 로 로그인" 필수. 스크린리더가 의미 전달 못 하면 WCAG 2.1 4.1.2 위반.

2x1 — 인라인 (220×44)

로그인 폼 하단 / 모달 footer / "다른 방법으로 로그인" 옵션 묶음.

html
<a href="/auth/1pass/initiate" class="logi-btn logi-btn--2x1">
  <svg class="logi-btn__logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
    <circle cx="12" cy="12" r="9"/>
    <circle cx="12" cy="12" r="4.5"/>
    <circle cx="12" cy="12" r="1.4" fill="currentColor"/>
  </svg>
  logi 로 로그인
</a>

4x1 — Hero (full-width × 56)

메인 로그인 페이지의 primary CTA. 한 줄을 통째로 차지.

html
<a href="/auth/1pass/initiate" class="logi-btn logi-btn--4x1">
  <svg class="logi-btn__logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
    <circle cx="12" cy="12" r="9"/>
    <circle cx="12" cy="12" r="4.5"/>
    <circle cx="12" cy="12" r="1.4" fill="currentColor"/>
  </svg>
  logi 로 로그인
</a>

디자인 토큰 override 예시

RP 의 디자인 시스템에 맞추기:

css
/* Tailwind 프로젝트 */
:root {
  --logi-button-bg:     theme('colors.indigo.600');
  --logi-button-fg:     theme('colors.white');
  --logi-button-radius: theme('borderRadius.md');
}

/* shadcn/ui */
:root {
  --logi-button-bg:     hsl(var(--primary));
  --logi-button-fg:     hsl(var(--primary-foreground));
  --logi-button-radius: var(--radius);
}

/* Bootstrap */
:root {
  --logi-button-bg:     var(--bs-primary);
  --logi-button-fg:     #fff;
  --logi-button-radius: var(--bs-border-radius);
}

프레임워크 인라인 (참고용)

React / JSX

jsx
function LogiButton({ size = "2x1", theme = "dark", href = "/auth/1pass/initiate" }) {
  return (
    <a href={href} className={`logi-btn logi-btn--${size} ${theme === "light" ? "logi-btn--light" : ""}`}
       aria-label="logi 로 로그인">
      <svg className="logi-btn__logo" viewBox="0 0 24 24" fill="none" stroke="currentColor"
           strokeWidth="1.8" aria-hidden="true">
        <circle cx="12" cy="12" r="9"/>
        <circle cx="12" cy="12" r="4.5"/>
        <circle cx="12" cy="12" r="1.4" fill="currentColor"/>
      </svg>
      {size !== "1x1" && "logi 로 로그인"}
    </a>
  );
}

Svelte

svelte
<script>
  let { size = "2x1", theme = "dark", href = "/auth/1pass/initiate" } = $props();
</script>

<a {href} class="logi-btn logi-btn--{size} {theme === 'light' ? 'logi-btn--light' : ''}"
   aria-label="logi 로 로그인">
  <svg class="logi-btn__logo" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
    <circle cx="12" cy="12" r="9"/>
    <circle cx="12" cy="12" r="4.5"/>
    <circle cx="12" cy="12" r="1.4" fill="currentColor"/>
  </svg>
  {#if size !== "1x1"}logi 로 로그인{/if}
</a>

Flutter (logi_button.dart)

별도 SDK 패키지로 분리 예정. 그 사이엔 flutter_web_auth_2 + IconButton/ElevatedButton 으로 위 사이즈 매트릭스를 직접 구성하세요. 색상은 Theme.of(context).colorScheme.primary 를 따르도록.

브랜드 가이드

항목규칙
텍스트한국어: "logi 로 로그인" / 영문: "Sign in with logi" / 일본어: "logi でログイン"
로고동심원 3개 (semantic: 내·외층 + 중심점) — 변형 / 회전 / 색 분해 ❌
최소 사이즈32×32px (이보다 작으면 로고 식별 어려움)
클리어 영역버튼 둘레 = 로고 1/2 폭 만큼 비워두기
색 대비WCAG AA 4.5:1 이상 (light/dark 토큰 그대로 쓰면 충족)

다음 (예정)

  • NPM 패키지 @logi-auth/button-react / @logi-auth/button-vue / @logi-auth/button-svelte — 채택 데이터 보고 Phase 2
  • CDN CSS https://api.1pass.dev/buttons.css<link rel="stylesheet"> 한 줄 통합
  • Figma library — 디자이너 협업용

이슈/요청: GitHub

MIT License · Identity가 제품의 신뢰를 만듭니다.