Skip to content
Sign inJoin waitlist

Design — KorDent Next.js

The look of this Next.js template comes from a small set of tokens: change one and nearly every page, component and state follows.

So you rarely need to touch a component. This guide covers the colours, the logo, the fonts, the text styles, the spacing, the motion, the components and the icons.

Run npm run dev and open http://localhost:3000/style-guide. It shows the colours, the text styles, the buttons and links, the logo, the icons and chips, the cards (service, post, review, outcome, dentist), the patterns (accordions, tabs, the filter, rich text with a table) and the forms with their states, each with its name. When you want to know what a change will affect, look there.

The style guide page: the colours and text styles, then every component with its name

src/design-system/theme.css:

@theme {
--color-primary: #00ada2; /* the accent: primary buttons, active tabs, icons, chips, links */
--color-ink: #222222; /* headings and strong text */
--color-black: #000000; /* the secondary button ("Call Now"), simple buttons on hover */
--color-muted: #6f7278; /* body text, labels, meta */
--color-white: #ffffff; /* cards, the header, text on dark */
--color-stone: #f5f3f2; /* hairlines, form fields, info panels, the Outcomes and call-to-action bands */
--color-page: #f8fafc; /* the page background */
--color-lime: #e9f885; /* the yellow button, icon covers, the plus of the logo */
--color-night: #020618; /* the footer */
--color-mist: #cad5e2; /* text on the footer */
--color-amber: #ffb900; /* the rating stars of reviews */
--color-blue: #155dfc; /* a fact's tint */
--color-green: #009966; /* a fact's tint */
--color-red: #e7000b; /* a fact's tint, the emergency service's hover line, "Closed" */
--color-red-deep: #ad0009; /* the emergency number's hover (Contact) */
--color-error: #ff2244; /* the form button's error label (its fill is error/15) */
--color-placeholder: #999999; /* placeholders, the select's chevron, table borders */
}

Each name becomes a Tailwind class: bg-primary, text-muted, border-stone. Swap the hex values for your own palette and the site changes. Faded colours are opacity modifiers on a token: primary/10 is the chips and the active menu link, primary/5 the menu hover and the tinted panels (the safety banner), black/5 the hairlines on white cards, white/5 the footer’s social buttons. They follow the palette when you change the colour.

Primary carries white text on the buttons, and Primary text sits on white: in the demo both read at about 2.8 : 1, below the 4.5 : 1 that small text needs. If your accent is free to change, a darker one reads better; keep body text on its background at 4.5 : 1 or more (Muted on the page background is about 4.6 : 1).

A few colours sit outside the tokens, so change them too when you change a colour:

Colour Where
The logo file: the mark and the wordmark in Primary, the plus in Lime public/images/logo.svg (the site itself draws the logo from Logo.tsx, which reads the tokens)
The browser icon: the tooth mark in Primary src/app/icon.svg, src/app/apple-icon.png

The KorDent logo (the tooth mark with its plus, and the wordmark) is drawn as SVG paths in src/design-system/components/brand/Logo.tsx, filled with var(--color-primary) and, for the plus, var(--color-lime), so it follows those two tokens. It is 124 × 28 px in the header on desktop, 106 × 24 on tablets and in the footer, and 89 × 20 in the header on phones; the sizes are the className of <Logo> in src/components/site/Header.tsx and Footer.tsx. To use your own:

  • As an SVG: replace the entries of paths with your logo’s paths (d and fill), and set viewBox="0 0 125 28" to your artwork’s size; adjust the widths in the header and footer to its proportions.
  • As an image file: replace the <svg> with an <Image> of your file. It sits on the white header and on the dark footer, so pick one that reads on both, or use two files.

Its name for screen readers is headerActions.logoLabel in src/content/site.ts (“KorDent home”). The same artwork is in public/images/logo.svg for use elsewhere.

The template loads Inter once, through next/font in src/app/layout.tsx:

const inter = Inter({
variable: "--font-inter",
subsets: ["latin"],
axes: ["opsz"],
});

Inter is one variable font here: every weight and its optical-size axis. The text styles pin that axis at 14, the text cut of Inter, for every size (written as [font-variation-settings:'opsz'_14] in src/design-system/tokens/text.ts), so big headings don’t switch to the display cut. theme.css makes --font-inter the site font (--font-sans). The template uses the weights 400 (text), 500 (menu and buttons), 600 (headings) and 700 (bold labels).

To use another Google font, import it by name from next/font/google and keep the variable name:

import { Manrope } from "next/font/google";
const inter = Manrope({ variable: "--font-inter", subsets: ["latin"] });

Leave out axes: ["opsz"] unless the new font has an optical-size axis: Next.js stops with an error otherwise. Without the axis, the font-variation-settings in the text styles simply do nothing. A font that isn’t variable needs its weights listed (weight: ["400", "500", "600", "700"]). For a font you have licensed yourself, use next/font/local and point it at the files in src/app/fonts/. Next.js serves the font from your own domain either way, so there is no request to Google at runtime.

src/design-system/tokens/text.ts holds the sizes, weights and line heights, named as in the original design:

