Web & App Design

Design a landing page

This walkthrough builds a product landing page at 1440: a navigation bar, a hero, a grid of bento cards, pricing and a footer. Every section is a frame with auto layout, every color comes from a variable, so the same page shows in Light and Dark, and you can set it at 390 for a phone in a few changes.

The finished page at 1440: navigation, hero with a product shot, bento cards, three plans and a footer
The finished page at 1440: navigation, hero with a product shot, bento cards, three plans and a footer

The page frame#

By hand
  1. Press F and choose Mac in the strip under the top bar. Nox makes a 1440 × 900 frame in the middle of the view.
  2. Name it Landing. In the Layout section choose Auto, then Column, with a gap of 0.
  3. Set H to Hug, so the page grows as you add sections.

Each section you add is a child of this column with its width set to Fill. The page's width then decides every section's width, which is what makes the phone version cheap later.

Keep one content width throughout: 80 of padding on each side leaves 1280 for content.

A row 76 tall, padding [0, 80], Space between, children centered across. Three children: the logo (Geist 20, bold), a row of links (15, weight 500, gap 36), and a button that hugs its label (padding [14, 22], corner radius 26). Space between keeps the logo left and the button right at any width.

With an agent
Make a 1440 page frame called Landing, a column that hugs its height. Add a navigation row 76 tall with 80 padding at the sides: logo left, links in the middle, a Start free button right. Use the Theme variables for every color.

The agent calls create_nodes. Each fill gives a real value and binds it to a variable:

{
  "nodes": [{
    "kind": "frame", "name": "Landing", "x": 0, "y": 0, "width": 1440, "height": "hug",
    "fill": "#FFFFFF", "bindings": {"fill": "color/bg"},
    "layout": {"direction": "vertical"},
    "children": [{
      "kind": "frame", "name": "Navigation", "width": "fill", "height": 76,
      "fill": "#FFFFFF", "bindings": {"fill": "color/bg"},
      "layout": {"direction": "horizontal", "padding": [0, 80], "align": "space_between", "cross_align": "center"},
      "children": [
        {"kind": "text", "name": "Logo", "text": "northwind", "font_family": "Geist", "font_size": 20, "font_weight": 700, "fill": "#0B0D12", "bindings": {"fill": "color/text"}},
        {"kind": "frame", "name": "Links", "width": "hug", "height": "hug", "layout": {"direction": "horizontal", "gap": 36}, "children": [
          {"kind": "text", "text": "Product", "font_size": 15, "font_weight": 500, "fill": "#5B6272", "bindings": {"fill": "color/muted"}},
          {"kind": "text", "text": "Pricing", "font_size": 15, "font_weight": 500, "fill": "#5B6272", "bindings": {"fill": "color/muted"}}
        ]},
        {"kind": "frame", "name": "Start free", "width": "hug", "height": "hug", "corner_radius": 26,
         "fill": "#4B49E8", "bindings": {"fill": "color/accent"},
         "layout": {"direction": "horizontal", "padding": [14, 22]},
         "children": [{"kind": "text", "text": "Start free", "font_size": 15, "font_weight": 600, "fill": "#FFFFFF", "bindings": {"fill": "color/on-accent"}}]}
      ]
    }]
  }]
}

Hero#

A column centered across, padding [88, 80, 96, 80], gap 28. From the top:

  • A badge: one line of 13, weight 600, in the accent color on the surface color, padding [8, 14], radius 16.
  • The headline: Geist 76, bold, line height 82, letter spacing -2.5, centered. Large type needs negative spacing to hold together.
  • The lede: 20 on a line height of 30, in the muted color, with a Max W of 620 so lines stay readable.
  • Two buttons in a row, gap 12: the primary in the accent, the second on the surface color.
  • A product shot: a card with radius 28, padding 32, a 1 px border, and a Max W of 960.

Bento cards#

A row with Wrap on, gap 24 both ways, padding [0, 80, 96, 80]. Mix two card widths so the rows read as a grid: 628 for a wide card and 302 for a narrow one. One wide and two narrow cards make exactly 1280 (628 + 24 + 302 + 24 + 302).

Every card is 260 tall, radius 28, padding 32, a column aligned to its end, so short cards keep their words at the foot and the tops line up. Lead a card with a number in Space Grotesk 56 in the accent color: "42", "1.9 s", "p95". Numbers carry a bento grid better than icons.

Pricing#

