Generate inline chat cards using DaisyUI components for user interactions. Use when creating interactive UI elements within a chat interface that require user input, confirmation, or selection...
This skill provides patterns and guidance for generating HTML cards using DaisyUI components that display inline within chat applications.
Generate interactive, visually consistent chat cards for common user interaction patterns including confirmations, selections, and content previews. Cards are optimized for inline display in chat interfaces with compact sizing and clear action flows.
Use this skill when:
For binary decisions or confirmations. Include a title, question text, and two action buttons (negative and affirmative).
For single-selection from multiple options. Include a title, optional description, radio button list, and confirmation button.
For multi-selection from a list. Include a title, optional description, checkbox list, and action button.
For displaying drafted content with revision options. Include a title, content preview area, feedback textarea, and action buttons.
btn-xs for buttons, text-xs for body text, text-sm for titlesflex justify-centermax-w-sm for readabilityshadow-md to all cards for visual separationp-4 for card body paddingbg-base-200 or bg-base-100 with border border-base-300btn-primarybtn-errorbtn-ghostbg-base-200 with roundedcard-actions justify-end to right-align buttonsgap-2 for spacing between buttonsradio radio-xs classcheckbox checkbox-xs classtextarea textarea-bordered textarea-smcursor-pointer on labels for better UXspace-y-1 for vertical spacing in listsEach card should follow this structure:
<div class="flex justify-center"><div class="card bg-base-200 w-full max-w-sm shadow-md"><div class="card-body p-4"><h2 class="card-title text-sm"><div class="card-actions justify-end [mt-2/mt-3] gap-2">For complete examples and detailed pattern documentation, refer to references/card-patterns.md which includes:
Adapt card patterns based on context:
Generate complete, self-contained HTML snippets that can be directly inserted into a chat application. Ensure all necessary DaisyUI classes are included and properly structured.
ā ļø Cards will NOT work if you deviate from these exact patterns ā ļø
Every card MUST follow this exact structure:
<div class="flex justify-center"> ā Outer wrapper
<div class="card bg-base-200 w-full max-w-sm shadow-md" ā MUST have class "card"
data-card-type="[type]"> ā MUST have data-card-type
<div class="card-body p-4"> ā Card content wrapper
<!-- Content goes here -->
</div>
</div>
</div>
The second <div> MUST have the card class - this is not optional. The JavaScript selector looks for .card[data-card-id].
ALL interactive cards MUST include these data attributes:
1. Card Element (the div with class "card"):
data-card-type="[type]" - REQUIRED2. Form Element (for multiple-choice, multiple-select, content-preview):
data-card-form - REQUIRED wrapper for form-based cards<form data-card-form>...</form>3. Buttons:
data-card-action="[action]" - REQUIRED on EVERY button<button class="btn btn-primary btn-xs" data-card-action="submit">Confirm</button>4. Form Inputs:
name attribute - REQUIRED for all inputs (radio, checkbox, textarea)value attribute - REQUIRED for radio buttons and checkboxes<input type="radio" name="choice" value="option1" class="radio radio-xs" /><div class="card-container"> instead of <div class="card">data-card-type attributedata-card-action on buttonsdata-card-form on formsALWAYS copy the exact HTML from references/card-patterns.md. Do not improvise. Do not create variations. The patterns are tested and guaranteed to work.