Skip to content

[feat] Toast 컴포넌트 구현 #81

@mgYang53

Description

@mgYang53

📄 설명

Figma 디자인 스펙에 맞는 커스텀 Toast 컴포넌트를 shadcn/ui의 Sonner 기반으로 구현합니다.

현재 프로젝트에 토스트 알림 시스템이 없어 사용자 액션 결과를 피드백할 수단이 부족한 상태입니다.
Default / Error 두 가지 타입의 토스트를 아래 디자인 스펙에 맞게 구현합니다.

디자인 스펙:

속성 Default Toast Error Toast
bg color primary-200 50% 투명도 accent-200 50% 투명도
text color grey-900 (#1f2423) accent-300 (#e80d0d)
typography subtitle5 (15px, medium) subtitle5 (15px, medium)
노출 시간 3초 4초
icon 없음 없음

공통 레이아웃:

  • padding: horizontal 16px, vertical 8px
  • border-radius: 12px
  • position: bottom-center
  • bottom offset: 기본 48px
  • max-width: 360px
  • stack spacing: 12px
  • max visible: 3개

✅ 해야 할 일

  • pnpm dlx shadcn@latest add sonner로 sonner 컴포넌트 설치
  • src/shared/ui/Sonner.tsx — 자동 생성된 Toaster 래퍼를 디자인 스펙에 맞게 커스터마이징
  • src/shared/lib/toast.tsshowToast, showErrorToast 유틸 함수 생성
  • src/shared/ui/index.ts — Sonner export 추가
  • src/App.tsx — Toaster 컴포넌트 등록
  • 동작 확인 (Default/Error 스타일, 위치, 노출 시간, 최대 표시 개수)

📝 메모

사용 예시:

import { showToast, showErrorToast } from '@/shared/lib/toast'

showToast('모임이 생성되었습니다.')
showErrorToast('저장에 실패했습니다. 잠시 후 다시 시도해주세요.')

Metadata

Metadata

Assignees

Labels

feat새로운 기능 추가

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions