How do I design a deck or pergola that frames the view instead of blocking it?
Short answer
Decide where you will sit, then design everything around the sightline from that seat. Keep posts out of the center of the view and use them as a frame at the edges. Set the pergola beam high enough that a seated person looks under it, not at it. Choose a railing that disappears, or drop the deck low enough that none is required. Run deck boards toward the view so the lines lead the eye out. A view framed by a few well-placed parts feels larger than an open one.

Start from the chair, not the plan
A view is only ever seen from somewhere. Before any drawing, set a chair where the lounge or the dining table will go, sit in it and look. Note where the good part of the view is, how wide it is and what is in the way. Do the same from the kitchen window and from the door, because those are the other places you will see the yard from every day. The structure should be designed around those few sightlines, and the plan drawing should come second.
This is how the custom deck and pergola project started: a slab, a view of the hills and no shade. The brief was a place to sit in the afternoon without squinting, and the pergola was placed and spaced so the hills stayed in view from the lounge chairs.
Posts as a frame, not a fence
Vertical posts are the biggest threat to a view and the best tool for framing one. The rule is to keep them out of the middle third of the sightline from the main seat. Pushed to the edges, a pair of posts acts like a picture frame and makes what is between them feel more deliberate and often larger. If the span between those posts is too long for a wood beam, the answer is a deeper beam, a doubled beam with a hidden steel plate or a steel post, not an extra post in the middle. Any structural steel should be sized by a licensed engineer.
Beam height and what a seated person sees
From a lounge chair your eyes are roughly four feet off the floor, and from a dining chair a little higher. A pergola beam set at the comfortable eight to nine feet sits well above that line, so you look under it. Where it goes wrong is when a shade cloth, a hanging light or a row of low rafters is added later and drops the visual ceiling into the view. Plan those elements with the structure so the lowest thing overhead stays above the sightline from the seat you care about.
Railings: the quiet option or none at all
Railings are required when a deck floor is high enough above the ground, and the required height tends to land right at eye level from a chair. If your lot is flat, the strongest design move is to keep the deck low enough that no railing is required, so the edge is a clean board and a step to the garden. Where a railing is required, horizontal cable, thin steel rods or glass panels keep the view, and a wood top rail at a comfortable height to lean on makes them feel finished. Avoid a wide, flat top rail that reads as a shelf across the view.
Lines that lead the eye
Everything on the floor plane either leads toward the view or across it. Deck boards running toward the view stretch the space in that direction; boards running across it make the deck feel wider and stop the eye. The same goes for the pergola rafters, a path, a planter edge or a step. Decide which way you want the eye to travel and make the long lines agree. A single border board around the perimeter settles the edge and keeps the direction from feeling random.
Edit the foreground
Most views are spoiled by what is nearest, not what is far away. A utility box, a neighbor's roofline, a bare fence top or an overgrown shrub sitting in the lower part of the view will pull the eye every time. Use a low planter, a screen panel or a change in level to hide the near problem, and keep the planting that frames the view in scale with the structure. A view that has been edited at the edges feels bigger than one that is simply open.
Related questions
Should the deck boards run toward the view or across it?
Toward the view if you want to pull the eye out and make the yard feel deeper. Across it if the deck is narrow and you want it to feel wider. Pick one and keep the pergola rafters and other long lines consistent with that choice.
Can a pergola block a view I want to keep?
A pergola only blocks a view when its posts land in the middle of the sightline or when something is hung below the beam. Place posts at the edges, keep the beam high and plan any lighting or shade cloth above the sightline from a seated position.
What railing is best for a view?
Horizontal cable, thin steel rods or glass panels keep the most view, and all three can be topped with a slim wood rail that feels warm to the hand. If the deck can be kept low enough to avoid a railing entirely, that is usually the best answer of all.