Size it around the furniture
The usable area under a pergola is smaller than its footprint, because the posts sit inside the corners and the shade moves through the day. We work back from what is going under it, a dining set or a lounge group, plus room to push chairs back and walk around them.
Rafter spacing sets how much sun gets through. Wider spacing is airier and gives less shade. Tighter spacing, or a slatted top layer, gives real relief at midday and costs more in material.
Attached or freestanding
Attached pergolas take a ledger on the house and use fewer posts, which keeps the space more open. Freestanding pergolas can go anywhere, including out in the yard away from the building, and they do not involve cutting into the house.
Either way the posts need proper footings. A pergola is a large sail in a storm and uplift is a real load, not a theoretical one. Bolting posts to the surface of an existing patio is not a substitute for footings below frost depth.
Lighting and screening
String lights are the usual first ask, and the frame should be built with somewhere to fix them rather than having them stapled on afterwards. Wiring can be run inside the posts and beams so nothing is visible.
Where a pergola is also being used for privacy, slatted side panels or a run of privacy screening on one or two sides is far more effective than making the roof denser.