Component
File Card
File browser card with file type icon, metadata, sharing info, and action buttons on hover.
- Component
- Tailwind
- HTML
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/cards/file-card/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Cards/file-card Tailwind/Components/Cards/file-card <div class="group bg-white rounded-xl border border-gray-100 shadow-sm hover:shadow-md hover:border-gray-200 transition-all p-4">
<div class="flex items-center gap-4">
<div class="w-12 h-12 bg-blue-100 rounded-xl flex items-center justify-center group-hover:scale-110 transition-transform">
<svg class="w-6 h-6 text-blue-600" 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 min-w-0">
<h4 class="font-medium text-gray-900 truncate group-hover:text-blue-600 transition-colors">Q4_Financial_Report.pdf</h4>
<div class="flex items-center gap-3 text-xs text-gray-500 mt-0.5">
<span>PDF</span>
<span>•</span>
<span>2.4 MB</span>
<span>•</span>
<span>Modified 2 days ago</span>
</div>
</div>
<div class="flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity">
<button class="p-2 hover:bg-gray-100 rounded-lg text-gray-400 hover:text-gray-600 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="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
</svg>
</button>
<button class="p-2 hover:bg-gray-100 rounded-lg text-gray-400 hover:text-gray-600 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="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"/>
</svg>
</button>
</div>
</div>
<div class="mt-3 pt-3 border-t border-gray-50 flex items-center gap-4">
<img src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=64&h=64&fit=crop&crop=faces" alt="Shared by" class="w-6 h-6 rounded-full object-cover">
<span class="text-xs text-gray-500">Shared by Sarah Mitchell</span>
<div class="flex-1"></div>
<div class="flex -space-x-2">
<img src="https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=64&h=64&fit=crop&crop=faces" class="w-6 h-6 rounded-full border-2 border-white" alt="">
<img src="https://images.unsplash.com/photo-1517841905240-472988babdf9?w=64&h=64&fit=crop&crop=faces" class="w-6 h-6 rounded-full border-2 border-white" alt="">
<div class="w-6 h-6 rounded-full border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600">+3</div>
</div>
</div>
</div> # File Card
File / document card with type icon and meta.
## Preview
Open `preview.html` for a standalone demonstration.
## Features
- File type indicator
- Name and meta row
## Usage
```bash
npx devsnips add Tailwind/Components/Cards/file-card
```
Copy from `code.html`.
## Customization
- Icon colors, typography, actions
## Accessibility
- File name should be readable text
## Dependencies
- Tailwind CSS only
## File Structure
- `code.html` · `preview.html` · `metadata.json` · `README.md` 44 lines UTF-8 · LF · Spaces: 2
Continue browsing