Cursor prompt for a hero section
A Cursor prompt that adds a hero to an existing landing page without disturbing what is already there. It tells the agent where the file goes, which primitives to reuse, and to ship the change as one reviewable diff — the constraints that keep repo-aware edits safe. The customizer fills in style, palette, type, and motion to match your brand.
Last updated
In my existing repo, build a hero section for {{product}} and slot it above the first section of the landing page. Before writing anything, read one neighboring section component to learn this codebase's conventions, then match them.
File placement and integration:
- Create the component at src/components/sections/Hero.tsx, or wherever this repo keeps its section components — mirror the folder and naming pattern you find.
- Reuse the project's existing Button, Container, and heading primitives instead of inventing new ones; add local subcomponents only when nothing fits.
- Import it in the landing page and render it above the current first section. Do not edit, restyle, or reorder any sibling section, shared layout file, or global stylesheet.
- Deliver everything as one reviewable diff: the new file plus a single page-level import.
Hero anatomy — asymmetric split with copy left at roughly 55% width and the visual bleeding to the container's right edge:
- A kicker line naming the product category, then an H1 of at most nine words stating the before/after change {{product}} creates for {{audience}}.
- A one-sentence subhead that names {{audience}} explicitly and states the mechanism.
- A primary button labelled "{{cta}}" with a quieter text link beside it, then one proof line — logo strip or single stat, not both.
- The visual: a bordered 4:3 screenshot placeholder, top-aligned with the H1.
Rhythm: use the repo's spacing scale if it has one; otherwise 96px top section padding, 24px between copy blocks, 40px above the proof line. The whole section must fit a 1280x800 window with the proof line visible — no scrolling.
Visual direction:
{{style}}
Palette: {{palette}}
Typography: {{type}}
Motion: {{motion}}
Under 768px, stack copy above the visual and bring the visual back inside the container padding.
Run the dev server and verify: (1) git diff shows only the new file and one import, (2) existing sections render exactly as before, (3) the hero fits 1280x800 without scroll, (4) the primary button is the repo's own button component.Customize it
Runs in your browser. Nothing you type here is sent anywhere.
In my existing repo, build a hero section for a project management SaaS and slot it above the first section of the landing page. Before writing anything, read one neighboring section component to learn this codebase's conventions, then match them. File placement and integration: - Create the component at src/components/sections/Hero.tsx, or wherever this repo keeps its section components — mirror the folder and naming pattern you find. - Reuse the project's existing Button, Container, and heading primitives instead of inventing new ones; add local subcomponents only when nothing fits. - Import it in the landing page and render it above the current first section. Do not edit, restyle, or reorder any sibling section, shared layout file, or global stylesheet. - Deliver everything as one reviewable diff: the new file plus a single page-level import. Hero anatomy — asymmetric split with copy left at roughly 55% width and the visual bleeding to the container's right edge: - A kicker line naming the product category, then an H1 of at most nine words stating the before/after change a project management SaaS creates for engineering managers at startups. - A one-sentence subhead that names engineering managers at startups explicitly and states the mechanism. - A primary button labelled "start a free trial" with a quieter text link beside it, then one proof line — logo strip or single stat, not both. - The visual: a bordered 4:3 screenshot placeholder, top-aligned with the H1. Rhythm: use the repo's spacing scale if it has one; otherwise 96px top section padding, 24px between copy blocks, 40px above the proof line. The whole section must fit a 1280x800 window with the proof line visible — no scrolling. Visual direction: Minimal dark style. Near-black canvas (#0A0A0B) with one elevated surface tone (#141416) for cards — never more than two surface steps. Hairline borders (1px, white at 8% opacity) instead of shadows; if a shadow is unavoidable use 0 1px 2px rgba(0,0,0,0.4) and nothing softer. Text in exactly three steps: white at 92% for headings, 60% for body, 40% for captions. Generous negative space — section padding at least 120px on desktop, 64px on mobile. The accent color appears only on interactive elements and one hero highlight, nowhere else. Palette: a strict neutral ramp (white, #F5F5F5, #E5E5E5, #737373, #171717) carries the entire interface; pick one accent and use it only for primary CTAs, active states, and a single hero highlight. If the accent appears more than five times per viewport it stops being an accent. Keep semantic colors (success, error) desaturated so the accent stays in charge. Typography: one geometric sans (a Futura/Poppins-class face) at three weights maximum (400/500/700). Scale: 64-88px hero, 32px section heads, 18px lede, 16px body, 13px caps labels with 0.08em tracking. Tight headline leading (1.05-1.1), relaxed body (1.6). Let the geometry carry the personality — no italics; weight and size do all hierarchy. Motion: none. Zero scroll animations, zero entrance effects — the page is fully composed the instant it paints. Spend the motion budget on input feedback instead: 120-150ms ease-out color and transform transitions on hover and press states only. Hold this constraint absolutely; it is a statement, not an omission. Under 768px, stack copy above the visual and bring the visual back inside the container padding. Run the dev server and verify: (1) git diff shows only the new file and one import, (2) existing sections render exactly as before, (3) the hero fits 1280x800 without scroll, (4) the primary button is the repo's own button component.
Same task in other tools
Questions about this prompt
What if my repo has no src/components/sections folder?
The prompt already instructs Cursor to mirror whatever convention it finds — pages/, features/, or a flat components directory. If the agent guesses wrong, point it at one existing section file and say 'place it like this one'; a single concrete example beats any path argument.
Will this work in a non-Tailwind codebase?
Yes. The prompt specifies structure, copy, spacing values, and behavior rather than utility classes, so Cursor implements them in whatever styling system the repo uses — CSS modules, styled-components, or vanilla CSS. The reuse-existing-primitives rule is what keeps the output on-stack.
Cursor edited my other sections anyway — how do I stop that?
Reject the diff hunks touching sibling files before applying; the one-diff instruction exists so you can review before anything lands. Then follow up with 'revert changes outside Hero.tsx and the page import' — the agent honors file-scoped constraints well on a second pass.
Part of the Cursor landing-page cluster — start from the main Cursor landing page prompt.