Dividers are used to separate content into different sections.
Dividers can help separate the content into different sections within a page but if used abundantly can make the interface cluttered.
The horizontal divider divides the content vertically. It divides the whole layout into sections & typically spans the full width of the layout. Such dividers are useful for separating different rows of a table, sections inside a card, headers and footers from body, etc.
The vertical divider divides the content horizontally.
Basic appearance is the default appearance of the dividers and the most used one.
Header appearance is typically used in headers and footers to differentiate these sections from the body. It is slightly darker from the default variant. The slightly darker color and the position of this divider help in differentiating it from the basic dividers which might be present in the body.
For example, if a user is scrolling the content of the body, any basic divider present there can be distinguished from this divider because of its color and position.
Horizontal dividers with basic appearance can be slightly spaced from the left (12px or 16 px). This way they can separate related list-type content. They should be aligned with anchoring elements in the left such as icons, avatars, etc.
Table is the only exception here where we do not use the indented divider in rows because table can have vertical dividers as well which then make it appear like the familiar Excel like structure. Having an indented divider doesn’t work in that case.
For cases where the available width is not enough to accommodate content with 16px padding, indentation of 12px should be used.
A lot of the times there is a default padding/margin present in a component e.g. in the body of a sidesheet. Hence, in such cases the dividers do not span till the edge(s). Be aware of padding/margin in such cases.
In modals, sheets, and cards with scrollable content, the header appearance of divider should be used in the header and footer. The slightly darker color of this divider and its position help in differentiating it from the basic appearance that might be present in the body.
Sometimes multiple dividers may be needed within a section. In such cases, the dividers should be used in a way so that the hierarchy of information is preserved.
In horizontal forms or layout, dividers can help users keep track of the row that is being viewed/edited at the moment.
Dividers should only be used if the elements cannot be separated enough using white space. Overuse of dividers would only result in visual clutter.