Skip to content

tabs-vika #1410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added images/ui/tabs/01_Tabs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/01_Tabs_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/02_How_to_use_correct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/02_How_to_use_correct_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/02_How_to_use_incorrect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/02_How_to_use_incorrect_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/03_How_to_use.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/03_How_to_use_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/04_Placement_correct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/04_Placement_correct_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/04_Placement_incorrect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/04_Placement_incorrect_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/05_Placement_incorrect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/05_Placement_incorrect_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/06_Placement_correct-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/06_Placement_correct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/06_Placement_correct_dark-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/06_Placement_correct_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/06_Placement_incorrect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/06_Placement_incorrect_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/07_Placement_correct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ui/tabs/07_Placement_correct_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
65 changes: 42 additions & 23 deletions topics/ui/controls/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

</tldr>

Tabs organize content in dialogs by grouping similar UI controls.
Tabs help organize related content.

![](01_tabs_example.png){width=322}
![Tabs](01_Tabs.png){width=706}

In code editors, tabs are created with another component — [`JBEditorTabs`](%gh-ic%/platform/platform-api/src/com/intellij/ui/tabs/impl/JBEditorTabs.kt). It supports extended functionality like icons, closeable, and draggable tabs. Do **not** use this component in dialogs.

For editor tabs, use another component — [`JBEditorTabs`](%gh-ic%/platform/platform-api/src/com/intellij/ui/tabs/impl/JBEditorTabs.kt). It supports extended functionality like icons, closeable, and draggable tabs. Do **not** use this component in dialogs.

In tool windows, tabs are generated automatically. See also [Tool window](tool_window.md).

Expand All @@ -24,49 +25,67 @@ Follow the rules in [Groups of controls](groups_of_controls.md).

## How to use

Use title capitalization for tab labels.
### Label

Make the label short, preferably no more than 3 words.
Use title capitalization for tab labels. Make the label short, preferably no more than 3 words.
Avoid generic words, such as "General" or "Advanced".
See [Writing short and clear](writing_short.md).

![](02_naming.png){width=284}
<format color="369650" style="bold">Correct</format>
![Hiding tabs that do not fit](02_How_to_use_correct.png){width=706}

<format color="E55765" style="bold">Incorrect</format>
![Hiding tabs that do not fit](02_How_to_use_incorrect.png){width=706}


### Tab Order and Layout

Place the most frequently used content in the first tab.
Tabs that do not fit allotted screen space automatically hide under the dropdown component.
(It is better to add no more than 8 tabs, but this number is not limited.)

![](03_hidden_tabs.png){width=533}
Tabs that do not fit allotted screen space automatically hide under the dropdown component. It is better to add no more than 8 tabs, but this number is not limited.

Always place tabs on top. It is possible to place them at other sides of the content — bottom, left, or right — but such a placement is extremely rare and might confuse users.
![Hiding tabs that do not fit](03_How_to_use.png){width=706}

### Unavailable content

Do not remove or disable a tab when its function is unavailable. Explain why a tab’s content is unavailable in the body of the tab.

## Placement

Make sure the border of the tab reaches the edges of the area tabs occupy.
### Position

<format color="Red" style="bold">Incorrect</format>
Always place tabs on top of the content. It is possible to place them at other sides — bottom, left, or right — but such a placement is extremely rare and might confuse users.

![](04_layout_border_incorrect.png){width=595}

<format color="Green" style="bold">Correct</format>
### Independent content

![](04_layout_border_correct.png){width=595}
Do not place independent content under the tabs. Create separate tabs for such content.

Do **not** surround the tab content area with a visible border.
<format color="369650" style="bold">Correct</format>

![Correct placment of independent content](06_Placement_correct.png){width=706}

<format color="Red" style="bold">Incorrect</format>
<format color="E55765" style="bold">Incorrect</format>

![](05_bordered.png){width=595}
![Incorrect placement of independent content](06_Placement_incorrect.png){width=706}

Avoid placing independent content groups under the tabs' area.
### Controls above tabs
When there are other UI controls above tabs, separate them with a vertical indent.

<format color="Red" style="bold">Incorrect</format>
![UI controls above the tabs](07_Placement_correct.png){width=706}

![](06_layout_content_under.png){width=595}
### Tabs border

When there are other UI controls above tabs, separate them with a vertical indent.
Make sure the border of the tab reaches the edges of the area tabs occupy.

<format color="369650" style="bold">Correct</format>

![](07_inset.png){width=595}
![Correct bottom border](04_Placement_correct.png){width=706}

<format color="E55765" style="bold">Incorrect</format>

![Incorrect bottom border](04_Placement_incorrect.png){width=706}

Do **not** surround the tab content area with a visible border.

![Frame around the tab content](05_Placement_incorrect.png){width=706}