Floating Shelf Cleats
Build a rectangle box out of wood using wood glue and screws. Leave the side that butts up against the wall open. Paint or stain your wood shelf and allow it to dry.
Carefully measure the size of the opening at the back of your floating shelf. Cut a piece of scrap wood to slightly smaller than that measurement. You want the shelf to slide over the cleat but you don't want very much excess room so make the cleat no more than 1/16 inch smaller than the opening, both vertically and horizontally.
Attach your cleat to the wall by screwing it to the wall at both ends, making sure the cleat is level. Screw at least one end into a stud. Use a wall anchor on the other end, if your cleat isn't long enough to reach another stud.
Slide your floating shelf over the cleat. Screw through the shelf and into the cleat to attach them securely together.
Cut two pieces of 2-by-4-feet wood that are free of cracks or damage -- these may cause the french cleat to fail -- to your desired length.
Hold one length of a 2-by-4 to the wall and scribe it. Set a carpenter's compass so the point and pencil are nearly next to each other. Place the compass so the point is on the wall and the pencil is on the wood and pull the compass down the wall, transferring the imperfections of the wall onto the 2-by-4. Cut the wood on the pencil line so the wood will now sit flush to the wall. Label this 2-by-4 as the wall cleat and draw an arrow pointing to the end that goes against the wall.
Scribe the second 2-by-4 to the dimensions of what you're hanging, such as the back of a headboard or kitchen cabinets. If hanging cabinets, scribe the 2-by-4 to the wood strip that makes the back of your cabinet, located at the top of each cabinet. Cut the wood so it fits flush against the surface. Label the wood and draw the arrow so you know what side of the wood goes against the cabinet.
Rip both 2-by-4 boards at a 45-degree angle using a table saw -- set the angle on your table saw to 45 degrees and make your cuts. Sand down the sharp edge created by the cuts, removing about 1/16 inch.
Hold the wall cleat to the wall and make sure it's level and centered. Screw through the cleat and into the studs with a drill so the gap created by the rip is facing upward. Screw the matching cleat to the item you're hanging, making sure it's leveled, centered and the gab is facing down.
Hang your item by sliding the cleat down and into the wall cleat.