Visual Studio Code Divider

March 21, 2023 · View on GitHub

The vscode-divider is a web component implementation of a horizontal rule element.

Divider hero

Usage

❌ Don't✅ Do
An editor panel divided into pseudo-viewsA form with with multiple sections separated by a divider
Don't use a divider to create pseudo-views within a webview.Use dividers to create distinct sections of related content in a single view.
❌ Don't✅ Do
A form with dividers between each inputA form with dividers between sections
Don't split up related form elements with a divider.Use a divider to separate multiple forms on the same page.

Implementation

Interactive component examples

Attributes

AttributeTypeDescription
rolestringIndicates the semantic meaning of the divider.

Basic Divider

<vscode-divider></vscode-divider>

Role Attribute

The role attribute determines the semantic meaning (or lack there of) of a Visual Studio Code Divider. The two options are separator and presentation.

The separator option is the default value and indicates that the divider semantically separates content.

The presentation option indicates that the divider has no semantic value and is for visual presentation only.

<!-- Indicates that the divider semantically separates content -->
<vscode-divider role="separator"></vscode-divider>

<!-- Indicates that the divider has no semantic value and is for visual presentation only -->
<vscode-divider role="presentation"></vscode-divider>