Skip to content

Commit

Permalink
feat: add content about tabs panel padding (#1404)
Browse files Browse the repository at this point in the history
* feat: add some content about being able to remove tab panel inset/padding

* feat: change section title

---------

Co-authored-by: Steven Spriggs <[email protected]>
  • Loading branch information
marionnegp and zeroedin authored Jan 9, 2024
1 parent ebc1d3d commit ccd7baa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion elements/rh-tabs/docs/20-guidelines.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## Usage
Use tabs to help users navigate information while staying on the same page. Text labels and content in the panel should be related so users know what to expect when they select each tab. Never force users to switch back and forth between tabs to complete a task.

### When to use tabs
Use tabs to organize lots of information into logical sections. Consider using an accordion if that information needs to be viewed simultaneously because using tabs is not suitable as it forces users to rely on short-term memory when switching back and forth. Using an accordion can also accommodate more sections with longer text labels whereas tabs should only display three or four sections with short text labels. Therefore, if viewing lots of sections of content simultaneously is critical to the user experience or if important information requires more focus and less clicking, use an accordion instead.

### Tabs vs. accordion
Tabs allow users to click through content one section at a time whereas an accordion allows users to view multiple sections of content simultaneously.

Expand Down Expand Up @@ -31,7 +33,7 @@ If using horizontal tabs, the default orientation is left aligned, but center al

{% example palette="light", alt="Image of open tabs with left and center alignment and box tabs with left and center alignment", src="../tabs-alignment.png" %}

### Inset
### Inset and tab panel spacing
An inset is used to ensure consistent alignment and padding between text labels, overflow buttons, and content in the panel.

{% alert state="info", title="Helpful Tip" %} With horizontal tabs, there are two inset options. With vertical tabs, there is only one. {% endalert %}
Expand All @@ -42,6 +44,8 @@ An inset is used to ensure consistent alignment and padding between text labels,

{% example palette="light", alt="Image of vertical tabs showing detailed inset specs", src="../tabs-inset-vertical.png" %}

Certain content layouts may require removing the inset. While this is not a default style, it is possible with custom CSS.

### Logos
In certain edge cases, logos can be used instead of text labels.

Expand Down

0 comments on commit ccd7baa

Please sign in to comment.