A column with a centered title (Geist 44, letter spacing -1) and a row of three plans 410 wide with a gap of 25, which again makes 1280. Each plan is a column, padding 32, gap 14, radius 28: the plan's name, a price in Geist 48, a line about it, and its features as one text with a bullet list and a line height of 30 (see Typography). Give the middle plan the accent background and on-accent text, so the eye goes to it first. Set the row's children to align at the start, so a plan with more lines does not drag its neighbors.

A row on the surface color, padding [40, 80], Space between, centered across: the logo at 18 and the small print at 14 in the muted color.

Light and Dark#

Make one set, Theme, with the modes Light and Dark, and bind every fill to it. Seven colors are enough for this page.

With an agent
Make a Theme set with Light and Dark: bg, surface, text, muted, accent, on-accent and border.

The agent calls set_variables:

{
  "set": "Theme", "modes": ["Light", "Dark"],
  "variables": [
    {"name": "color/bg", "values": {"Light": "#FFFFFF", "Dark": "#0B0D12"}},
    {"name": "color/surface", "values": {"Light": "#F4F5F8", "Dark": "#151821"}},
    {"name": "color/text", "values": {"Light": "#0B0D12", "Dark": "#F5F6F8"}},
    {"name": "color/muted", "values": {"Light": "#5B6272", "Dark": "#9AA3B5"}},
    {"name": "color/accent", "values": {"Light": "#4B49E8", "Dark": "#8C8BFF"}},
    {"name": "color/on-accent", "values": {"Light": "#FFFFFF", "Dark": "#0B0D12"}},
    {"name": "color/border", "values": {"Light": "#E3E6EE", "Dark": "#262B38"}}
  ]
}

Select the page and choose Dark in the inspector's Mode control, or duplicate the page and set the copy to Dark to see both side by side.

The same page in Light and in Dark: only the mode differs
The same page in Light and in Dark: only the mode differs

Give each section a background of its own, bound to color/bg (the footer to color/surface). A mode changes what variables hold; it paints nothing. A section without a fill, switched to Dark on a light page, would show light text on the page's light background. With its own fill, any section can be switched alone: a dark pricing band on a light page is one change.

{"changes": [{"id": "PRICING_ID", "mode": "Dark"}]}
The pricing section switched to Dark on its own, between light sections
The pricing section switched to Dark on its own, between light sections

Variables and modes covers sets, binding by hand and the Mode control.

Check contrast#

Before you call the page done, run the design check. It measures every text against what is behind it, in the mode each frame shows.

By hand

Press ⌘2 for Review, then ⇧K (Check design). The faults are listed in the sidebar; click one to select its layer. Check the Light page and a Dark copy.

With an agent

The agent calls check_design on the page:

{"root": "LANDING_ID", "checks": ["contrast", "small_targets", "tokens"]}

Each finding names the layer, says what is wrong in numbers and what would fix it. Here, a lede set too pale:

{"check": "contrast", "fix": "darken or lighten the text or what is behind it", "name": "Lede", "node": "LEDE_ID", "problem": "#B8BECB on #FFFFFF: a contrast of 1.86 to 1, where 4.5 to 1 is asked for ordinary text"}

The muted color here, #5B6272, gives 6.1 to 1 on white, safe for body text. More on the check in Review, comments and Check Design.

The phone width#

Duplicate the page, set its width to 390, then change what does not scale by itself: padding from 80 to 20, the links hidden, the headline down to 40 on 44, the bento row and the plans turned into columns with each card set to fill the width.

With an agent
Duplicate Landing as Landing 390 and make it a phone layout: 20 side padding, hide the links, headline 40/44, bento and plans as single columns.

The agent duplicates the page, then calls update_nodes on the copy (in part):

{
  "changes": [
    {"id": "PAGE_ID", "width": 390},
    {"id": "NAVIGATION_ID", "height": 60, "layout": {"padding": [0, 20]}},
    {"id": "LINKS_ID", "hidden": true},
    {"id": "HERO_ID", "layout": {"padding": [48, 20, 56, 20], "gap": 20}},
    {"id": "HEADLINE_ID", "font_size": 40, "line_height": 44, "letter_spacing": -1},
    {"id": "BENTO_ID", "layout": {"direction": "vertical", "wrap": false, "padding": [0, 20, 56, 20], "gap": 16}},
    {"id": "TILE_ID", "width": "fill", "height": "hug", "layout": {"padding": 24}}
  ]
}
The page at 390, in Light and Dark
The page at 390, in Light and Dark

Because sections fill the page and cards fill their rows, nothing else needs touching. Responsive patterns has more recipes for layouts that reflow.