# HTMX App Templates Templates for generating web applications with `CREATE SITE`. All apps use HTMX for server communication and are automatically bound to the botserver API. --- ## Overview These templates serve as reference patterns for the LLM when generating new applications. Each template demonstrates: - HTMX data binding patterns - CSS theming with light/dark mode support - Responsive layouts - Loading states and error handling - Modal dialogs and forms --- ## Available Templates ### `/crud` Generic CRUD (Create, Read, Update, Delete) interface. **Files:** - `layout.html` - Full page layout with table, search, filters - `data-row.html` - Table row template for each record - `form-modal.html` - Add/edit modal dialog **Usage:** ```basic CREATE SITE "contacts", "bottemplates/apps/crud", " Contact management with: - Name, email, phone, company fields - Status filter (active, inactive) - Search by name or email - Inline edit and delete " ``` ### `/dashboard` Analytics dashboard with KPI cards and charts. **Files:** - `layout.html` - Dashboard layout with header, KPIs, charts - `kpi-card.html` - Metric card component - `chart-container.html` - Chart.js wrapper - `activity-row.html` - Recent activity table row **Usage:** ```basic CREATE SITE "metrics", "bottemplates/apps/dashboard", " Sales dashboard showing: - Revenue, customers, orders, growth KPIs - Monthly revenue chart - Sales by category pie chart - Recent orders table " ``` ### `/kanban` Board-style project management interface. **Files:** - `layout.html` - Kanban board layout - `column.html` - Status column template - `card.html` - Task card template - `card-modal.html` - Card detail modal **Usage:** ```basic CREATE SITE "projects", "bottemplates/apps/kanban", " Project board with columns: - Backlog, In Progress, Review, Done - Drag and drop cards - Assignee avatars - Due date indicators " ``` ### `/admin` Admin panel template for back-office operations. **Files:** - `layout.html` - Admin layout with sidebar navigation - `sidebar.html` - Navigation component - `stats-grid.html` - Overview statistics - `crud-table.html` - Data management table **Usage:** ```basic CREATE SITE "admin", "bottemplates/apps/admin", " Admin panel with: - Sidebar navigation (Users, Products, Orders, Settings) - Overview stats on dashboard - User management table - System settings form " ``` ### `/components` Reusable UI components for composition. | Component | File | Description | |-----------|------|-------------| | Data Table | `data-table.html` | Sortable, filterable table | | Form Modal | `form-modal.html` | Modal with form fields | | KPI Card | `kpi-card.html` | Metric display card | | Search | `search-filter.html` | Search input with filters | | Toast | `toast.html` | Notification toast | | Pagination | `pagination.html` | Page navigation | | Empty State | `empty-state.html` | No data placeholder | --- ## HTMX Patterns ### Loading Data ```html