Common use cases
Conditional Class Generation
const transformHook = (rw) => {
const {
size,
variant,
isRounded,
hasShadow,
customClasses
} = rw.props;
const classes = [
// Size classes
size,
// Variant styles
variant === 'primary' && 'bg-blue-500 text-white',
variant === 'secondary' && 'bg-gray-200 text-gray-800',
// Optional modifiers
isRounded && 'rounded-lg',
hasShadow && 'shadow-md',
// User's custom classes
customClasses
]
.filter(Boolean)
.join(' ');
rw.setProps({ classes });
};
exports.transformHook = transformHook;Edit vs Preview Mode Branching
Responsive Image Handling
Root Element Configuration
Collection Data Transformation
Filter Tags for Filtering
Alpine.js Integration
Last updated
Was this helpful?