Style Phone Tablet (md:) Desktop (lg:) Used for
h1 36 44 56 Page titles and the Home hero
h2 28 32 36 Section titles
h3 26 28 32 Rich-text headings (posts, legal pages)
h4 24 26 28 Rich-text headings
h5 20 22 24 The safety banner’s title
h6 18 19 20 Card titles, quotes, the forms’ titles, the service texts’ headings
bodyLarge 16 16 16 Leads, descriptions, rich text, accordion titles
body / bodyBold 14 14 14 Card text, lists / names, field labels
menu 15 15 15 The header’s links (weight 500)
button 14 14 14 Buttons, tabs, the footer’s links (weight 500)
caption / captionBold 12 12 12 Chips, meta, roles / price labels, the footer’s legal links
tiny / tinyBold 10 10 10 The footer’s disclaimer / the review cards’ badges

Headings are weight 600 with −0.03em letter spacing and a line height of 1.1 (h1) or 1.2; the text styles are 1.3 (1.2 for menu and button). Change the numbers in text.ts rather than in the components, and text stays consistent across the site. Use a style as className={text.h2} or combine: className={cn(text.h6, "text-primary")}.

Three sizes, set in theme.css:

Width Tailwind prefix
Phone below 810 px (none)
Tablet 810–1199 px md:
Desktop 1200 px and up lg:

Content is at most 1300 px wide. The side padding is 15 px on phones, 20 px on tablets and 30 px on desktops, and most sections have 60 / 80 / 100 px above and below (sectionGutters and sectionPadding in src/design-system/components/layout/Section.tsx). Section title blocks sit 60 px above their content. The header is 68 px tall on phones and 78 px from tablets up; src/app/layout.tsx pads <main> by that (Pages and sections).

src/design-system/tokens/motion.ts holds the transitions, for Motion:

Token Values Used for
spring (Spring A) no bounce, 0.4 s Buttons (the label flip and the icon covers), the header’s links, the post cards, the service cards’ hover
springSoft (Spring B) bounce 0.2, 0.4 s Tabs (the service filter, the dentists, the outcomes), the accordions, the menu button, social buttons, chips
springMenu no bounce, 0.2 s, each letter 0.075 s late The letters of a header link rising in on hover
appear, appearDistance, appearAmount tween 1 s, ease (0.59, 0.25, 0.12, 1.17); 18 px; half in view Blocks rising into view as they scroll in, once
loadDistance 7 px The Home hero and the page titles rising as the page loads
formTween 0.2 s The colours of a form’s button

theme.css holds the same curves as CSS for what runs without Motion (--ease-appear, --ease-form, --ease-spring-a, --ease-spring-b; hovers run in CSS with them). MotionProvider (wrapped around every page in src/app/layout.tsx) also makes Spring A the default of every Motion element that sets no transition of its own.

Effect Where to change it
Blocks rise as they scroll into view <Appear> in the sections; a plain element with the same className shows at once
Page titles rise word by word out of a light blur <TextAppear> in the page-title sections
How many services the grids show limit in services (home.ts, 6), list (services.ts, 14) and departments (service.ts, 6)
The first reason (Home) and the first step (Services) start open defaultOpen on <Accordion> (0 by default, a row’s number from 0) in AboutSection.tsx and PatientGuideSection.tsx
The outcomes’ index and a service page’s contents stay 50 px under the top of the window on desktop OutcomesSection.tsx, ServiceDetailSection.tsx; the booking panel the same in BookingSection.tsx
The call-to-action video plays only while on the screen CtaSection.tsx

With “reduce motion” switched on in the visitor’s system, movement is left out: MotionProvider makes Motion skip its transform and layout animations (blocks fade in where they stand), the accordions open at once, the buttons’ hover movements are switched off in CSS and the call-to-action video stays still. Fades and colour changes stay.

Corners are 12 px on the big photos and the white cards of the booking form, the service texts and the dentists, 8 px on cards, panels, small photos and the facts, 6 px on form fields and icon boxes, and 2 px on the Open / Closed tags. Avatars, the rating discs and the arrow covers are round. One shadow, --shadow-float in theme.css, lifts the hero’s floating badges and a hovered service card. Spacing is Tailwind classes on the components (gap-5, p-5, gap-[60px]); Tailwind’s scale is 4 px per step, so gap-5 is 20 px.

src/design-system/components/ holds the buttons and menu links, the logo and the icons, the appear effects, the menu button, the section layout and section titles, the cards (service, post, review, outcome, dentist), the check items, the accordions, the filter tabs, the table of contents, rich text and the form parts (fields, choice cards, the star rating, the submit button). Its README lists every component with its props and where it is used. The sections that make up a page are one level up, in src/components/sections/, and are listed in Pages and sections.

There are two sets:

  • Interface icons — the arrow, phone, check, star, calendar, clock, map pin, envelope, the social marks and the rest, 25 in all — are Phosphor path data in src/design-system/components/icons/paths.ts; <Icon name="arrow-right" /> draws one in the current text colour.
  • Service and feature icons — the line icons of the service cards (ServiceIcon in types.ts) and the “Why Choose Us” cards (FeatureIcon) — are in src/design-system/components/icons/shapes.ts and drawn by <ShapeIcon>. A service or a feature picks one by name in its collection; your editor checks the name.

To add an interface icon:

  1. Open the icon on phosphoricons.com and copy the SVG.

  2. Take the d="…" of its <path>.

  3. Add a line to iconPaths:

    "my-icon": "M128,24A104,104,0,1,0,…",

Then use <Icon name="my-icon" className="size-5" />. Paths use a 256 × 256 grid, which is what Phosphor exports. The style guide shows every icon of paths.ts by itself.

To add a service or feature icon, add an entry to shapePaths in shapes.ts (24 × 24 line drawings with a stroke of 1.5; each path has an x and y offset), then add its name to ServiceIcon or FeatureIcon in src/content/types.ts.