Hey guys, Plasmic is complaining I’m not using the provided CSS classes but I can’t find documentation about them
can you paste the errors that you see?
Hi Saulo!
Plasmic uses className
prop by default to style instances of code components. It contains a string containing the CSS classes for the component to use - in general you would want to forward this prop to the HTML element that renders the component.
For example, if HambugerMenu
renders a div
with the menu contents, it should work to do something like:
function HambugerMenu({className, ...otherProps}: HambugerMenuProps) {
// Component logic...
return <div className={className}>
{/* ... */}
</div>
}
(also possible to use a prop with a different name via classNameProp
in the component registration: https://docs.plasmic.app/learn/code-components-ref/ )
got it, thanks!