# UI Component Templates This document outlines the standard reusable UI components available in the project. Use these to maintain consistency across the application. --- ## 📦 Section Header with Description Use when you need a section title with an icon and descriptive text. **Responsive:** Stacks vertically on mobile (< 768px) ```html

Gibberish Dictionary

Translate text into random gibberish and corresponding dictionary.

``` --- ## 🎯 Simple Title with Icon Use for inline titles with optional subtitles. **Responsive:** Wraps naturally ```html

Universal Decoder

Prioritizing Base64
``` --- ## 💡 Info Boxes Use for tips, warnings, success messages, or disclaimers. **Variants:** `.info-box-warning`, `.info-box-success`, `.info-box-danger` ```html
Copy this text and share it. The transformation can be reversed.
DISCLAIMER: Use for testing only. Do not deploy to production.
Settings applied successfully!
Danger zone: This will freeze your browser!
``` --- ## 🃏 Card Container Use for grouped content sections. **Responsive:** Full width, proper padding adjustments ```html

Card Title

Your main content goes here...

``` --- ## 🎛️ Button Groups Use for multiple action buttons that should stay together. **Responsive:** Stacks vertically on very small screens (< 400px) ```html
``` --- ## 🔘 Button Variants Standard button classes: - `.btn` - Base button (default gray) - `.btn-primary` - Primary action (blue accent) - `.btn-secondary` - Secondary action (transparent with border) ```html ``` --- ## 📝 Form Inputs All standard HTML inputs are automatically styled and fully responsive. No extra classes needed! **Features:** - ✅ Responsive width (never overflows container) - ✅ Consistent styling across all inputs - ✅ Custom styled select dropdowns - ✅ Proper focus states - ✅ Text overflow handling (ellipsis) ```html ``` **Responsive Behavior:** - Desktop: Standard padding (8px 10px) - Mobile (< 400px): Reduced padding (6px 8px) and smaller font --- ## 🎨 Grid Layouts Use `.options-grid` for form layouts: ```html
``` **Responsive:** Automatically switches to single column on small screens --- ## ✨ Best Practices 1. **Always use these standard components** instead of creating custom styles 2. **Only add overrides when absolutely necessary** - document why 3. **Test responsiveness** at 400px, 768px, and 900px breakpoints 4. **Use semantic HTML** - proper heading levels, labels, etc. 5. **Include icons from Font Awesome** for visual consistency 6. **Add ARIA labels** for accessibility when needed --- ## 🚫 Anti-Patterns (Don't Do This) ❌ Creating inline styles ❌ Duplicating component markup with slight variations ❌ Adding `!important` to override standard styles ❌ Using fixed widths that break responsiveness ❌ Nesting cards more than 2 levels deep ❌ Skipping semantic HTML elements --- ## 📐 Breakpoints - **Mobile:** < 400px - Everything stacks, full width - **Tablet:** 400px - 768px - Moderate stacking - **Desktop:** > 768px - Full layout with sidebars --- ## 🎯 Quick Reference | Component | Class | Responsive | |-----------|-------|------------| | Section Header | `.section-header-card` | Stacks < 768px | | Title + Icon | `.title-with-icon` | Wraps | | Info Box | `.info-box` | Full width | | Card | `.card` | Full width | | Button Group | `.button-group` | Stacks < 400px | | Options Grid | `.options-grid` | Single col < 400px | --- ## 📞 Need a New Component? If you find yourself copying the same markup pattern 3+ times: 1. Document the pattern 2. Add it to `style.css` with clear comments 3. Update this documentation 4. Refactor existing code to use it