Back to design tips
Color & graphics

Use shadow to separate a floating menu

A file list shows what sits on the page and what sits above it.

Compare the designs

Comparison view
Deliverables
Brief.pdf
Print.pdf
Notes.pdf
Sort byLast editedFile name
Before

The sorting menu shares the visual plane of the file rows.

Deliverables
Brief.pdf
Print.pdf
Notes.pdf
Sort byLast editedFile name
After

The menu has a visible edge and elevation. File rows remain flat.

Try it on your page

  1. Identify the persistent surface and the temporary layer.
  2. Use dividers for rows. Give the overlay an opaque fill, fine edge and soft downward shadow.
  3. Check the outline on light and dark surfaces.
12 CSS shadows to try

Resting surfaces

  • Document in a file list

    box-shadow: 0 1px 2px #3c403624, 0 0 0 1px #3c403611;
  • Metric card in a dashboard

    box-shadow: 0 3px 8px -3px #334a4260;
  • Folder lifted on selection

    box-shadow: 0 2px 2px #61523d19, 0 8px 13px -6px #61523d55;

Floating surfaces

  • Filter menu over a table

    box-shadow: 0 2px 5px #263e301c, 0 11px 18px -5px #263e3052;
  • Floating editing toolbar

    box-shadow: 0 0 0 1px #26394616, 0 5px 14px #26394636;
  • Command palette over an editor

    box-shadow: 0 4px 7px -3px #25334455, 0 17px 27px -7px #25334464;

Inset surfaces

  • Short reference-number field

    box-shadow: inset 0 1px 3px #394c4335, inset 0 0 0 1px #394c4328;
  • Pressed drag handle

    box-shadow: inset 0 3px 5px #4d43374d, inset 0 -1px 0 #ffffff;
  • Selected calendar date

    box-shadow: inset 0 0 0 2px #4d6554, inset 0 3px 6px #4d655438;

Hard edges and layers

  • Printed event ticket

    box-shadow: 1px 1px 0 #496458, 3px 4px 0 #496458;
  • Stack of editorial proofs

    box-shadow: 2px 2px 0 #d0c6ae, 4px 4px 0 #fffaf0, 5px 5px 0 #a99c7f;
  • Stamp on a mail receipt

    box-shadow: 0 0 0 1px #8d5342, 4px 4px 0 #bc7963;