A simple converter that transforms LangUI Tailwind components into Shuffle.dev compatible format. This tool demonstrates the critical discovery that all components must be wrapped in a single root element for Shuffle.dev compatibility.
This converter allows you to import the excellent LangUI component library into Shuffle.dev, making 100+ beautifully designed Tailwind components available for your projects.
The Wrapper Solution: Shuffle.dev requires exactly one root element per component. Instead of complex detection logic, we simply wrap EVERY component in a container div. This guarantees 100% compatibility.
<!-- Original component (might have multiple roots) -->
<div class="alert">...</div>
<div class="alert">...</div>
<!-- After wrapping (guaranteed single root) -->
<div class="langui-component-wrapper">
<div class="alert">...</div>
<div class="alert">...</div>
</div>- Python 3.6+
- Git
- No additional Python packages required (uses only standard library)
git clone https://github.com/yourusername/langui-shuffle-converter.git
cd langui-shuffle-converter# Convert all LangUI components
python converter.py
# Convert specific categories
python converter.py --categories buttons cards alerts
# List available categories
python converter.py --list- The converter creates an
output/directory with:shuffle.config.json- Component configurationcomponents/- All wrapped components
- ZIP the contents of the
output/directory - Upload via Shuffle.dev's Custom Components section
langui-shuffle-converter/
├── converter.py # LangUI-specific converter
├── template.py # Generic template for other libraries
├── example_usage.sh # Example bash script
├── README.md # This file
└── WARP.md # Technical documentation for AI agents
Use template.py as a starting point for converting other Tailwind component libraries:
- Copy
template.pyto a new file - Update the configuration section:
LIBRARY_PREFIX = "YourLibrary" GITHUB_URL = "https://github.com/YourOrg/YourRepo.git" COMPONENT_CATEGORIES = { 'buttons': 'path/to/buttons', 'cards': 'path/to/cards', }
- Run your converter
- Upload to Shuffle.dev
- alerts
- badges
- buttons
- cards
- copy
- pricing
- prompt-containers
- prompt-history-panels
- prompt-inputs
- prompt-message-inputs
- prompt-messages
- prompt-suggestions
- prompts-cards
- sidebars
- toggles
Components are named with clear prefixes for easy identification:
- shuffle.config.json: The config file MUST be named exactly this (not
config.json) - Single Root Rule: Every component must have exactly one root element
- Wrapper Strategy: We wrap everything - don't try to detect, just wrap!
- Snapshot Approach: This converter works with the current version of LangUI. For future updates, re-run the converter.
This is a simple, snapshot-in-time converter. Feel free to:
- Fork and adapt for your needs
- Add more sophisticated features
- Create converters for other component libraries
- Share your improvements with the community
MIT License - Feel free to use this code for any purpose.
- LangUI - Beautiful Tailwind components
- Shuffle.dev - Visual site builder
- Created with assistance from AI to solve the single-root-element challenge
"When in doubt, wrap it out!"
This converter follows the principle of simplicity. Rather than complex detection logic that might fail, we guarantee success by wrapping everything. It's a small trade-off for 100% reliability.
Status: ✅ Successfully converts 112 LangUI components across 15 categories
Last Updated: August 2024
