For the sake of efficiency in smaller rooms such as child's bedrooms and guest rooms a desk dresser makes sense. Once the upper drawer of the dresser is pulled out its front can be released and will hinge down to create a flat writing surface.
The hinged joint will need to be formed as shown in the drawing above, this lap type joint serves to help support the leaf when laying flat and to cover the joint when in the closed position so no large unsightly gap shows when the drawer is shut.
It may be possible to eliminate the drawer sides and catches on a very small pencil drawer application. In this case you would rely on the butler tray hinges (Item #'s 244H19 & 244H19P) alone to hold the front in the vertical position. I would not suggest this alternative on any drawer more than a couple of inches high. While a butler tray hinge is accurate enough at 180 degrees they are not precise at 90 degrees and in fact will change a little over time furthermore the springs are not strong enough to overcome opening force except on a very small drawer. To hold the front shut will require a pair of catches, the traditional choice would be the secretaire catch (Item #'s 146C61A & 146C61P) though a double ball or magnetic catch may work.
If the drawer front is unusually tall (more than 8") some kind of stay will be needed to help support the writing surface. For more thoughts on this see this page on stays.