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
PeriodSelector is a specialized [SegmentedTabs](/components/navigation/SegmentedTabs) optimized for chart time-period selection. It provides a transparent background, primary wash active state, and full-width layout by default.
2
+
3
+
## Basics
2
4
3
5
```jsx
4
-
functionBasicExample() {
6
+
functionExample() {
5
7
consttabs= [
6
8
{ id:'1H', label:'1H' },
7
9
{ id:'1D', label:'1D' },
@@ -17,12 +19,12 @@ function BasicExample() {
17
19
}
18
20
```
19
21
20
-
## Minimum Width
22
+
## Sizing
21
23
22
-
You can set the `width`prop to `fit-content` to make the period selector as small as possible.
24
+
Set `width` to `fit-content` to make the selector only as wide as its content, and use `gap` to control spacing between tabs.
23
25
24
26
```jsx
25
-
functionMinimumWidthExample() {
27
+
functionExample() {
26
28
consttabs= [
27
29
{ id:'1W', label:'1W' },
28
30
{ id:'1M', label:'1M' },
@@ -43,16 +45,49 @@ function MinimumWidthExample() {
43
45
}
44
46
```
45
47
46
-
## Many Periods with Overflow
48
+
## Live Indicator
49
+
50
+
Use the `LiveTabLabel` component (exported from PeriodSelector) to indicate a live data period. Pair it with a conditional `activeBackground` to visually differentiate the live state.
Customize colors for regular periods while keeping the default red styling for live periods.
140
+
Use `TabComponent` and `TabsActiveIndicatorComponent` to fully brand the selector. This example applies a custom asset color to both the active indicator background and the tab text, while keeping the default red styling for live periods.
237
141
238
142
```jsx
239
-
functionColoredExcludingLiveExample() {
143
+
functionExample() {
240
144
constbtcColor=assets.btc.color;
241
145
242
-
// Custom active indicator that only applies BTC color to non-live periods
0 commit comments