className and style. This page covers how to customize their appearance, use responsive variants, enable dark mode, and work with color styles and localization.className with !important or the style prop which has higher CSS specificity:1234567891011121314import './framer/styles.css' import Hero from './framer/hero' export default function App() { return ( <div> {/* className with !important */} <Hero className="!w-full !h-auto" /> {/* style prop (higher specificity, no !important needed) */} <Hero style={{ width: '100%', height: 'auto' }} /> </div> ) }
!important is needed because Framer's generated classes have specific dimensions. The style prop is a cleaner alternative since it has higher specificity than class-based styles..Responsive sub-component. It switches variants based on CSS media queries:1234567891011121314import './framer/styles.css' import Logos from './framer/logos' export default function App() { return ( <Logos.Responsive variants={{ lg: 'Desktop', md: 'Tablet', base: 'Mobile', }} /> ) }
variants if you want to override the defaults..Responsive renders all variants and uses CSS display: none to show only the active one. Before hydration, unused variants are removed via React's useSyncExternalStore for better performance.dark CSS class. Add it to any parent element and all color style variables automatically switch to their dark values:12345678910import './framer/styles.css' import Hero from './framer/hero' export default function App() { return ( <div className="dark"> <Hero /> </div> ) }
dark class on <html> or <body>, Framer components will follow automatically.--unframer-. These are defined in styles.css:1234567891011:root { --unframer-primary: rgb(231, 34, 8); --unframer-white: rgb(255, 255, 255); --unframer-off-black: rgb(16, 16, 16); } .dark { --unframer-primary: rgb(231, 34, 8); --unframer-white: rgb(16, 16, 16); --unframer-off-black: rgb(255, 255, 255); }
123<div className="bg-(--unframer-primary) text-(--unframer-white)"> Styled with Framer color tokens </div>
locale prop to render component text in a specific language:12345import Hero from './framer/hero' <Hero locale="de" /> <Hero locale="it-IT" /> <Hero locale="ja" />
UnframerProvider:123456789import { UnframerProvider } from 'unframer' export function Providers({ children }: { children: React.ReactNode }) { return ( <UnframerProvider locale="de"> {children} </UnframerProvider> ) }
navigate function to use client-side routing instead:123456789101112import { useRouter } from 'next/navigation' import { UnframerProvider } from 'unframer' export function Providers({ children }: { children: React.ReactNode }) { const router = useRouter() return ( <UnframerProvider navigate={router.push}> {children} </UnframerProvider> ) }
useNavigate() instead of useRouter(). The API is the same: pass the navigate function to UnframerProvider.