Skip to main content

Navigation

  • Client impact
  • Writing

AI Solutions

  • AI Systems
  • AI Development

Software teams

  • Design Systems
  • Product Design & Engineering
  • API Platforms
  • View all services for software teams
Get in touch
  • AI Systems

    Model-agnostic AI systems and agents that do real work

    AI Development

    Custom apps and tools built with AI-enabled engineering

  • Design Systems

    Depth of experience that few can match

    Product Design & Engineering

    Experts in cross-functional collaboration

    API Platforms

    Node.js, React, & GraphQL at scale


    View all services for software teams
  • Client impact
  • Writing
  • Contact

Writing · Feb 21st, 2023 · 2 min read

Matt Stow avatarMatt Stow avatar
Matt Stow

Building layouts with placeholder components

An approach to rapidly building and evolving layouts as a project progresses and becomes more defined.

Services discussed

  • Design Systems,
  • Front-end Engineering

Technology discussed

  • CSS

We’re in the early stages of building a complex application for a client. While we figure out how the underlying schema will work, we thought it would be a good idea to build the layout with placeholder components in place:

A responsive app layout using placeholder components

The placeholders give us a nice baseline to build from, and will provide obvious visual indication of progress to stakeholders as the real components replace them. We included image dimensions to help us make sure we use correct aspect ratios, and indicate to devs at a glance what sizes we’ll be needing.

Image component

The Image component simply takes width and height props and returns a placeholder image which automatically adds the dimensions. We used images instead of a styled HTML element to better understand how the layout might shift as they load.

function PlaceholderImage({ height, width, ...consumerProps }) {
  return (
    <Image
      {...consumerProps}
      alt=""
      src={`https://placehold.co/${width}x${height}.png`}
    />
  )
}

View this snippet as a Gist

Text component

We have a Text component that takes a number of characters and visually hides Lorem Ipsum up to that length and sets a repeating grey/white background to simulate text. Because it uses Plain Text under the hood, it responds and wraps sensibly.

const lipsum =
  'Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestias quo voluptas fugit quidem nemo autem eos reprehenderit voluptatum nam. Error odio repellendus quisquam magni rerum hic facere laboriosam, aspernatur fugiat.'

function PlaceholderText({ characters, ...consumerProps }) {
  const string =
    characters <= lipsum.length
      ? lipsum.slice(0, characters)
      : lipsum
          .repeat(Math.ceil(characters / lipsum.length))
          .slice(0, characters)

  return (
    <span
      {...consumerProps}
      style={{
        backgroundImage:
          'repeating-linear-gradient(to bottom, #fff 0px, #fff 2px, #bbb 2px, #bbb 10px, #fff 10px, #fff 18px)',
        display: 'inline-block',
        fontSize: 12,
        lineHeight: 1,
      }}
    >
      <span style={{ visibility: 'hidden' }}>{string}</span>
    </span>
  )
}

View this snippet as a Gist

All in all, it’s been a handy way to create momentum on layout without adding a lot of technical debt.

Services discussed

  • Design Systems,
  • Front-end Engineering

Technology discussed

  • CSS
Matt Stow avatarMatt Stow avatar
Matt Stow

Senior UX Engineer at Thinkmill. Designs (digital, craft, board games). Writes (code, fiction, reviews). Loves a11y, design systems, alt rock, & Nintendo.

Related content

  • What AI use looks like in five enterprise design teams

    article

    September 2026·9 min read
  • From Vibes to Durable Context

    article

    August 2026·4 min read
  • Is Your Design System Ready for AI?

    article

    August 2026·6 min read
  • Optimise Your Context, Not Your Prompts

    article

    July 2026·5 min read
  • Why Great Engineering Still Wins

    article

    July 2026·3 min read
  • Designing beyond the median user

    article

    June 2026·10 min read

Have an idea to explore?

Get in touch

Footer

Thinkmill is a member of the Tech Council of Australia(opens in new tab).

AI Solutions

  • AI Systems
  • AI Development

Software teams

  • Design Systems
  • Product Design & Engineering
  • API Platforms
  • View all software teams

Client impact

  • ELMO
  • Tiimely
  • Atlassian
  • Reckon
  • AnywhereWorks
  • View all client impact

Open Source

  • Keystone (opens in new tab)
  • Keystatic (opens in new tab)
  • React Select (opens in new tab)
  • Classnames (opens in new tab)
  • Manypkg (opens in new tab)
  • Changesets (opens in new tab)