Claude-skill-registry chat-card-skill
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. Supports affirmative/negative responses, multiple choice (radio), multiple select (checkbox), and content preview with feedback patterns.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/chat-card-skill" ~/.claude/skills/majiayu000-claude-skill-registry-chat-card-skill && rm -rf "$T"
skills/data/chat-card-skill/SKILL.mdChat Card Skill
This skill provides patterns and guidance for generating HTML cards using DaisyUI components that display inline within chat applications.
Purpose
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.
When to Use This Skill
Use this skill when:
- Creating confirmation dialogs or yes/no prompts within chat
- Presenting multiple choice questions to users
- Allowing users to select multiple options from a list
- Displaying drafted content (emails, messages, documents) for review and feedback
- Any scenario requiring interactive UI elements inline with chat messages
Card Pattern Types
1. Affirmative/Negative Response Cards
For binary decisions or confirmations. Include a title, question text, and two action buttons (negative and affirmative).
2. Multiple Choice (Radio) Cards
For single-selection from multiple options. Include a title, optional description, radio button list, and confirmation button.
3. Multiple Select (Checkbox) Cards
For multi-selection from a list. Include a title, optional description, checkbox list, and action button.
4. Content Preview with Feedback Cards
For displaying drafted content with revision options. Include a title, content preview area, feedback textarea, and action buttons.
Implementation Guidelines
Sizing and Layout
- Use compact sizing throughout:
for buttons,btn-xs
for body text,text-xs
for titlestext-sm - Center cards with
flex justify-center - Set maximum width to
for readabilitymax-w-sm - Apply
to all cards for visual separationshadow-md - Use
for card body paddingp-4
Color Scheme
- Card backgrounds:
orbg-base-200
withbg-base-100border border-base-300 - Primary actions:
btn-primary - Destructive/negative actions:
btn-error - Secondary actions:
btn-ghost - Content preview areas:
withbg-base-200rounded
Action Button Placement
- Use
to right-align buttonscard-actions justify-end - Place primary action on the right
- Place secondary/destructive actions on the left
- Use
for spacing between buttonsgap-2
Form Elements
- Radio buttons:
classradio radio-xs - Checkboxes:
classcheckbox checkbox-xs - Text areas:
textarea textarea-bordered textarea-sm - Use
on labels for better UXcursor-pointer - Use
for vertical spacing in listsspace-y-1
Content Structure
Each card should follow this structure:
- Outer container:
<div class="flex justify-center"> - Card wrapper:
<div class="card bg-base-200 w-full max-w-sm shadow-md"> - Card body:
<div class="card-body p-4"> - Title:
<h2 class="card-title text-sm"> - Content area (text, form elements, preview)
- Actions:
<div class="card-actions justify-end [mt-2/mt-3] gap-2">
Detailed Reference
For complete examples and detailed pattern documentation, refer to
references/card-patterns.md which includes:
- Full HTML examples for each card type
- DaisyUI component reference
- Best practices and accessibility guidelines
- Visual hierarchy and spacing recommendations
Customization
Adapt card patterns based on context:
- Adjust button text to match specific actions
- Modify option lists based on user needs
- Customize preview content structure for different content types
- Add or remove form elements as needed while maintaining visual consistency
Output Format
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.
CRITICAL: Required Structure and Data Attributes
⚠️ Cards will NOT work if you deviate from these exact patterns ⚠️
Required HTML Structure
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
MUST have the <div>
class - this is not optional. The JavaScript selector looks for card
.card[data-card-id].
Required Data Attributes
ALL interactive cards MUST include these data attributes:
1. Card Element (the div with class "card"):
- REQUIREDdata-card-type="[type]"- Values: "affirmative-negative", "multiple-choice", "multiple-select", or "content-preview"
2. Form Element (for multiple-choice, multiple-select, content-preview):
- REQUIRED wrapper for form-based cardsdata-card-form- Must be:
<form data-card-form>...</form>
3. Buttons:
- REQUIRED on EVERY buttondata-card-action="[action]"- Values: "yes", "no", "submit", "skip", "send", "revise", etc.
- Example:
<button class="btn btn-primary btn-xs" data-card-action="submit">Confirm</button>
4. Form Inputs:
attribute - REQUIRED for all inputs (radio, checkbox, textarea)name
attribute - REQUIRED for radio buttons and checkboxesvalue- Example:
<input type="radio" name="choice" value="option1" class="radio radio-xs" />
⛔ Common Mistakes That Break Interactivity
- ❌ Using
instead of<div class="card-container"><div class="card"> - ❌ Forgetting
attributedata-card-type - ❌ Forgetting
on buttonsdata-card-action - ❌ Forgetting
on formsdata-card-form - ❌ Creating custom HTML structures instead of copying the exact patterns
✅ The Solution
ALWAYS copy the exact HTML from
. Do not improvise. Do not create variations. The patterns are tested and guaranteed to work.references/card-patterns.md