You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/components/tabbed-pane.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,15 +20,17 @@ height="400px"
20
20
21
21
## Tabs {#tabs}
22
22
23
-
`Tabs` are the clickable headers that organize and control content switching in a `TabbedPane`. Each `Tab` represents a different section of content that users can access.
23
+
Tabs are the clickable headers that organize and control content switching in a `TabbedPane`. Each `Tab` represents a different section of content that users can access.
24
24
25
25
:::important
26
-
`Tabs` aren't intended to be used as standalone components. They're meant to be used in conjunction with `TabbedPanes`. This class isn't a `Component` and shouldn't be used as such.
26
+
Tabs aren't intended to be used as standalone components. They're meant to be used in conjunction with TabbedPanes. This class isn't a `Component` and shouldn't be used as such.
27
27
:::
28
28
29
+
You can create a `TabbedPane` with only the tab headers if you need navigation without content panels - simply add `Tab` objects without corresponding content. This is useful for creating tab-based navigation that controls content displayed elsewhere in your application.
30
+
29
31
### Properties {#properties}
30
32
31
-
`Tabs` are comprised of the following properties, which are then used when adding them in a `TabbedPane`. These properties have getters and setters to facilitate customization within a `TabbedPane`.
33
+
Tabs are comprised of the following properties, which are then used when adding them in a `TabbedPane`. These properties have getters and setters to facilitate customization within a `TabbedPane`.
32
34
33
35
1.**Key(`Object`)**: Represents the unique identifier for the `Tab`.
34
36
@@ -38,10 +40,10 @@ height="400px"
38
40
39
41
4.**Enabled(`boolean`)**: Represents whether the `Tab` is currently enabled or not. Can be modified with the `setEnabled(boolean enabled)` method.
40
42
41
-
5.**Closeable(`boolean`)**: Represents whether the `Tab` can be closed. Can be modified with the `setCloseable(boolean enabled)` method. This will add a close button on the `Tab` which can be clicked on by the user, and fires a removal event. The `TabbedPane` component dictates how to handle the removal.
43
+
5.**Closeable(`boolean`)**: Represents whether the `Tab` can be closed. Can be modified with the `setCloseable(boolean enabled)` method. This will add a close button on the `Tab` which can be clicked on by the user, and fires a removal event. The `TabbedPane` component dictates how to handle the removal.
42
44
43
45
6.**Slot(`Component`)**:
44
-
Slots let you add extra elements to a `Tab` like icons, labels, spinners, avatars, or even reset buttons. These additions help convey meaning more clearly and give you room to customize the `Tab’s` appearance and behavior.
46
+
Slots let you add extra elements to a `Tab` like icons, labels, spinners, avatars, or even reset buttons. These additions help convey meaning more clearly and give you room to customize the Tab’s appearance and behavior.
45
47
46
48
You can add a component to the `prefix` slot of a `Tab` during construction. Alternatively, you can use the `setPrefixComponent()` and `setSuffixComponent()` methods to insert various components before and after the displayed option within a `Tab`.
47
49
@@ -56,7 +58,7 @@ Various methods exist to allow developers to add, insert, remove and manipulate
56
58
57
59
### Adding a `Tab` {#adding-a-tab}
58
60
59
-
The `TabbedPane` offers multiple overloaded versions of `addTab()` and `add()` to give you flexibility when adding `Tabs`. Each new `Tab` is added after the existing ones.
61
+
The `TabbedPane` offers multiple overloaded versions of `addTab()` and `add()` to give you flexibility when adding Tabs. Each new `Tab` is added after the existing ones.
60
62
61
63
1.**`addTab(String text)`** - Adds a `Tab` to the `TabbedPane` with the specified `String` as the text of the `Tab`.
62
64
2.**`addTab(Tab tab)`** - Adds the `Tab` provided as a parameter to the `TabbedPane`.
@@ -70,7 +72,7 @@ The `add(Component... component)` determines the name of the passed `Component`
70
72
71
73
### Inserting a `Tab` {#inserting-a-tab}
72
74
73
-
In addition to appending `Tabs` to the end, the `TabbedPane` also supports inserting `Tabs` at specific positions. This is achieved through the various overloaded forms of the `insertTab()` method.
75
+
In addition to appending Tabs to the end, the `TabbedPane` also supports inserting Tabs at specific positions. This is achieved through the various overloaded forms of the `insertTab()` method.
74
76
75
77
1.**`insertTab(int index, String text)`** - Inserts a `Tab` into the `TabbedPane` at the given index with the specified `String` as the text of the `Tab`.
76
78
2.**`insertTab(int index, Tab tab)`** - Inserts the `Tab` provided as a parameter to the `TabbedPane` at the specified index.
@@ -133,16 +135,16 @@ pane.setComponentFor(1, new UpdatedSettingsPanel()); // By index
133
135
The `TabbedPane` handles content visibility based on tab selection:
134
136
135
137
- Clicking a `Tab` shows the corresponding content panel
136
-
- Switching `Tabs` hides the previous content and displays the new one
137
-
- Keyboard navigation is supported after focusing the tab list. Use the `Tab` key to focus the `Tabs,` then arrow keys to navigate between them. The visible content updates automatically as you switch `Tabs`.
138
+
- Switching Tabs hides the previous content and displays the new one
139
+
- Keyboard navigation is supported after focusing the tab list. Use the `Tab` key to focus the Tabs, then arrow keys to navigate between them. The visible content updates automatically as you switch Tabs.
138
140
139
141
## `Tab` events
140
142
141
-
The `TabbedPane` fires events when users interact with `Tabs`:
143
+
The `TabbedPane` fires events when users interact with Tabs:
142
144
143
145
-**`TabSelectEvent`** - Fired when a `Tab` is selected
144
146
-**`TabDeselectEvent`** - Fired when a `Tab` loses selection
145
-
-**`TabCloseEvent`** - Fired when a closeable `Tab's` close button is clicked
147
+
-**`TabCloseEvent`** - Fired when a closeable Tab's close button is clicked
The `Tabs` within a `TabbedPane` can be placed in various positions within the component based on the application developers preference. Provided options are set using the provided enum, which has the values of `TOP`, `BOTTOM`, `LEFT`, `RIGHT`, or `HIDDEN`. The default setting is `TOP`.
180
+
The Tabs within a `TabbedPane` can be placed in various positions within the component based on the application developers preference. Provided options are set using the provided enum, which has the values of `TOP`, `BOTTOM`, `LEFT`, `RIGHT`, or `HIDDEN`. The default setting is `TOP`.
179
181
180
182
<ComponentDemo
181
183
path='/webforj/tabbedpaneplacement?'
@@ -197,7 +199,7 @@ height="250px"
197
199
198
200
### Border and activity indicator {#border-and-activity-indicator}
199
201
200
-
By default, the `TabbedPane` displays a border around its `Tabs`, with the border’s position determined by the configured `Placement`. This visual boundary helps distinguish the `Tab` area from the content section.
202
+
By default, the `TabbedPane` displays a border around its Tabs, with the border’s position determined by the configured `Placement`. This visual boundary helps distinguish the `Tab` area from the content section.
201
203
202
204
When a `Tab` is selected, an activity indicator appears beneath it to highlight the active state.
203
205
@@ -207,7 +209,7 @@ Both of these features can be customized:
207
209
- Use `setHideActiveIndicator(true)` to remove the activity indicator from the active Tab. The default value is false.
208
210
209
211
:::info
210
-
The `Tab` border applies exclusively to the area occupied by the `Tabs` themselves. It doesn't extend around the full `TabbedPane`, and serves solely to delineate the `Tabs` from the content section.
212
+
The `Tab` border applies exclusively to the area occupied by the Tabs themselves. It doesn't extend around the full `TabbedPane`, and serves solely to delineate the Tabs from the content section.
211
213
:::
212
214
213
215
<ComponentDemo
@@ -220,7 +222,7 @@ height="300px"
220
222
221
223
For more fine-grained control over how the `TabbedPane` behaves when being navigated by the keyboard, the `Activation` mode can be set to specify how the component should behave.
222
224
223
-
-**`Auto`**: When set to auto, navigating `Tabs` with the arrow keys will instantly show the corresponding tab component.
225
+
-**`Auto`**: When set to auto, navigating Tabs with the arrow keys will instantly show the corresponding tab component.
224
226
225
227
-**`Manual`**: When set to manual, the `Tab` will receive focus but won't show until the user presses `Space` or `Enter`.
0 commit comments