@atom-learning/components 1.2.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/action-icon/ActionIcon.d.ts +2 -2
- package/dist/components/action-icon/ActionIcon.js +1 -1
- package/dist/components/calendar/Calendar.d.ts +19 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/Day.d.ts +269 -0
- package/dist/components/calendar/Day.js +1 -0
- package/dist/components/calendar/constants.d.ts +2 -0
- package/dist/components/calendar/constants.js +1 -0
- package/dist/components/date-field/DateField.d.ts +17 -0
- package/dist/components/date-field/DateField.js +1 -0
- package/dist/components/date-field/index.d.ts +1 -0
- package/dist/components/date-input/DateInput.d.ts +17 -0
- package/dist/components/date-input/DateInput.js +1 -0
- package/dist/components/date-input/constants.d.ts +1 -0
- package/dist/components/date-input/constants.js +1 -0
- package/dist/components/date-input/index.d.ts +1 -0
- package/dist/components/date-input/use-date.d.ts +5 -0
- package/dist/components/date-input/use-date.js +1 -0
- package/dist/components/dialog/DialogContent.d.ts +1 -0
- package/dist/components/dialog/DialogContent.js +1 -1
- package/dist/components/form/Form.types.d.ts +2 -2
- package/dist/components/index.d.ts +6 -1
- package/dist/components/notification-badge/NotificationBadge.d.ts +535 -0
- package/dist/components/notification-badge/NotificationBadge.js +1 -0
- package/dist/components/notification-badge/index.d.ts +1 -0
- package/dist/components/popover/PopoverContent.d.ts +1 -0
- package/dist/components/popover/PopoverContent.js +1 -1
- package/dist/components/search-input/SearchInput.d.ts +3 -1
- package/dist/components/search-input/SearchInput.js +1 -1
- package/dist/components/slider/Slider.d.ts +276 -0
- package/dist/components/slider/Slider.js +1 -0
- package/dist/components/slider/SliderSteps.d.ts +13 -0
- package/dist/components/slider/SliderSteps.js +1 -0
- package/dist/components/slider/SliderValue.d.ts +9 -0
- package/dist/components/slider/SliderValue.js +1 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider-field/SliderField.d.ts +13 -0
- package/dist/components/slider-field/SliderField.js +1 -0
- package/dist/components/slider-field/index.d.ts +1 -0
- package/dist/components/table/Table.d.ts +1 -0
- package/dist/components/table/Table.js +1 -1
- package/dist/components/table/TableHeader.d.ts +7 -1
- package/dist/components/table/TableHeader.js +1 -1
- package/dist/components/table/TableHeaderCell.js +1 -1
- package/dist/components/table/TableRow.js +1 -1
- package/dist/components/tabs/TabTrigger.d.ts +5 -3
- package/dist/components/tabs/TabTrigger.js +1 -1
- package/dist/components/tabs/Tabs.d.ts +8 -268
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/tabs/TabsTriggerList.d.ts +274 -0
- package/dist/components/tabs/TabsTriggerList.js +1 -0
- package/dist/components/tabs/utils.d.ts +2 -0
- package/dist/components/tabs/utils.js +1 -0
- package/dist/components/text/Text.js +1 -1
- package/dist/docgen.json +1 -1
- package/dist/docs/DateField.mdx +20 -0
- package/dist/docs/DateInput.mdx +81 -0
- package/dist/docs/Dialog.mdx +16 -1
- package/dist/docs/NotificationBadge.mdx +33 -0
- package/dist/docs/RadioButton.mdx +1 -1
- package/dist/docs/SearchInput.mdx +2 -1
- package/dist/docs/Slider.mdx +117 -0
- package/dist/docs/SliderField.mdx +35 -0
- package/dist/docs/Table.mdx +14 -0
- package/dist/docs/Tabs.mdx +24 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Date Field
|
|
3
|
+
component: DateField
|
|
4
|
+
description: DateField renders a field composed of an DateInput, a Label and a ValidationError
|
|
5
|
+
category: Form fields
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`DateField` is the preferred way to render a form field for dates.
|
|
9
|
+
|
|
10
|
+
In addition to text `Label` (required) and a validation error (optional), `DateField` accepts all the same props as `DateInput` and will pass them on to the `DateInput` it renders. However, as with all our composed components,
|
|
11
|
+
`DateField`’s `css` prop will be applied to a containing `Box`—the styling of the individual components inside `DateField` cannot be altered.
|
|
12
|
+
|
|
13
|
+
Err on the side of using consistent form fields, but if you really need something with different styling then consider composing your own field from the
|
|
14
|
+
`DateInput`, `Label` and `ValidationError` components.
|
|
15
|
+
|
|
16
|
+
```tsx preview
|
|
17
|
+
<Form>
|
|
18
|
+
<DateField name="exam-date" label="Exam date" initialDate={new Date()} />
|
|
19
|
+
</Form>
|
|
20
|
+
```
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Date Input
|
|
3
|
+
component: DateInput
|
|
4
|
+
description: A form component that provides a styled date selector without a label
|
|
5
|
+
category: Form primitives
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Date Inputs should be accompanied by labels, so rather than using `DateInput` directly in a UI,
|
|
9
|
+
it’s normally best to the `DateField` component, which combines a `DateInput` with a `Label` and
|
|
10
|
+
displays validation errors. Alternatively, use this `DateInput` component to compose other field components
|
|
11
|
+
with more specific requirements.
|
|
12
|
+
|
|
13
|
+
`DateInput` is composed from [Dayzed](https://github.com/deseretdigital/dayzed), so further reading on the API can be found there. Some options from Dayzed are set by default in order to provide a uniform experience. For example, the prop `showOutsideDays`, which shows days outside the current calendar month that would appear on the grid, defaults to true in order to avoid extra whitespace.
|
|
14
|
+
|
|
15
|
+
```tsx preview
|
|
16
|
+
<DateInput />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Initial Date
|
|
20
|
+
|
|
21
|
+
The `DateInput` component allows passing of an initial date, which will be selected by default. If you wish this to be the current date, you can use `new Date()` as per the preview below. Strings are also accepted and default to the `DD/MM/YYYY` format. It is recommended to use standard constructors for the date object as per MDN specifications.
|
|
22
|
+
|
|
23
|
+
```tsx preview
|
|
24
|
+
<DateInput initialDate={new Date()} />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Date Format
|
|
28
|
+
|
|
29
|
+
Any combination of date formats can be passed in as a string, such as `DD/MM/YY` or `YYYY/MM/DD`. The default is `DD/MM/YYYY`. A full list of possible formats can be found [here](https://day.js.org/docs/en/parse/string-format#list-of-all-available-parsing-tokens).
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<DateInput dateFormat="YYYY/MM/DD" />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Dayzed customisation
|
|
36
|
+
|
|
37
|
+
### First Day of Week
|
|
38
|
+
|
|
39
|
+
The calendar that is rendered by this component can have its first day of the week customised for different locales. The default is 1 (Monday), but for locales such as the US, pass in `firstDayOfWeek={0}` to set it to Sunday.
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<DateInput firstDayOfWeek={0} />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Translations
|
|
46
|
+
|
|
47
|
+
The weekday and month names can be changed to anything you wish by passing in an array of strings to `weekdayNames` and `monthNames`.
|
|
48
|
+
|
|
49
|
+
> NOTE: It is very important that you keep these labels in the right order. Weekdays must be `Sun -> Sat` and months must be `Jan -> Dec`.
|
|
50
|
+
|
|
51
|
+
```tsx preview
|
|
52
|
+
<DateInput
|
|
53
|
+
weekdayNames={['D', 'L', 'M', 'X', 'J', 'V', 'S']}
|
|
54
|
+
monthNames={[
|
|
55
|
+
'Enero',
|
|
56
|
+
'Febrero',
|
|
57
|
+
'Marzo',
|
|
58
|
+
'Abril',
|
|
59
|
+
'Mayo',
|
|
60
|
+
'Junio',
|
|
61
|
+
'Julio',
|
|
62
|
+
'Agosto',
|
|
63
|
+
'Septiembre',
|
|
64
|
+
'Octubre',
|
|
65
|
+
'Noviembre',
|
|
66
|
+
'Diciembre'
|
|
67
|
+
]}
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
You can also translate the internal labels for accessibility purposes. The `labels` prop accepts an object containing three keys, `open`, `next`, and `previous`. These should all be strings.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<DateInput
|
|
75
|
+
labels={{
|
|
76
|
+
open: 'Open label',
|
|
77
|
+
next: 'Next month label',
|
|
78
|
+
previous: 'Previous month label'
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
```
|
package/dist/docs/Dialog.mdx
CHANGED
|
@@ -14,7 +14,7 @@ Read more about the underlying UI component on the [Radix UI documentation site]
|
|
|
14
14
|
```tsx preview
|
|
15
15
|
<Dialog>
|
|
16
16
|
<Dialog.Trigger asChild>
|
|
17
|
-
<Button>
|
|
17
|
+
<Button>Open Dialog</Button>
|
|
18
18
|
</Dialog.Trigger>
|
|
19
19
|
<Dialog.Content>
|
|
20
20
|
<Heading size="sm" css={{ mb: '$3' }}>
|
|
@@ -31,4 +31,19 @@ Read more about the underlying UI component on the [Radix UI documentation site]
|
|
|
31
31
|
</Dialog>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
`Dialog` may be rendered without a close button. It's important to note that in case the default close button is hidden, one would need to provide an action button explicitly, to close the dialog.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<Dialog>
|
|
38
|
+
<Dialog.Trigger>Open Dialog</Dialog.Trigger>
|
|
39
|
+
<Dialog.Content showCloseButton={false}>
|
|
40
|
+
<Text>
|
|
41
|
+
Dialog.Close is used below to retain the correct accessible roles and
|
|
42
|
+
related logic
|
|
43
|
+
</Text>
|
|
44
|
+
<Button as={Dialog.Close}>Close</Button>
|
|
45
|
+
</Dialog.Content>
|
|
46
|
+
</Dialog>
|
|
47
|
+
```
|
|
48
|
+
|
|
34
49
|
For any modifications of the default `Dialog` visuals, for example bypassing the panel design entirely, we recommend utilising the Radix UI Dialog component directly. You will need to wrap each exported component within a `styled()` function to enable `css` and `as`, and compose together `Dialog.Overlay` and `Dialog.Close` within `Dialog.Content` to mimic the behaviour of this modal.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Notification Badge
|
|
3
|
+
component: NotificationBadge
|
|
4
|
+
description: A badge that wraps content and displays a notification
|
|
5
|
+
category: Feedback
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The NotificationBadge component is a lightweight wrapper for content such as ActionIcons, but can be wrapped around any block-level element.
|
|
9
|
+
|
|
10
|
+
It displays a badge in top right of the content it is wrapping, which displays a `value` passed in as a prop. This could be, for example, the number of filters selected on a select filters badge.
|
|
11
|
+
|
|
12
|
+
```tsx preview
|
|
13
|
+
<NotificationBadge value={3}>
|
|
14
|
+
<ActionIcon appearance="outline" size="lg" isRounded>
|
|
15
|
+
<Icon is={Controls} />
|
|
16
|
+
</ActionIcon>
|
|
17
|
+
</NotificationBadge>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Value
|
|
21
|
+
|
|
22
|
+
Whilst you would normally want to display a number, the `value` prop also supports strings. Here are some usage examples:
|
|
23
|
+
|
|
24
|
+
```tsx preview
|
|
25
|
+
<NotificationBadge value={88}>
|
|
26
|
+
<ActionIcon appearance="outline" size="lg">
|
|
27
|
+
<Icon is={Controls} />
|
|
28
|
+
</ActionIcon>
|
|
29
|
+
</NotificationBadge>
|
|
30
|
+
<NotificationBadge value="hi">
|
|
31
|
+
<Button theme="warning">I'm a button!</Button>
|
|
32
|
+
</NotificationBadge>
|
|
33
|
+
```
|
|
@@ -5,7 +5,8 @@ description: A search input with matching search icon
|
|
|
5
5
|
category: Form primitives
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
`SearchInput` wraps `Input` and adds an icon to visualise the specific input type, it's recommended to use this component when the user is performing a search query.
|
|
8
|
+
`SearchInput` wraps `Input` and adds an icon to visualise the specific input type, it's recommended to use this component when the user is performing a search query.
|
|
9
|
+
When the user types into the `SearchInput` the component renders a clear button that clears the typed value.
|
|
9
10
|
|
|
10
11
|
```tsx preview
|
|
11
12
|
<SearchInput name="search" css={{ width: 320 }} placeholder="Search" />
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Slider
|
|
3
|
+
component: Slider, Slider.Value, Slider.Steps
|
|
4
|
+
description: The slider component implements the Slider component from Radix, with default styling and the CSS prop.
|
|
5
|
+
category: Form primitives
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `Slider` is a simple component that renders a form slider.
|
|
9
|
+
|
|
10
|
+
The `Slider` component should be rendered with a label for accesibility reasons. Rather than using the `Slider` component directly, it is best to use the `SliderField` component, which provides a field label, a value label, and easily integrates with the `Form` component.
|
|
11
|
+
|
|
12
|
+
Should you wish to create a more complex UI with `Field` components, you should use this base component.
|
|
13
|
+
|
|
14
|
+
Please note: the `value` or `defaultValue` passed in should always be an array.
|
|
15
|
+
|
|
16
|
+
```tsx preview
|
|
17
|
+
<Slider defaultValue={[50]} css={{ width: '320px' }} />
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Multiple Values
|
|
21
|
+
|
|
22
|
+
Should you wish to have more than one control on the slider, you can pass those values in the array.
|
|
23
|
+
|
|
24
|
+
```tsx preview
|
|
25
|
+
<Slider defaultValue={[25, 75]} css={{ width: '320px' }} />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Slider.Steps
|
|
29
|
+
|
|
30
|
+
A separate component exists to output an array of labels which appear at given value points along the slider. These are passed in to the `steps` property using an array objects that contain a label and a value.
|
|
31
|
+
|
|
32
|
+
This is most commonly used within the `SliderField`, but is here in case you need to compose your own complex component.
|
|
33
|
+
|
|
34
|
+
Note: it is likely better to create steps as a constant and pass in with `steps={steps}` or similar, but this preview code cannot see values outside of JSX.
|
|
35
|
+
|
|
36
|
+
```tsx preview
|
|
37
|
+
<Slider defaultValue={[50]} css={{ width: '320px' }}>
|
|
38
|
+
<Slider.Steps
|
|
39
|
+
min={0}
|
|
40
|
+
max={100}
|
|
41
|
+
steps={[
|
|
42
|
+
{ value: 0, label: 'min' },
|
|
43
|
+
{ value: 50, label: 'mid' },
|
|
44
|
+
{ value: 100, label: 'max' }
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
</Slider>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The component requires min and max values, these should be the same as the optional values that are passed to the Slider component.
|
|
51
|
+
|
|
52
|
+
`Slider.Steps` work well with the built in `step` property, which defaults to 1 and changes the size of each movement. For example, this would limit the slider to three values only.
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Slider defaultValue={[50]} min={10} max={20} step={5}>
|
|
56
|
+
<Slider.Steps
|
|
57
|
+
min={10}
|
|
58
|
+
max={20}
|
|
59
|
+
steps={[
|
|
60
|
+
{ value: 10, label: 'min' },
|
|
61
|
+
{ value: 15, label: 'mid' },
|
|
62
|
+
{ value: 20, label: 'max' }
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
</Slider>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Slider.Value
|
|
69
|
+
|
|
70
|
+
A separate component exists to output the value from a slider. This is most commonly used within the `SliderField`, but is here in case you need to compose your own complex component.
|
|
71
|
+
|
|
72
|
+
```tsx preview
|
|
73
|
+
<Slider defaultValue={[50]} css={{ width: '320px' }}>
|
|
74
|
+
{/**
|
|
75
|
+
* The Slider.Value value must be manually controlled using onValueChange
|
|
76
|
+
* from Slider. This is a visual example of how would render Slider.Value
|
|
77
|
+
* and will not update when changed.
|
|
78
|
+
*/}
|
|
79
|
+
<Slider.Value value={[50]} />
|
|
80
|
+
</Slider>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
By default this simply outputs the value, however, this can be customised in a number of ways. The property `outputLabel` accepts a function that passes the value selected in the slider and expects a string returned for the label.
|
|
84
|
+
|
|
85
|
+
You can also use this is in more complex ways, for example to set empty states and pluralisation, like below.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<Slider defaultValue={[50]} css={{ width: '320px' }}>
|
|
89
|
+
<Slider.Value
|
|
90
|
+
value={[50]}
|
|
91
|
+
outputLabel={(value) =>
|
|
92
|
+
value === 0
|
|
93
|
+
? 'You have no geese'
|
|
94
|
+
: `You have ${value} ${value === 1 ? 'goose' : 'geese'}`
|
|
95
|
+
}
|
|
96
|
+
/>
|
|
97
|
+
</Slider>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Should you wish to use the label with multiple values, you can use `Array.join()` like below.
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
<Slider.Value
|
|
104
|
+
value={[25, 75]}
|
|
105
|
+
outputLabel={(value) => `You have between ${value.join(' and ')} geese`}
|
|
106
|
+
/>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Styling
|
|
110
|
+
|
|
111
|
+
Depending on the background of your page, you can change the theme of the track to be either light or tonal using `theme="light"`. Default is `theme="tonal"`.
|
|
112
|
+
|
|
113
|
+
```tsx preview
|
|
114
|
+
<Box css={{ p: '$5', bg: '$tonal100' }}>
|
|
115
|
+
<Slider theme="light" defaultValue={[50]} css={{ width: '320px' }} />
|
|
116
|
+
</Box>
|
|
117
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Slider Field
|
|
3
|
+
component: SliderField
|
|
4
|
+
description: Combines a Slider with a label and form integration.
|
|
5
|
+
category: Form fields
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
`SliderField` renders a `Slider` with a label, and easy implementation with `Form`. It also renders a `Slider.Value` label underneath the slider, and a `Slider.Steps` component should steps be passed in.
|
|
9
|
+
|
|
10
|
+
In it's most simple form, a slider allows one value to be set between two given values (default 0 and 100).
|
|
11
|
+
|
|
12
|
+
Please note: the `value` or `defaultValue` passed in should always be an array.
|
|
13
|
+
|
|
14
|
+
```tsx preview
|
|
15
|
+
<Form>
|
|
16
|
+
<SliderField name="slider" label="Select a value" defaultValue={[50]} />
|
|
17
|
+
</Form>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
With optional `Slider.Steps`:
|
|
21
|
+
|
|
22
|
+
```tsx preview
|
|
23
|
+
<Form>
|
|
24
|
+
<SliderField
|
|
25
|
+
name="slider"
|
|
26
|
+
label="Select a value (now with steps)"
|
|
27
|
+
defaultValue={[50]}
|
|
28
|
+
steps={[
|
|
29
|
+
{ value: 0, label: 'min' },
|
|
30
|
+
{ value: 50, label: 'mid' },
|
|
31
|
+
{ value: 100, label: 'max' }
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
34
|
+
</Form>
|
|
35
|
+
```
|
package/dist/docs/Table.mdx
CHANGED
|
@@ -122,3 +122,17 @@ The `Table` component has 2 size variants that control the row height. The two a
|
|
|
122
122
|
</Table.Body>
|
|
123
123
|
</Table>
|
|
124
124
|
```
|
|
125
|
+
|
|
126
|
+
The `Table` component by default renders with a slight border radius. If you want to remove this, for example if you are rendering the `Table` inside another component that has border radius, you can remove this by setting `corners="square"`. The default is `corners="round"`.
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
<Table corners="square">...</Table>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`Table.Header` accepts a theme prop, the current available options are `primary` and `primaryDark`. The default is `primaryDark`.
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
<Table>
|
|
136
|
+
<Table.Header theme="primary">...</Table.Header>
|
|
137
|
+
</Table>
|
|
138
|
+
```
|
package/dist/docs/Tabs.mdx
CHANGED
|
@@ -27,15 +27,23 @@ The component provides a set of default styles, which can be overwritten by usin
|
|
|
27
27
|
</Tabs>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
It
|
|
30
|
+
It takes a `defaultValue` prop that should match one of the triggers' `value` prop.
|
|
31
31
|
|
|
32
32
|
```tsx
|
|
33
33
|
<Tabs defaultValue="tab1">
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
It also takes a `theme` prop that should either be "light" or "dark".
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<Tabs theme="light"></Tabs>
|
|
40
|
+
<Tabs theme="dark"></Tabs>
|
|
41
|
+
```
|
|
42
|
+
|
|
36
43
|
## Tabs.TriggerList
|
|
37
44
|
|
|
38
45
|
The `Tabs.TriggerList` component simply holds the individual `Tabs.Trigger` components. It can also get custom styling via the `css` prop.
|
|
46
|
+
`Tabs.TriggerList` will automatically show `<` & `>` buttons in case the content is overshooting the available space.
|
|
39
47
|
|
|
40
48
|
## Tabs.Trigger
|
|
41
49
|
|
|
@@ -62,6 +70,21 @@ A `Tabs.Trigger` component can take a `disabled` prop, which would make it unsel
|
|
|
62
70
|
</Tabs>
|
|
63
71
|
```
|
|
64
72
|
|
|
73
|
+
## Styling the `Tabs.TriggerList`
|
|
74
|
+
|
|
75
|
+
The trigger list accepts an appearance property to apply uppercase to all tabs. Simply pass `appearance='uppercase'`.
|
|
76
|
+
|
|
77
|
+
```tsx preview
|
|
78
|
+
<Tabs>
|
|
79
|
+
<Tabs.TriggerList appearance="uppercase">
|
|
80
|
+
<Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
|
|
81
|
+
<Tabs.Trigger value="tab2">Tab 2</Tabs.Trigger>
|
|
82
|
+
</Tabs.TriggerList>
|
|
83
|
+
<Tabs.Content value="tab1">Content for tab 1</Tabs.Content>
|
|
84
|
+
<Tabs.Content value="tab2">Content for the second tab.</Tabs.Content>
|
|
85
|
+
</Tabs>
|
|
86
|
+
```
|
|
87
|
+
|
|
65
88
|
## Styling the `Tabs.Trigger`
|
|
66
89
|
|
|
67
90
|
In order to style the different states of a trigger, the following CSS selectors need to be used when passed to the `css` prop:
|