기본 팝오버 API를 사용하는 CSS 전용 Tailwind CSS 팝오버입니다. 도구 설명 및 드롭다운을 위한 부동 콘텐츠 패널입니다. WCAG AA 액세스 가능하며 Django, HTMX, Laravel, React 및 모든 스택에서 작동합니다.
팝오버 구성 요소는 영구적인 화면 공간을 차지하지 않고 트리거 요소 옆에 상황별 콘텐츠를 표시합니다. 기본 HTML Popover API를 기반으로 구축된 Frutjam 팝오버 시스템은 클릭 및 호버 트리거, 사용자 정의 가능한 위치 지정 및 부드러운 애니메이션을 지원합니다. 페이지 탐색이 없는 드롭다운 메뉴, 상황에 맞는 메뉴, 사용자 프로필 메뉴 및 추가 옵션에 적합합니다.
CSS만 가능하며 JavaScript는 필요하지 않습니다. 순수 HTML 및 Tailwind CSS를 사용하여 액세스 가능한 드롭다운 메뉴와 상황별 오버레이를 구축하세요. WCAG AA 액세스 가능 및 프레임워크에 구애받지 않음 — Django, HTMX, Laravel, React 및 모든 스택에서 작동합니다.
| 수업 | 유형 | 설명 |
|---|---|---|
| popover | 베이스 | 트리거와 콘텐츠를 함께 고정하는 래퍼 |
| popover-content | 수정자 | 팝오버가 열릴 때 표시되는 부동 패널 |
| popover-toggle | 수정자 | 팝오버를 열거나 닫는 트리거 요소 |
| popover-hover | 수정자 | 클릭하는 대신 마우스를 올리면 열립니다. |
| popover-top-start | 수정자 | 위에 위치, 시작 부분에 정렬 |
| popover-top-center | 수정자 | 위쪽에 위치, 중앙에 위치 |
| popover-top-end | 수정자 | 위에 위치, 끝 부분에 정렬 |
| popover-bottom-start | 수정자 | 아래 위치, 시작점에 맞춰 정렬 |
| popover-bottom-center | 수정자 | 아래에 위치, 중앙에 위치 |
| popover-bottom-end | 수정자 | 아래 위치, 끝 부분에 정렬 |
| popover-start-top | 수정자 | 왼쪽에 위치, 위쪽에 정렬 |
| popover-start-center | 수정자 | 왼쪽에 위치, 수직 중앙에 위치 |
| popover-start-bottom | 수정자 | 왼쪽에 위치, 아래쪽에 정렬 |
| popover-end-top | 수정자 | 오른쪽에 위치, 위쪽에 정렬 |
| popover-end-center | 수정자 | 오른쪽에 위치, 수직 중앙에 위치 |
| popover-end-bottom | 수정자 | 오른쪽에 위치, 아래쪽에 정렬 |
기본 사용법
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover"> <button popovertarget="defaultClickPopover" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="defaultClickPopover"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div className="popover"> <button popovertarget="defaultClickPopover" type="button" className="popover-toggle btn">Click here</button> <div tabIndex="0" className="popover-content" popover id="defaultClickPopover"> <ul className="menu"> <li> <a className="menu-item">About Us</a> </li> <li> <a className="menu-item">Contact Us</a> </li> <li> <a className="menu-item">Career</a> </li> <li> <a className="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
드롭다운 메뉴
Popover 구성 요소를 사용하여 드롭다운 메뉴(탐색 드롭다운, 사용자 프로필 메뉴, 작업 메뉴)를 모두 CSS로만 구성하고 JavaScript는 필요하지 않습니다.
탐색바 드롭다운
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <div class="popover"> <button popovertarget="navDropdown" type="button" class="popover-toggle btn btn-ghost"> Products <svg xmlns="http://www.w3.org/2000/svg" class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /></svg> </button> <div tabindex="0" class="popover-content" popover id="navDropdown"> <ul class="menu"> <li><a class="menu-item">Components</a></li> <li><a class="menu-item">Blocks</a></li> <li><a class="menu-item">Templates</a></li> <li><a class="menu-item">Plugins</a></li> </ul> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <div className="popover"> <button popovertarget="navDropdown" type="button" className="popover-toggle btn btn-ghost"> Products <svg xmlns="http://www.w3.org/2000/svg" className="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 9l-7 7-7-7" /></svg> </button> <div tabIndex="0" className="popover-content" popover id="navDropdown"> <ul className="menu"> <li><a className="menu-item">Components</a></li> <li><a className="menu-item">Blocks</a></li> <li><a className="menu-item">Templates</a></li> <li><a className="menu-item">Plugins</a></li> </ul> </div> </div> |
사용자 프로필 드롭다운
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <div class="popover popover-bottom-end"> <button popovertarget="profileDropdown" type="button" class="popover-toggle btn btn-ghost p-0"> <div class="avatar avatar-primary avatar-sm">JD</div> </button> <div tabindex="0" class="popover-content" popover id="profileDropdown"> <ul class="menu"> <li class="menu-title">John Doe</li> <li><a class="menu-item">Profile</a></li> <li><a class="menu-item">Settings</a></li> <li><a class="menu-item">Billing</a></li> <li><div class="divider my-0"></div></li> <li><a class="menu-item text-error">Sign out</a></li> </ul> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <div className="popover popover-bottom-end"> <button popovertarget="profileDropdown" type="button" className="popover-toggle btn btn-ghost p-0"> <div className="avatar avatar-primary avatar-sm">JD</div> </button> <div tabIndex="0" className="popover-content" popover id="profileDropdown"> <ul className="menu"> <li className="menu-title">John Doe</li> <li><a className="menu-item">Profile</a></li> <li><a className="menu-item">Settings</a></li> <li><a className="menu-item">Billing</a></li> <li><div className="divider my-0"></div></li> <li><a className="menu-item text-error">Sign out</a></li> </ul> </div> </div> |
아이콘이 있는 드롭다운
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <div class="popover"> <button popovertarget="iconDropdown" type="button" class="popover-toggle btn"> Actions <svg xmlns="http://www.w3.org/2000/svg" class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /></svg> </button> <div tabindex="0" class="popover-content" popover id="iconDropdown"> <ul class="menu"> <li> <a class="menu-item"> <svg xmlns="http://www.w3.org/2000/svg" class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg> Edit </a> </li> <li> <a class="menu-item"> <svg xmlns="http://www.w3.org/2000/svg" class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg> Duplicate </a> </li> <li><div class="divider my-0"></div></li> <li> <a class="menu-item text-error"> <svg xmlns="http://www.w3.org/2000/svg" class="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg> Delete </a> </li> </ul> </div> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <div className="popover"> <button popovertarget="iconDropdown" type="button" className="popover-toggle btn"> Actions <svg xmlns="http://www.w3.org/2000/svg" className="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 9l-7 7-7-7" /></svg> </button> <div tabIndex="0" className="popover-content" popover id="iconDropdown"> <ul className="menu"> <li> <a className="menu-item"> <svg xmlns="http://www.w3.org/2000/svg" className="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg> Edit </a> </li> <li> <a className="menu-item"> <svg xmlns="http://www.w3.org/2000/svg" className="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg> Duplicate </a> </li> <li><div className="divider my-0"></div></li> <li> <a className="menu-item text-error"> <svg xmlns="http://www.w3.org/2000/svg" className="size-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg> Delete </a> </li> </ul> </div> </div> |
팝오버 상호 작용 동작
기본적으로 클릭 상호 작용은 팝오버 구성 요소를 열고 닫는 데 사용됩니다. 예를 들어 메가메뉴의 경우 popover-hover 클래스를 추가하고 popovertarget 및 popover 속성을 제거하여 마우스 오버 기반 상호 작용을 활성화할 수 있습니다. 이를 통해 기본 클릭 동작이 아닌 호버 로직을 통해 팝오버를 완전히 제어할 수 있습니다.
네이티브 클릭 트리거
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover"> <button popovertarget="nativeClickTrigger" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="nativeClickTrigger"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
호버 상호 작용 논리
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-hover"> <button type="button" class="popover-toggle btn">Hover me</button> <div class="popover-content"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
팝오버 위치 지정 옵션(상단, 하단, 시작, 끝)
유연한 배치 로직을 사용하여 트리거 요소를 기준으로 팝오버의 위치를 지정하세요. 팝오버 배치는 수직(상단, 중앙, 하단) 및 수평(시작, 중앙, 끝) 정렬 옵션을 결합하여 생성됩니다.
상단 시작 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-top-start"> <button popovertarget="popoverTopStart" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverTopStart"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
상단 중앙 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-top-center"> <button popovertarget="popoverTopCenter" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverTopCenter"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
최상위 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-top-end"> <button popovertarget="popoverTopEnd" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverTopEnd"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
엔드-탑 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-end-top"> <button popovertarget="popoverEndTop" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverEndTop"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
엔드 센터 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-end-center"> <button popovertarget="popoverEndCenter" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverEndCenter"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
끝-하단 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-end-bottom"> <button popovertarget="popoverEndBottom" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverEndBottom"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
하단 시작 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-bottom-start"> <button popovertarget="popoverBottomStart" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverBottomStart"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
하단 중앙 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-bottom-center"> <button popovertarget="popoverBottomCenter" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverBottomCenter"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
하단 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-bottom-end"> <button popovertarget="popoverBottomEnd" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverBottomEnd"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
시작-상단 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-start-top"> <button popovertarget="popoverStartTop" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverStartTop"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
시작 센터 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-start-center"> <button popovertarget="popoverStartCenter" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverStartCenter"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
시작-하단 팝오버 위치
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <div class="popover popover-start-bottom"> <button popovertarget="popoverStartBottom" type="button" class="popover-toggle btn">Click here</button> <div tabindex="0" class="popover-content" popover id="popoverStartBottom"> <ul class="menu"> <li> <a class="menu-item">About Us</a> </li> <li> <a class="menu-item">Contact Us</a> </li> <li> <a class="menu-item">Career</a> </li> <li> <a class="menu-item">Terms and conditions</a> </li> </ul> </div> </div> |
데이터 테이블 내부에서 팝오버 사용(작업 메뉴 및 확인)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | <div class="overflow-x-auto w-full"> <table class="table"> <!-- head --> <thead> <tr> <th> <label> <input type="checkbox" class="checkbox"> </label> </th> <th>Project</th> <th>Category</th> <th>Primary Tech</th> <th></th> </tr> </thead> <tbody> <tr> <th> <label> <input type="checkbox" class="checkbox"> </label> </th> <td> <div> <div class="font-bold">E-commerce Dashboard</div> <div class="text-sm opacity-50">Internal Tool</div> </div> </td> <td> Full Stack <span class="badge badge-soft badge-sm">Admin Panel</span> </td> <td>Next.js</td> <th> <div class="popover popover-bottom-start"> <button popovertarget="popoverOnTable" type="button" class="popover-toggle btn btn-xs btn-error">Delete</button> <div tabindex="0" class="popover-content" popover id="popoverOnTable"> <ul class="menu menu-horizontal"> <li class="menu-title">Are you sure? delete this record!</li> <li> <button class="btn btn-xs">No</button> </li> <li> <button class="btn btn-xs btn-error">Delete</button> </li> </ul> </div> </div> </th> </tr> <tr> <th> <label> <input type="checkbox" class="checkbox"> </label> </th> <td> <div> <div class="font-bold">CI Pipeline</div> <div class="text-sm opacity-50">Infrastructure</div> </div> </td> <td> DevOps <span class="badge badge-soft badge-sm">Automation</span> </td> <td>GitHub Actions</td> <th> <div class="popover popover-bottom-start"> <button popovertarget="popoverOnTable2" type="button" class="popover-toggle btn btn-xs btn-error">Delete</button> <div tabindex="0" class="popover-content" popover id="popoverOnTable2"> <ul class="menu menu-horizontal"> <li> <button class="menu-item btn btn-xs">No</button> </li> <li> <button class="menu-item btn btn-xs btn-error">Delete</button> </li> </ul> </div> </div> </th> </tr> </tbody> <!-- foot --> <tfoot> <tr> <th></th> <th>Project</th> <th>Category</th> <th>Primary Tech</th> <th></th> </tr> </tfoot> </table> </div> |
Claude Code, Cursor 또는 다른 AI 편집기를 사용하시나요?
Cherry MCP는 AI 편집기에 요청 시 정확한 팝오버 클래스 이름과 구조를 제공합니다. 더 이상 환각에 빠진 수업은 없습니다.