How to add a custom class to an element
How to manually modify an element’s class attribute in Framer by creating an override.
Steps to add a custom class
Create an override:
Use an override to modify the
className
property of an element. This method adds a custom class to the element.Write the code:
Below is an example override that appends the class “test” to an element’s existing
className
. Ensure you include a space before “test” so it’s properly separated.
Publish and inspect:
Publish your project in Framer.
Open the web inspector in your browser.
Verify that the element now includes the added class, as shown below:
Important notes
This approach is ideal for minor adjustments.
Keep in mind that delving too deeply into manual modifications may limit the support Framer can provide.