creating-styled-wrappers
Installation
SKILL.md
Styling Compound Wrappers
Create styled wrapper components that compose headless base compound components. This skill complements building-compound-components (which builds the base primitives) by focusing on how to properly consume and wrap them with styling and additional behavior.
Real-world example: See references/real-world-example.md for a complete before/after MessageInput refactoring.
Core Principle: Compose, Don't Duplicate
Styled wrappers should compose base components, not re-implement their logic.
// WRONG - re-implementing what base already does
const StyledInput = ({ children, className }) => {
const { value, setValue, submit } = useTamboThreadInput(); // Duplicated!
const [isDragging, setIsDragging] = useState(false); // Duplicated!
const handleDrop = useCallback(/* ... */); // Duplicated!