Getting started
Fonts
Add the font you picked in the customizer to your own project.
What you get, and what you don't
In a component's Customize panel, the Font field lists every Google Fonts family. The preview on our site loads the font you pick, so you see it straight away.
When you install the component (with npx motionuikit@latest add or Copy code), you get its code with the font's
name in it. For a component with a Font field, that looks like this (YourComponent stands for its name):
<YourComponent font={{ fontFamily: 'Poppins', fontWeight: 600, fontSize: 20 }} />You don't get the font itself. Your project has to load it. Until it does, the component shows a system sans-serif font instead.
Option 1: a Google Fonts link (any project)
Add one <link> for the family. Replace Poppins with your font; for a name with spaces, use + (Roboto+Slab).
Next.js (App Router) — in app/layout.tsx:
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang='en'>
<head>
<link rel='preconnect' href='https://fonts.googleapis.com' />
<link rel='preconnect' href='https://fonts.gstatic.com' crossOrigin='' />
<link
rel='stylesheet'
href='https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900&display=swap'
/>
</head>
<body>{children}</body>
</html>
)
}React with Vite, or plain HTML — the same three <link> tags go in the <head> of index.html.
The font keeps its real name (Poppins), so the component finds it with nothing else to change.
Option 2: next/font (Next.js)
next/font downloads the font at build time and serves it from your own site. It also gives the font a new internal
name, so pass that name to the component instead of the plain one:
import { Poppins } from 'next/font/google'
const poppins = Poppins({ subsets: ['latin'], weight: ['400', '600', '700'] })
export default function Page() {
return <YourComponent font={{ fontFamily: poppins.style.fontFamily, fontWeight: 600, fontSize: 20 }} />
}List every weight you use: a font that isn't variable only has the weights you ask for. Inter, Roboto and many others
are variable, and need no weight at all.
Checking it works
Open your page, inspect the component's text in the browser's developer tools, and look at Computed › Rendered Fonts. It should name your font, not a system font such as Arial, Helvetica or San Francisco.