Cerette design system — Astro
Content-free building blocks of the Cerette template (an architecture and construction studio), mirrored from the Framer
components: the same names, props and classes as the Next.js version’s src/design-system, as .astro components with plain
TypeScript scripts (no framework islands). Components never import site content: pass data in through props. Import by path
(no barrel). Every component is shown at /style-guide (src/pages/style-guide.astro).
- Shapes:
types.ts(ImageData,ButtonTone,ProjectCardVariant,ProjectCardData,PostCardData,TestimonialCardData,ValueCardData,ServiceCardData,TeamCardData,QuoteBandData,AwardRow,ServiceSwitchItem,FormFieldData,FormStatus,RichTextBlock,IconName). - Tokens:
theme.css(colours, fonts, the easing curvesease-t1ease-tiease-eease-s0ease-s2ease-form, the CSS animationsanimate-turn,animate-hero-label/-buttons,animate-load-riseand their-fadeversions),tokens/text.ts(Framer’s 14 text styles:display,h1–h6,number,big,paragraph,small,menu,tiny,quote),tokens/motion.ts(tweenAppearT1,heroRiseE6 / E4,charAppearTX,springS0,springSoftS2,tweenInTI,appearOffset,appearStagger,cardZoom,titleWordsTW,introLinesTL, andtransitions— the namesdata-transitiontakes:spring,soft,tweenIn,snap). - Utilities:
utils/cn.ts(cn),utils/href.ts(isExternalHref,externalLinkProps),utils/image.ts(image,imageUrl,isRemote,imageWidths,remoteWidths),utils/motion.ts(motionStates,styleOf),utils/play.ts(play,reducedMotion— the Next.js MotionProvider: spring S0 by default, reduced motion makes moves jump, fades still play).
Components
Section titled “Components”Every component also takes class (the Next.js className). A slot named in the table is an Astro named slot
(<Button slot="action" …>); a “function slot” is {(i: number) => …}.
| Group | Component | Props |
|---|---|---|
| actions | Button (+ button.ts: tones, dot, simpleLabel, turn) |
href, tone (primary · black · white · simple), type (button · submit), disabled, data-*; the label is the slot |
| actions | RollingLabel |
lineHeight (13.2), rolledClass — the Flip label roll; the label is the slot |
| actions | NavLink |
href, current, data-*; the label is the slot |
| navigation | Hamburger |
label, closeLabel, open (start as the X) — scripts/hamburger.ts → setHamburger(button, open) |
| navigation | FooterLink |
href, tone (white · black); the label is the slot |
| brand | Logo |
title |
| icons | Icon (+ paths.ts: iconPaths, IconName) |
name, label (none = aria-hidden) |
| layout | Section (+ section.ts: sectionGutters, sectionPadding, sectionGap) |
id, as (section · div), innerClass, padding, gap, width (“max-w-[1440px]”), label, headerSwitch |
| layout | Label (LabelTone) |
tone (grey · black · white); the text is the slot |
| layout | Ruler |
— |
| layout | TitleSection (TitleSectionAlign) |
label, title, lead, align (split · center · stack), balance, leadBalance (always · compact), slot action |
| layout | Masonry |
count, gap (“gap-2.5”), function slot (item i) |
| media | FillImage |
src, alt, sizes (“100vw”), priority, data-* (local /images/… or a URL) |
| media | Photo |
src, alt, sizes, grain, priority, data-* |
| media | Grain |
— |
| motion | Appear |
as (div · li · article · p), half, order, data-*; slot |
| motion | Rise |
as (div · p); slot |
| motion | WordAppear |
text, as (h1 · p · span) |
| motion | LineRise |
text, as (p · span) |
| patterns | CharAppear |
text, as (h1 · p), duration (charAppear.text) |
| patterns | ServicesSwitcher |
id (prefix of the tab and panel ids), items (ServiceSwitchItem[]), moreLabel, slot intro |
| patterns | TeamPicker |
items (TeamCardData[]), label |
| patterns | LoadSpinner |
label, data-* |
| patterns | RichText (+ RichTextBlock, RichTextInline, rich-text.ts: inlineLines, richTextLinkClass) |
blocks, headings (h2 · h3), body (big · paragraph), list (“mt-5”), width (“max-w-[900px]”) |
| data | StatNumber |
value, suffix, label |
| data | AwardTable |
labels ({ number, award, description }), rows (AwardRow[]) |
| cards | ProjectCard |
data, variant (small · landscape · square), actionLabel, sizes |
| cards | PostCard |
data, sizes, titleAs (h2 · h3, default h3) |
| cards | ServiceCard |
data, actionLabel, sizes, titleAs (h2 · h3, default h2) |
| cards | TestimonialCard, ValueCard |
data |
| cards | TeamCard |
data, sizes (“(min-width: 810px) 50vw, 100vw”) |
| blocks | QuoteBand |
data (QuoteBandData), still, half |
| blocks | CtaBand |
title, text, image, height (“h-[676px] md:h-[864px] lg:h-[800px]”), still, half, slot action |
| forms | Form (+ form-state.ts: honeypotField) |
name, subject, endpoint, hidden, submitLabel, successLabel, errorLabel, redirectTo, demo (true · “fail”), submitClass, actionClass; fields in the slot, slot after — src/lib/forms/README.md |
| forms | FormField, FieldControl (+ field.ts: fieldSurface) |
FormFieldData (name, label, placeholder, type, required, autoComplete, defaultValue, options); FieldControl without a visible label |
| forms | SubmitButton |
status (idle · pending · success · error), label, successLabel, errorLabel, disabled |
| utils | CurrentYear |
— |
Scripts
Section titled “Scripts”scripts/*.ts, each an init*() without arguments called from its component’s <script> (the HTML edition calls every one);
helpers that take arguments have other names.
| Script | Drives |
|---|---|
hover.ts (initHover, called by the layout) |
data-hover hosts and their data-motion parts (data-transition, data-transition-out) |
appear.ts (initAppear) |
data-appear = view (Appear), char (CharAppear), word (WordAppear), lines (LineRise) |
hamburger.ts (setHamburger) |
the menu button’s two looks (the header script decides when) |
services-switcher.ts (initServicesSwitchers) |
ServicesSwitcher: tabs, the card, the desktop photo, the phone accordion |
team-picker.ts (initTeamPickers) |
TeamPicker: picking a row, dimming, the crossfade |
load-spinner.ts (initLoadSpinners, watchSpinner) |
LoadSpinner’s ring fade while half of it is in view |
blog-list.ts (initBlogLists, blogListClasses) |
the blog’s load on scroll (sections/BlogList) |
about-team.ts (initAboutTeams) |
About’s team cards on tablets and phones, loaded on scroll (sections/AboutTeam) |
form.ts (initForms) |
Form: send, demo mode, the Submit button’s states, reset |
current-year.ts (initCurrentYear) |
CurrentYear |
style-guide.ts (initReplays, initTransitionDemos, initCurveDemos, initHamburgerDemos) |
the style guide’s demos (src/components/style-guide) |