Component
Bottom Sheet
Mobile-first bottom sheet with action grid, quick actions, and recent files list. Features drag handle and touch-friendly design.
- Component
- Tailwind
- HTML
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/modals/bottom-sheet/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Modals/bottom-sheet Tailwind/Components/Modals/bottom-sheet <!-- Bottom Sheet Modal -->
<div id="bottom-sheet" class="fixed inset-0 z-50 hidden">
<!-- Backdrop -->
<div class="fixed inset-0 bg-black/50 backdrop-blur-sm" onclick="closeBottomSheet('bottom-sheet')"></div>
<!-- Sheet -->
<div id="sheet-panel" class="fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-900 rounded-t-3xl shadow-2xl transform transition-transform duration-300 translate-y-0 max-h-[80vh] overflow-hidden">
<!-- Handle -->
<div class="flex justify-center py-3">
<div class="w-10 h-1 bg-gray-300 dark:bg-gray-700 rounded-full"></div>
</div>
<!-- Header -->
<div class="px-6 pb-4 border-b border-gray-100 dark:border-gray-800">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-10 h-10 bg-green-100 dark:bg-green-900/30 rounded-xl flex items-center justify-center">
<svg class="w-5 h-5 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/>
</svg>
</div>
<div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">Quick Actions</h3>
<p class="text-sm text-gray-500 dark:text-gray-400">Productivity tools</p>
</div>
</div>
<button onclick="closeBottomSheet('bottom-sheet')" class="p-2 rounded-lg text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
</div>
<!-- Actions Grid -->
<div class="p-6 overflow-y-auto max-h-[calc(80vh-120px)]">
<div class="grid grid-cols-3 gap-4">
<button class="flex flex-col items-center gap-3 p-4 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-14 h-14 bg-blue-100 dark:bg-blue-900/30 rounded-2xl flex items-center justify-center">
<svg class="w-7 h-7 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
</div>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">New Task</span>
</button>
<button class="flex flex-col items-center gap-3 p-4 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-14 h-14 bg-purple-100 dark:bg-purple-900/30 rounded-2xl flex items-center justify-center">
<svg class="w-7 h-7 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
</div>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">Schedule</span>
</button>
<button class="flex flex-col items-center gap-3 p-4 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-14 h-14 bg-rose-100 dark:bg-rose-900/30 rounded-2xl flex items-center justify-center">
<svg class="w-7 h-7 text-rose-600 dark:text-rose-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"/>
</svg>
</div>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">Call</span>
</button>
<button class="flex flex-col items-center gap-3 p-4 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-14 h-14 bg-green-100 dark:bg-green-900/30 rounded-2xl flex items-center justify-center">
<svg class="w-7 h-7 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
</svg>
</div>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">Message</span>
</button>
<button class="flex flex-col items-center gap-3 p-4 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-14 h-14 bg-amber-100 dark:bg-amber-900/30 rounded-2xl flex items-center justify-center">
<svg class="w-7 h-7 text-amber-600 dark:text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">Document</span>
</button>
<button class="flex flex-col items-center gap-3 p-4 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-14 h-14 bg-cyan-100 dark:bg-cyan-900/30 rounded-2xl flex items-center justify-center">
<svg class="w-7 h-7 text-cyan-600 dark:text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
</div>
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">Meet</span>
</button>
</div>
<!-- Recent Files -->
<div class="mt-6 pt-6 border-t border-gray-100 dark:border-gray-800">
<h4 class="text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-4">Recent</h4>
<div class="space-y-3">
<button class="w-full flex items-center gap-4 p-3 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center">
<svg class="w-5 h-5 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<div class="flex-1 text-left">
<p class="font-medium text-gray-900 dark:text-white">Q4 Marketing Plan</p>
<p class="text-sm text-gray-500 dark:text-gray-400">Modified 2 hours ago</p>
</div>
</button>
<button class="w-full flex items-center gap-4 p-3 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors">
<div class="w-10 h-10 bg-green-100 dark:bg-green-900/30 rounded-lg flex items-center justify-center">
<svg class="w-5 h-5 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<div class="flex-1 text-left">
<p class="font-medium text-gray-900 dark:text-white">Budget Report.xlsx</p>
<p class="text-sm text-gray-500 dark:text-gray-400">Modified yesterday</p>
</div>
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Demo Trigger Button -->
<button onclick="openBottomSheet('bottom-sheet')" class="px-6 py-3 bg-green-600 text-white font-medium rounded-xl hover:bg-green-700 transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2">Open Bottom Sheet</button>
<script>
function openBottomSheet(id) {
document.getElementById(id).classList.remove('hidden');
document.body.style.overflow = 'hidden';
}
function closeBottomSheet(id) {
document.getElementById(id).classList.add('hidden');
document.body.style.overflow = '';
}
</script> # Bottom Sheet
Mobile bottom sheet modal.
## Usage
```bash
npx devsnips add Tailwind/Components/Modals/bottom-sheet
```
Copy from `code.html`. Use dialog semantics when interactive.
## File Structure
`code.html` · `preview.html` · `metadata.json` · `README.md` 139 lines UTF-8 · LF · Spaces: 2
Continue browsing