`, ``, ` `...).
Since **Table** implementation is handled by the integrator, we recommend referring to the [WCAG guidelines](https://www.w3.org/WAI/tutorials/tables) for accessible tables.
## Table
# Table
## Table
This component extends all the native `` attributes.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `size` | `'lg' | 'md' | 'sm'` | No | undefined | The size preset to use. |
| `striped` | `boolean` | No | undefined | Whether the body rows should alternate background colors. |
## Enums
### TABLE_SIZE
- `lg` = `lg`
- `md` = `md`
- `sm` = `sm`
## CSS Variables
| Variable | Default value |
|---|---|
| `--ods-table-striped-background-color` | `var(--ods-semantic-color-surface-muted)` |
| `--ods-table-border-color` | `var(--ods-semantic-color-border-separator)` |
| `--ods-table-cell-padding-horizontal-sm` | `var(--ods-semantic-size-space-inset-inline)` |
| `--ods-table-cell-padding-vertical-sm` | `var(--ods-semantic-size-space-inset-block)` |
| `--ods-table-cell-padding-horizontal-md` | `var(--ods-semantic-size-space-inset-inline)` |
| `--ods-table-cell-padding-vertical-md` | `calc(var(--ods-semantic-size-space-inset-block) * 2)` |
| `--ods-table-cell-padding-horizontal-lg` | `var(--ods-semantic-size-space-inset-inline)` |
| `--ods-table-cell-padding-vertical-lg` | `calc(var(--ods-semantic-size-space-inset-block) * 3)` |
| `--ods-table-head-background-color` | `var(--ods-semantic-color-surface-header)` |
## Table
# Table
## Default
```tsx
Front-end web developer course 2021
Person
Most interest in
Age
Chris
HTML tables
22
Dennis
Web accessibility
45
Sarah
JavaScript frameworks
29
Karen
Web performance
36
```
## Size
```tsx
<>
Front-end web developer course 2021
Person
Most interest in
Age
Chris
HTML tables
22
Dennis
Web accessibility
45
Sarah
JavaScript frameworks
29
Karen
Web performance
36
Front-end web developer course 2021
Person
Most interest in
Age
Chris
HTML tables
22
Dennis
Web accessibility
45
Sarah
JavaScript frameworks
29
Karen
Web performance
36
Front-end web developer course 2021
Person
Most interest in
Age
Chris
HTML tables
22
Dennis
Web accessibility
45
Sarah
JavaScript frameworks
29
Karen
Web performance
36
>
```
## Striped
```tsx
<>
Front-end web developer course 2021
Person
Most interest in
Age
Chris
HTML tables
22
Dennis
Web accessibility
45
Sarah
JavaScript frameworks
29
Karen
Web performance
36
Front-end web developer course 2021
Person
Most interest in
Age
Chris
HTML tables
22
Dennis
Web accessibility
45
Sarah
JavaScript frameworks
29
Karen
Web performance
36
>
```
## Custom Caption
```tsx
Front-end web developer course 2021
Person
Most interest in
Age
Chris
HTML tables
22
Dennis
Web accessibility
45
Sarah
JavaScript frameworks
29
Karen
Web performance
36
```
## Tabs
# Tabs
_**Tabs** are a way of navigating between multiple panels, reducing clutter and fitting more into a smaller space_
## Props
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `defaultValue` | `string` | No | undefined | The initial value of the selected tab. Use when you don't need to control the value of the tabs. |
| `mountStrategy` | `TABS_MOUNT_STRATEGY` | No | 'keep' | When the content of the inactive panels is rendered: always ('keep'), from the first time it is shown ('lazy') or only while it is shown ('unmount'). Each TabContent can override it. SEO: only 'keep' puts the content of the inactive panels in the server-rendered HTML, so it can be indexed. |
| `onValueChange` | `(event: TabsValueChangeEvent) => void` | No | undefined | Callback fired when the state of selected tab changes. |
| `size` | `'md' | 'sm' | 'xs'` | No | undefined | The size preset to use. |
| `value` | `string` | No | undefined | The controlled value of the selected tab. |
| `variant` | `'default' | 'switch'` | No | undefined | The variant preset to use. |
| `withArrows` | `boolean` | No | undefined | Whether the component displays navigation arrows around the tabs. |
## Examples
- Default
- Variant
- Size
- Disabled
- Overflow
- With Arrows
- With Content
- Product Detail
- Controlled
- Controlled With Navigation
- Mount Strategy
## Documentation pages
- [Documentation](./react-components-tabs--documentation.txt)
- [Technical Information](./react-components-tabs--technical-information.txt)
- [Examples](./react-components-tabs--examples.txt)
## Tabs
# Tabs
_**Tabs** are a way of navigating between multiple panels, reducing clutter and fitting more into a smaller space_
## Overview
**Tabs** are used to organize content by grouping similar information on the same page.
| | |
|---|---|
| Name | Tabs |
| Also known as | Tab Navigation, Tabbed interface |
| Design | https://www.figma.com/design/9jDDTcR4a9jPRFcdjawAlf/ODS---UI-Kit?node-id=52-11168 |
| Source | https://github.com/ovh/design-system/tree/master/packages/ods-react/src/components/tabs |
## Usage
**Tabs** component is ideal for dashboards, settings pages, profile sections, and any interface where multiple views need to be accessible from the same page.
They can also be used to filter content via some common denominator.
### Dos & Don'ts
**Do**
- Use Tabs to group related content under the same page when it fits in a shared context
- Keep Tab labels short, clear, and scannable, use nouns or very short phrases (1–3 words max)
- Use Tabs for horizontal navigation, not hierarchical structure or progressive steps
- Do use default Tabs for main navigation
- Do use switch variant when Tabs act as a mode selector or view switcher (e.g., toggling between "List" and "Grid" views)
**Don't**
- Don't use Tabs as a progress indicator or wizard steps
- Don't nest Tabs inside other Tabs, this creates a confusing and hard-to-navigate experience
- Don't overload the interface with too many tabs. Use dropdowns if you need more than 5 tabs
- Don't use long or verbose labels
- Don't use external links or actions as tab triggers, Tabs should only control the visibility of in-page content
- Avoid using the switch variant for main navigation or complex page segmentation. Prefer the default Tabs for those cases instead
### Best Practices in Context
1. **Tabs**
2. **Scroll Buttons (previous/next) - optional**
3. **Active tab**
4. **Unselected tab**
## Placement
**Tabs** are often used in the top part of a web page, as it can act as a navigation focus.
## Behavior
By default, one of the **Tab** is always selected.
Each **Tab** can be hovered, focused and selected. A **Tab** can also act as a disabled **Tab**.
**Tabs** always stay on the same line, and can be horizontally scrolled through if they happen to not fit their container.
Each **Tab** has a panel displaying content. Selecting a **Tab** displays the corresponding panel.
The panel does not depend on the **Tab** component, it is in the developer's hands.
### Scroll Buttons
When the number of **Tabs** exceeds the visible container width, left and right scroll buttons can be displayed to allow horizontal navigation.
Clicking a button scrolls to the next or previous group of **Tabs** that were not visible.
When at the first tab, the left button is displayed but disabled.
When at the last tab, the right button is displayed but disabled.
Scroll buttons do not affect tab selection. They only change the visible portion of the **Tabs** list.
### Panel content rendering
By default, the content of every panel is rendered, and inactive panels are hidden. Use the `mountStrategy` prop on **Tabs** to choose when the content of inactive panels is rendered:
- `keep` (default): the content of every panel is always rendered, inactive panels are only hidden.
- `lazy`: the content of a panel is rendered the first time its **Tab** is selected, then kept like `keep`.
- `unmount`: the content of a panel is rendered only while its **Tab** is selected, and removed when another **Tab** is selected.
Each **TabContent** can set its own `mountStrategy`, which overrides the **Tabs** one for this panel only.
The panel element itself (with its `id`, `role="tabpanel"` and `aria-labelledby`) is always rendered, only its content depends on the strategy.
```tsx
Overview
Metrics
Search
FAQ
Rendered on load, as it is the selected tab.
Rendered the first time this tab is shown, then kept.
Always rendered, so it stays in the server-rendered HTML and can be indexed.
```
**SEO**: only `keep` puts the content of the inactive panels in the server-rendered HTML. With `lazy` and `unmount`, this content is not indexed by search engines, as they do not load content that requires a user interaction. Use them only for heavy content that does not need to be indexed, like dashboards, charts or iframes.
**State loss**: with `unmount`, the content of a panel is removed each time it is hidden. Its state is lost (input values, scroll position, component state, ...) and it is rendered again from scratch the next time it is shown. Use `lazy` if this state must be kept.
If you come from another library, here is how its props translate to `mountStrategy`:
Other libraries
ODS mountStrategy
`keepMounted` (MUI, Base UI, Mantine), `forceMount` (Radix), `unmount={ false }` (Headless UI)
`keep`
`lazyMount` (Ark UI, Chakra UI)
`lazy`
`lazyMount` + `unmountOnExit` (Ark UI, Chakra UI), `unmount` (Headless UI)
`unmount`
## Variation
### Default (standard Tabs)
Used for displaying and organizing related content within the same page or view.
The default **Tabs** variant follows the standard horizontal layout, with a clear underline or border to indicate the active state.
It is ideal for primary navigation within a section or module.
### Switch (sub-navigation)
The switch variant is visually distinct of **Tabs**, designed for switching between sub-views or modes within the same context.
It behaves as a lightweight navigation switch between views.
## Navigation
### Focus Management
When focus moves to the **Tabs** component, it is set on the active **Tab**.
Once a **Tab** is focused, its associated content is also activated.
### General Keyboard Shortcuts
Pressing `Tab` moves focus into or out of the **Tabs** component while keeping the active **Tab** selected.
Pressing `Arrow Right` moves focus to the next **Tab** and activates its content.
Pressing `Arrow Left` moves focus to the previous **Tab** and activates its content.
Pressing `Home` / `fn` + `Arrow Left` moves focus to the first **Tab** and activates its content.
Pressing `End` / `fn` + `Arrow Right` moves focus to the last **Tab** and activates its content.
Pressing `Home` / `End` jumps to the first or last **Tab**, even if these **Tabs** are not currently visible. In this case, the **Tabs** list automatically scrolls to bring the selected **Tab** into view.
Arrow navigation moves focus to the next or previous **Tab**, even if it is not currently visible. In this case, the **Tabs** list automatically scrolls to bring the focused **Tab** into view.
## Accessibility
This component complies with the [Tabs WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/).
## Tabs
# Tabs
## Tabs
This component extends all the native `` attributes.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `defaultValue` | `string` | No | undefined | The initial value of the selected tab. Use when you don't need to control the value of the tabs. |
| `mountStrategy` | `TABS_MOUNT_STRATEGY` | No | 'keep' | When the content of the inactive panels is rendered: always ('keep'), from the first time it is shown ('lazy') or only while it is shown ('unmount'). Each TabContent can override it. SEO: only 'keep' puts the content of the inactive panels in the server-rendered HTML, so it can be indexed. |
| `onValueChange` | `(event: TabsValueChangeEvent) => void` | No | undefined | Callback fired when the state of selected tab changes. |
| `size` | `'md' | 'sm' | 'xs'` | No | undefined | The size preset to use. |
| `value` | `string` | No | undefined | The controlled value of the selected tab. |
| `variant` | `'default' | 'switch'` | No | undefined | The variant preset to use. |
| `withArrows` | `boolean` | No | undefined | Whether the component displays navigation arrows around the tabs. |
## Tab
This component extends all the native `
` attributes.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `value` | `string` | Yes | undefined | The value of the tab item. |
## TabContent
This component extends all the native `` attributes.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `mountStrategy` | `TABS_MOUNT_STRATEGY` | No | undefined | When the content of this panel is rendered while it is inactive. Overrides the Tabs mountStrategy for this panel only. SEO: with 'lazy' or 'unmount', the content of this panel is in the server-rendered HTML only if it is the selected one. |
| `value` | `string` | Yes | undefined | The value of the tab content item. |
## TabList
This component extends all the native `
` attributes.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `i18n` | `Partial
` | No | undefined | Internal translations override. |
| `locale` | `'de' | 'en' | 'es' | 'fr' | 'it' | 'nl' | 'pl' | 'pt'` | No | undefined | The locale used for the translation of the internal elements. |
## Enums
### TABS_I18N
- `scrollLeftButton` = `tabs.scroll.left.button`
- `scrollRightButton` = `tabs.scroll.right.button`
### TABS_MOUNT_STRATEGY
- `keep` = `keep`
- `lazy` = `lazy`
- `unmount` = `unmount`
### TABS_SIZE
- `md` = `md`
- `sm` = `sm`
- `xs` = `xs`
### TABS_VARIANT
- `default` = `default`
- `switch` = `switch`
## CSS Variables
| Variable | Default value |
|---|---|
| `--ods-tab-list-background-color-switch` | `var(--ods-semantic-color-surface-segmented)` |
| `--ods-tab-list-border-color` | `var(--ods-semantic-color-border-track)` |
| `--ods-tab-list-border-radius-switch-md` | `calc(var(--ods-semantic-size-radius-container) * 1.25)` |
| `--ods-tab-list-border-radius-switch-sm` | `calc(var(--ods-semantic-size-radius-container) * 0.75)` |
| `--ods-tab-list-border-radius-switch-xs` | `calc(var(--ods-semantic-size-radius-container) / 2)` |
| `--ods-tab-list-border-width` | `2px` |
| `--ods-tab-margin-horizontal-switch-md` | `calc(var(--ods-semantic-size-space-inset-inline) / 2)` |
| `--ods-tab-margin-horizontal-switch-sm` | `calc(var(--ods-semantic-size-space-inset-inline) / 2)` |
| `--ods-tab-margin-horizontal-switch-xs` | `calc(var(--ods-semantic-size-space-inset-inline) / 4)` |
| `--ods-tab-margin-vertical-switch-md` | `calc(var(--ods-semantic-size-space-inset-block) / 2)` |
| `--ods-tab-margin-vertical-switch-sm` | `calc(var(--ods-semantic-size-space-inset-block) / 2)` |
| `--ods-tab-margin-vertical-switch-xs` | `calc(var(--ods-semantic-size-space-inset-block) / 4)` |
| `--ods-tab-padding-horizontal-md` | `calc(var(--ods-semantic-size-space-inset-inline) * 1.5)` |
| `--ods-tab-padding-horizontal-sm` | `var(--ods-semantic-size-space-inset-inline)` |
| `--ods-tab-padding-horizontal-xs` | `calc(var(--ods-semantic-size-space-inset-inline) * 0.75)` |
| `--ods-tab-padding-vertical-md` | `var(--ods-semantic-size-space-inset-inline)` |
| `--ods-tab-padding-vertical-sm` | `calc(var(--ods-semantic-size-space-inset-inline) * 0.75)` |
| `--ods-tab-padding-vertical-xs` | `calc(var(--ods-semantic-size-space-inset-inline) / 2)` |
| `--ods-tab-background-color-hover` | `var(--ods-semantic-color-interaction-highlight)` |
| `--ods-tab-background-color-selected-switch` | `var(--ods-semantic-color-surface-raised)` |
| `--ods-tab-border-color-selected-switch` | `var(--ods-semantic-color-border-control)` |
| `--ods-tab-border-color` | `var(--ods-tab-list-border-color)` |
| `--ods-tab-border-color-hover` | `var(--ods-semantic-color-interaction-track-hover)` |
| `--ods-tab-border-radius-md` | `var(--ods-semantic-size-radius-container)` |
| `--ods-tab-border-radius-sm` | `calc(var(--ods-semantic-size-radius-container) / 2)` |
| `--ods-tab-border-radius-xs` | `calc(var(--ods-semantic-size-radius-container) / 4)` |
| `--ods-tab-text-color-hover` | `var(--ods-semantic-color-content-text)` |
| `--ods-state-is-disabled-opacity` | `var(--ods-semantic-opacity-disabled)` |
## Tabs
# Tabs
## Default
```tsx
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
```
## Variant
```tsx
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
```
## Size
```tsx
<>
MD
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
SM
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
XS
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
>
```
## Disabled
```tsx
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
```
## Overflow
```tsx
Tab 1
Tab 2
Tab 3
Tab 4
Tab 5
Tab 6
Content 1
Content 2
Content 3
Content 4
Content 5
Content 6
```
## With Arrows
```tsx
Tab 1
Tab 2
Tab 3
Tab 4
Tab 5
Tab 6
Tab 7
Tab 8
Tab 9
Tab 10
Tab 11
Tab 12
Tab 13
Tab 14
Tab 15
Content 1
Content 2
Content 3
Content 4
Content 5
Content 6
Content 7
Content 8
Content 9
Content 10
Content 11
Content 12
Content 13
Content 14
Content 15
```
## With Content
```tsx
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
```
## Product Detail
```tsx
Description
Specifications
Reviews
A high-performance cloud server with 32 vCPUs, 128 GB RAM, and NVMe storage.
CPU: 32 vCPUs
RAM: 128 GB DDR4
Storage: 2 × 960 GB NVMe SSD
Network: 1 Gbps
Rating: 4.8 / 5 based on 142 reviews
"Excellent performance for our production workloads." — J. Martin
```
## Controlled
```tsx
{
const [value, setValue] = useState('tab1');
const handleValueChange = (event: TabsValueChangeEvent) => {
setValue(event.value);
};
return (
Tab 1
Tab 2
Tab 3
Content 1
Content 2
Content 3
);
}
```
## Controlled With Navigation
```tsx
{
const tabs = [
{ value: 'account', label: 'Account' },
{ value: 'security', label: 'Security' },
{ value: 'notifications', label: 'Notifications' },
{ value: 'billing', label: 'Billing' },
];
const [active, setActive] = useState('account');
const currentIndex = tabs.findIndex((t) => t.value === active);
return (
setActive(e.value) }>
{ tabs.map((tab) => (
{ tab.label }
)) }
{ tabs.map((tab) => (
{ tab.label } settings
)) }
setActive(tabs[currentIndex - 1].value) }>
← Previous
setActive(tabs[currentIndex + 1].value) }>
Next →
);
}
```
## Mount Strategy
```tsx
Overview
Metrics
Search
FAQ
Rendered on load, as it is the selected tab.
Rendered the first time this tab is shown, then kept.
Always rendered, so it stays in the server-rendered HTML and can be indexed.
```
## Tag
# Tag
_A **Tag** component is used to display keywords or categories, with a removal feature._
## Props
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `icon` | `'accessibility' | 'accessibility-full' | 'analysis' | 'arrow-crossed' | 'arrow-down' | 'arrow-down-left' | 'arrow-down-right' | 'arrow-left' | 'arrow-left-right' | 'arrow-right' | 'arrow-up' | 'arrow-up-down' | 'arrow-up-left' | 'arrow-up-right' | 'bell' | 'bill' | 'blog' | 'book' | 'box' | 'brain' | 'building' | 'cable' | 'calculator' | 'calendar' | 'castle' | 'chain-link' | 'check' | 'chevron-double-left' | 'chevron-double-right' | 'chevron-down' | 'chevron-left' | 'chevron-left-slash' | 'chevron-left-underscore' | 'chevron-right' | 'chevron-up' | 'circle-check' | 'circle-check-full' | 'circle-info' | 'circle-info-full' | 'circle-question' | 'circle-question-full' | 'circle-three-nodes' | 'circle-user' | 'circle-xmark' | 'circle-xmark-full' | 'clock-time-four' | 'clock-time-nine' | 'clock-time-six' | 'clock-time-three' | 'clock-time-twelve' | 'cloud' | 'cloud-check' | 'cloud-download' | 'cloud-lock' | 'cloud-upload' | 'cloud-xmark' | 'cog' | 'columns' | 'comment' | 'cpu' | 'credit-card' | 'crown' | 'd-pad' | 'diagnostic' | 'diamond-exclamation' | 'diamond-exclamation-full' | 'diamonds-full' | 'discord' | 'disk' | 'download' | 'drag-drop' | 'ellipsis-horizontal' | 'ellipsis-vertical' | 'email' | 'emoticon' | 'emoticon-dizzy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'emoticon-wink' | 'equal' | 'external-link' | 'eye' | 'eye-off' | 'facebook' | 'fiber' | 'file' | 'file-copy' | 'file-minus' | 'file-plus' | 'filter' | 'flame' | 'flask-empty' | 'flask-full' | 'flask-half' | 'floppy' | 'focus' | 'folder' | 'folder-minus' | 'folder-plus' | 'funnel' | 'game-console' | 'game-controller' | 'game-controller-alt' | 'gathering' | 'gift' | 'github' | 'globe' | 'grid' | 'grid-alt' | 'hamburger-menu' | 'handshake' | 'headphones' | 'heart' | 'heart-full' | 'heart-half' | 'hexagon-exclamation' | 'hexagon-exclamation-full' | 'hierarchy' | 'history' | 'home' | 'key' | 'keyboard' | 'leaf' | 'lifebuoy' | 'lightbulb' | 'lightning' | 'linkedin' | 'list' | 'location' | 'lock-close' | 'lock-open' | 'magic-wand' | 'magnifying-glass' | 'meter' | 'mic' | 'mic-off' | 'minus' | 'money' | 'money-bag-default' | 'money-bag-dollar' | 'money-bag-euro' | 'monitor' | 'moon' | 'network' | 'paperclip' | 'pause' | 'pause-full' | 'pen' | 'percent' | 'phone' | 'piggy-bank' | 'pin' | 'pin-off' | 'play' | 'play-full' | 'plus' | 'printer' | 'question' | 'reddit' | 'refresh' | 'resize' | 'robot' | 'server' | 'server-rack' | 'share-nodes' | 'share-screen' | 'shield' | 'shield-check' | 'shield-exclamation' | 'shield-firewall' | 'shield-lock' | 'shield-minus' | 'shield-off' | 'shield-plus' | 'shield-xmark' | 'shopping-cart' | 'shopping-cart-error' | 'shopping-cart-minus' | 'shopping-cart-plus' | 'shopping-cart-xmark' | 'shrink' | 'shutdown' | 'snowflake' | 'sort-alpha-down' | 'sort-alpha-up' | 'sort-numeric-down' | 'sort-numeric-up' | 'sparkle' | 'split-horizontal' | 'split-vertical' | 'ssl-key' | 'star' | 'star-full' | 'star-half' | 'stop' | 'stop-full' | 'store' | 'suitcase' | 'sun' | 'sync' | 'tag' | 'target' | 'theme' | 'thumbs-down' | 'thumbs-up' | 'timer' | 'traffic-cone' | 'trash' | 'triangle-exclamation' | 'triangle-exclamation-full' | 'triangle-three-nodes' | 'truck' | 'twitch' | 'undo' | 'upload' | 'user' | 'user-full' | 'vault' | 'x' | 'xmark' | 'youtube' | null` | No | undefined | The icon to display on the right side. |
| `size` | `'lg' | 'md'` | No | undefined | The size preset to use. |
| `status` | `TAG_STATUS` | No | undefined | The status preset to use. |
## Examples
- Default
- Status
- Disabled
- Size
- Custom Icon
- Accessibility List
- Accessibility Aria Roles
- Accessibility Aria Label
## Documentation pages
- [Documentation](./react-components-tag--documentation.txt)
- [Technical Information](./react-components-tag--technical-information.txt)
- [Examples](./react-components-tag--examples.txt)
## Tag
# Tag
_A **Tag** component is used to display keywords or categories, with a removal feature._
## Overview
The **Tag** component is a small UI element used to represent metadata, keywords, categories, or other contextual
information.
**Tags** are removable and can include an icon as additional prefix element.
They are commonly used in interfaces for categorizing content, filtering, and adding contextual details.
| | |
|---|---|
| Name | Tag |
| Also known as | Chip (previous name), Label, Pill |
| Design | https://www.figma.com/design/9jDDTcR4a9jPRFcdjawAlf/ODS---UI-Kit?node-id=52-11580 |
| Source | https://github.com/ovh/design-system/tree/master/packages/ods-react/src/components/tag |
## Usage
Use the **Tag** component to display labels, categories, or metadata that describe or classify content.
**Tags** often appear in contexts like filters and lists.
Ensure that **Tags** are clearly labelled and easily distinguishable from other UI elements.
### Dos & Don'ts
**Do**
- Use Tags to represent interactive labels such as filters, categories, or user-defined keywords
- Ensure the label is short, descriptive, and scannable, aim for 1–2 words
- Use Tags in search contexts, facet filtering, or content classification
- Allow Tags to be removable or toggleable if the interaction requires it (e.g., deselecting a filter)
- Keep visual distinction between Tags (interactive) and Badges (static)
- Trigger removal action when the Tag displays a delete icon
**Don't**
- Don't use a Tag if there is no interaction expected, prefer the Badge component instead
- Don't use full sentences or long text in a Tag label
- Don't mix Tags with different behaviors (e.g., some removable, some static) unless necessary and clearly indicated
- Don't use Tags as primary action triggers (e.g., "Submit", "Save"), use Buttons instead
### Best Practices in Context
1. **Tag**
2. **Icon** - optional (left or right)
3. **Delete icon** - optional
4. **Label** - optional
## Placement
Since it provides extra information to a sibling element, in can be used inside components in various places, referring to the nature of its environment.
Multiple **Tags** can be displayed:
- on a single line
- stacked vertically
## Behavior
**Tags** can be hovered, focused and disabled.
## Variation
### Status
- **Accent**: highlighting labels tied to the brand, without conveying any particular status.
- **Neutral**: displaying general labels or metadata without conveying any particular status or urgency.
- **Information** _(default)_: displaying a general information for the user, without conveying any particular urgency.
- **Success**: indicating positive statuses or successful outcomes, providing a visual cue for achievements or completed tasks.
- **Warning**: alerting users to potential issues or cautionary information, signaling that attention is needed.
- **Critical**: highlighting severe issues or urgent information that requires immediate attention, emphasizing high-priority concerns.
### Size
- **Medium** _(default)_: main size for displaying **Tags**.
- **Large**: highlighting important labels or metadata with greater visibility and emphasis, making them easily noticeable to users.
## Navigation
### Focus Management
The **Tag** component is focusable and follows the same keyboard interactions as the Button component.
### General Keyboard Shortcuts
Pressing `Tab` moves focus to the **Tag**.
Pressing `Enter` or `Space` triggers the assigned action: removing the **Tag**.
Pressing `Shift` + `Tab` moves focus to the previous interactive element.
## Accessibility
Unlike [Badge](https://ovh.github.io/design-system/v20.0.0/components/badge),
**Tags** are interactive and can be removed by the user.
To ensure accessibility, it is important to:
- Group **Tags** properly when they are part of a list.
- Announce the removal action so screen reader users understand the functionality.
### Structuring groups of Tags with lists
When multiple **Tags** are displayed together (e.g., a collection of selected filters or labels),
they should be wrapped in an unordered list of items (`` and ``) to ensure proper announcement by screen readers.
```tsx
Design
Development
Accessibility
```
This allows screen readers to announce a list with the number of items, making it clear that these **Tags** belong to a structured set.
### Alternative approach
When modifying the HTML structure is not possible,
use [role="list"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/list_role) and [role="listitem"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/listitem_role) to mimic list semantics.
```tsx
Design
Development
Accessibility
```
This ensures that screen readers still recognize the **Tags** as a structured list, even without native `` and `` elements.
### Announcing the delete action with aria-label
Since the **Tag** is removable, it should provide clear feedback to assistive technologies.
```tsx
My tag
```
This ensures that users know the **Tag** can be removed. Screen readers will announce the tag aria label and the button type.
## Tag
# Tag
## Tag
This component extends all the native `` attributes.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `icon` | `'accessibility' | 'accessibility-full' | 'analysis' | 'arrow-crossed' | 'arrow-down' | 'arrow-down-left' | 'arrow-down-right' | 'arrow-left' | 'arrow-left-right' | 'arrow-right' | 'arrow-up' | 'arrow-up-down' | 'arrow-up-left' | 'arrow-up-right' | 'bell' | 'bill' | 'blog' | 'book' | 'box' | 'brain' | 'building' | 'cable' | 'calculator' | 'calendar' | 'castle' | 'chain-link' | 'check' | 'chevron-double-left' | 'chevron-double-right' | 'chevron-down' | 'chevron-left' | 'chevron-left-slash' | 'chevron-left-underscore' | 'chevron-right' | 'chevron-up' | 'circle-check' | 'circle-check-full' | 'circle-info' | 'circle-info-full' | 'circle-question' | 'circle-question-full' | 'circle-three-nodes' | 'circle-user' | 'circle-xmark' | 'circle-xmark-full' | 'clock-time-four' | 'clock-time-nine' | 'clock-time-six' | 'clock-time-three' | 'clock-time-twelve' | 'cloud' | 'cloud-check' | 'cloud-download' | 'cloud-lock' | 'cloud-upload' | 'cloud-xmark' | 'cog' | 'columns' | 'comment' | 'cpu' | 'credit-card' | 'crown' | 'd-pad' | 'diagnostic' | 'diamond-exclamation' | 'diamond-exclamation-full' | 'diamonds-full' | 'discord' | 'disk' | 'download' | 'drag-drop' | 'ellipsis-horizontal' | 'ellipsis-vertical' | 'email' | 'emoticon' | 'emoticon-dizzy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'emoticon-wink' | 'equal' | 'external-link' | 'eye' | 'eye-off' | 'facebook' | 'fiber' | 'file' | 'file-copy' | 'file-minus' | 'file-plus' | 'filter' | 'flame' | 'flask-empty' | 'flask-full' | 'flask-half' | 'floppy' | 'focus' | 'folder' | 'folder-minus' | 'folder-plus' | 'funnel' | 'game-console' | 'game-controller' | 'game-controller-alt' | 'gathering' | 'gift' | 'github' | 'globe' | 'grid' | 'grid-alt' | 'hamburger-menu' | 'handshake' | 'headphones' | 'heart' | 'heart-full' | 'heart-half' | 'hexagon-exclamation' | 'hexagon-exclamation-full' | 'hierarchy' | 'history' | 'home' | 'key' | 'keyboard' | 'leaf' | 'lifebuoy' | 'lightbulb' | 'lightning' | 'linkedin' | 'list' | 'location' | 'lock-close' | 'lock-open' | 'magic-wand' | 'magnifying-glass' | 'meter' | 'mic' | 'mic-off' | 'minus' | 'money' | 'money-bag-default' | 'money-bag-dollar' | 'money-bag-euro' | 'monitor' | 'moon' | 'network' | 'paperclip' | 'pause' | 'pause-full' | 'pen' | 'percent' | 'phone' | 'piggy-bank' | 'pin' | 'pin-off' | 'play' | 'play-full' | 'plus' | 'printer' | 'question' | 'reddit' | 'refresh' | 'resize' | 'robot' | 'server' | 'server-rack' | 'share-nodes' | 'share-screen' | 'shield' | 'shield-check' | 'shield-exclamation' | 'shield-firewall' | 'shield-lock' | 'shield-minus' | 'shield-off' | 'shield-plus' | 'shield-xmark' | 'shopping-cart' | 'shopping-cart-error' | 'shopping-cart-minus' | 'shopping-cart-plus' | 'shopping-cart-xmark' | 'shrink' | 'shutdown' | 'snowflake' | 'sort-alpha-down' | 'sort-alpha-up' | 'sort-numeric-down' | 'sort-numeric-up' | 'sparkle' | 'split-horizontal' | 'split-vertical' | 'ssl-key' | 'star' | 'star-full' | 'star-half' | 'stop' | 'stop-full' | 'store' | 'suitcase' | 'sun' | 'sync' | 'tag' | 'target' | 'theme' | 'thumbs-down' | 'thumbs-up' | 'timer' | 'traffic-cone' | 'trash' | 'triangle-exclamation' | 'triangle-exclamation-full' | 'triangle-three-nodes' | 'truck' | 'twitch' | 'undo' | 'upload' | 'user' | 'user-full' | 'vault' | 'x' | 'xmark' | 'youtube' | null` | No | undefined | The icon to display on the right side. |
| `size` | `'lg' | 'md'` | No | undefined | The size preset to use. |
| `status` | `TAG_STATUS` | No | undefined | The status preset to use. |
## Enums
### TAG_SIZE
- `lg` = `lg`
- `md` = `md`
### TAG_STATUS
- `accent` = `accent`
- `critical` = `critical`
- `information` = `information`
- `neutral` = `neutral`
- `success` = `success`
- `warning` = `warning`
## CSS Variables
| Variable | Default value |
|---|---|
| `--ods-tag-border-width` | `calc(var(--ods-semantic-border-thickness) * 2)` |
| `--ods-tag-column-gap` | `calc(var(--ods-semantic-size-space-gap-inline) / 2)` |
| `--ods-tag-row-gap` | `calc(var(--ods-semantic-size-space-gap-block) / 2)` |
| `--ods-tag-padding-horizontal-md` | `var(--ods-semantic-size-space-inset-inline)` |
| `--ods-tag-padding-vertical-md` | `calc(var(--ods-semantic-size-space-inset-block) / 8)` |
| `--ods-tag-padding-horizontal-lg` | `var(--ods-semantic-size-space-inset-inline)` |
| `--ods-tag-padding-vertical-lg` | `calc(var(--ods-semantic-size-space-inset-block) / 4)` |
| `--ods-tag-border-color-critical` | `var(--ods-semantic-color-border-critical-subtle)` |
| `--ods-tag-border-color-critical-active` | `var(--ods-semantic-color-border-critical-subtle)` |
| `--ods-tag-border-color-critical-hover` | `var(--ods-semantic-color-border-critical-subtle)` |
| `--ods-tag-background-color-critical` | `var(--ods-semantic-color-surface-raised)` |
| `--ods-tag-background-color-critical-active` | `var(--ods-semantic-color-interaction-critical-subtle-active)` |
| `--ods-tag-background-color-critical-hover` | `var(--ods-semantic-color-interaction-critical-subtle-hover)` |
| `--ods-tag-text-color-critical` | `var(--ods-semantic-color-content-on-critical)` |
| `--ods-tag-border-color-information` | `var(--ods-semantic-color-border-information-subtle)` |
| `--ods-tag-border-color-information-active` | `var(--ods-semantic-color-border-information-subtle)` |
| `--ods-tag-border-color-information-hover` | `var(--ods-semantic-color-border-information-subtle)` |
| `--ods-tag-background-color-information` | `var(--ods-semantic-color-surface-raised)` |
| `--ods-tag-background-color-information-active` | `var(--ods-semantic-color-interaction-information-subtle-active)` |
| `--ods-tag-background-color-information-hover` | `var(--ods-semantic-color-interaction-information-subtle-hover)` |
| `--ods-tag-text-color-information` | `var(--ods-semantic-color-content-on-information)` |
| `--ods-tag-border-color-neutral` | `var(--ods-semantic-color-border-neutral-subtle)` |
| `--ods-tag-border-color-neutral-active` | `var(--ods-semantic-color-border-control)` |
| `--ods-tag-border-color-neutral-hover` | `var(--ods-semantic-color-border-neutral-subtle)` |
| `--ods-tag-background-color-neutral` | `var(--ods-semantic-color-surface-raised)` |
| `--ods-tag-background-color-neutral-active` | `var(--ods-semantic-color-interaction-neutral-subtle-active)` |
| `--ods-tag-background-color-neutral-hover` | `var(--ods-semantic-color-interaction-neutral-subtle-hover)` |
| `--ods-tag-text-color-neutral` | `var(--ods-semantic-color-content-on-neutral)` |
| `--ods-tag-border-color-accent` | `var(--ods-semantic-color-border-accent-subtle)` |
| `--ods-tag-border-color-accent-active` | `var(--ods-semantic-color-border-accent-subtle)` |
| `--ods-tag-border-color-accent-hover` | `var(--ods-semantic-color-border-accent-subtle)` |
| `--ods-tag-background-color-accent` | `var(--ods-semantic-color-surface-raised)` |
| `--ods-tag-background-color-accent-active` | `var(--ods-semantic-color-interaction-accent-subtle-active)` |
| `--ods-tag-background-color-accent-hover` | `var(--ods-semantic-color-interaction-accent-subtle-hover)` |
| `--ods-tag-text-color-accent` | `var(--ods-semantic-color-content-on-accent)` |
| `--ods-tag-border-color-success` | `var(--ods-semantic-color-border-success-subtle)` |
| `--ods-tag-border-color-success-active` | `var(--ods-semantic-color-border-success-subtle)` |
| `--ods-tag-border-color-success-hover` | `var(--ods-semantic-color-border-success-subtle)` |
| `--ods-tag-background-color-success` | `var(--ods-semantic-color-surface-raised)` |
| `--ods-tag-background-color-success-active` | `var(--ods-semantic-color-interaction-success-subtle-active)` |
| `--ods-tag-background-color-success-hover` | `var(--ods-semantic-color-interaction-success-subtle-hover)` |
| `--ods-tag-text-color-success` | `var(--ods-semantic-color-content-on-success)` |
| `--ods-tag-border-color-warning` | `var(--ods-semantic-color-border-warning-subtle)` |
| `--ods-tag-border-color-warning-active` | `var(--ods-semantic-color-border-warning-subtle)` |
| `--ods-tag-border-color-warning-hover` | `var(--ods-semantic-color-border-warning-subtle)` |
| `--ods-tag-background-color-warning` | `var(--ods-semantic-color-surface-raised)` |
| `--ods-tag-background-color-warning-active` | `var(--ods-semantic-color-interaction-warning-subtle-active)` |
| `--ods-tag-background-color-warning-hover` | `var(--ods-semantic-color-interaction-warning-subtle-hover)` |
| `--ods-tag-text-color-warning` | `var(--ods-semantic-color-content-on-warning)` |
| `--ods-state-is-disabled-opacity` | `var(--ods-semantic-opacity-disabled)` |
## Tag
# Tag
## Default
```tsx
My tag
```
## Status
```tsx
<>
Accent
Critical
Information
Neutral
Success
Warning
>
```
## Disabled
```tsx
My tag
```
## Size
```tsx
<>
MD tag
LG tag
>
```
## Custom Icon
```tsx
<>
No Icon
Custom Icon
>
```
## Accessibility List
```tsx
Design
Development
Accessibility
```
## Accessibility Aria Roles
```tsx
Design
Development
Accessibility
```
## Accessibility Aria Label
```tsx
My tag
```
## Text
# Text
_The **Text** component is used to display and style text content within an application._
## Examples
- Default
- Preset
- Disabled
- Table Caption
- Fig Caption
- Reuse Style
## Documentation pages
- [Documentation](./react-components-text--documentation.txt)
- [Technical Information](./react-components-text--technical-information.txt)
- [Examples](./react-components-text--examples.txt)
## Text
# Text
_The **Text** component is used to display and style text content within an application._
## Overview
The **Text** component is a fundamental UI element for displaying text content.
It supports various presets of styles, sizes, and weights to cater to different textual content requirements such as
paragraphs, headings, and inline text.
The component can be extra customized to fit the design and branding needs of the application.
| | |
|---|---|
| Name | Text |
| Also known as | Paragraph |
| Design | https://www.figma.com/design/9jDDTcR4a9jPRFcdjawAlf/ODS---UI-Kit?node-id=172-12061 |
| Source | https://github.com/ovh/design-system/tree/master/packages/ods-react/src/components/text |
## Usage
The **Text** component provides predefined text styles (font size, color, weight, etc.) to ensure visual consistency across the application.
It is ideal when you want to apply a ready-made text style from the OVHcloud Design System without manually setting typography values.
It is not meant for custom typography needs like overriding styles to match a specific heading or layout.
If the available presets don't fit your use case, use the appropriate semantic HTML tag with your own styling instead.
### Dos & Don'ts
**Do**
- Use Text presets to ensure visual and semantic consistency across your UI
- Respect a logical heading hierarchy (e.g., h2 follows h1, etc.) for accessibility and SEO
- Use Text component to convey meaning and structure, not only appearance
- Choose the appropriate preset for readability and emphasis, depending on the context
- Ensure sufficient color contrast between text and background for readability and accessibility
**Don't**
- Don't skip heading levels (e.g., using heading-3 directly after heading-1), this harms accessibility and user comprehension
- Don't override the semantic tag of a preset (e.g., using heading-2 styled as a div)
- Don't use Text components just to apply a visual style, consider whether semantic meaning is appropriate
- Don't use too many different font sizes and weights on a single view, it creates visual noise and weakens the hierarchy
## Placement
**Text** can be used everywhere in a page as long as levels and heading hierarchy are respected.
It can stand alone or be included in other components depending on the usage.
## Behavior
Based on its informational manner, the **Text** default behavior is being read-only.
The user can only select its content if needed.
## Navigation
The **Text** component is non-interactive and does not receive keyboard focus. It is purely visual and serves to display textual content without affecting keyboard navigation.
## Accessibility
This component complies with the [h1 to h6](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements), [p](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/p), [label](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/label), [small](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/small), [span](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/span) and [code](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/code) HTML elements.
## Text
# Text
## Text
_No specific property._
## Enums
### TEXT_PRESET
- `blockquote` = `blockquote`
- `caption` = `caption`
- `code` = `code`
- `heading1` = `heading-1`
- `heading2` = `heading-2`
- `heading3` = `heading-3`
- `heading4` = `heading-4`
- `heading5` = `heading-5`
- `heading6` = `heading-6`
- `label` = `label`
- `paragraph` = `paragraph`
- `small` = `small`
- `span` = `span`
## CSS Variables
| Variable | Default value |
|---|---|
| `--ods-state-is-disabled-opacity` | `var(--ods-semantic-opacity-disabled)` |
## Text
# Text
## Default
```tsx
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
```
## Preset
```tsx
<>
Blockquote
Caption
Code
Label
Paragraph
Small
Span
Heading-1
Heading-2
Heading-3
Heading-4
Heading-5
Heading-6
>
```
## Disabled
```tsx
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
```
## Table Caption
```tsx
My table title
Person
Age
Chris
22
```
## Fig Caption
```tsx
My picture title
```
## Reuse Style
```tsx
I am a <span> using the heading5 preset style.
```
## Textarea
# Textarea
_A **Textarea** component allows users to input and edit multiple lines of text._
## Props
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| `invalid` | `boolean` | No | undefined | Whether the component is in error state. |
## Examples
- Default
- Disabled
- Read Only
- Resizable
- In Form Field
- Accessibility Described By
- Accessibility Form Field
## Documentation pages
- [Documentation](./react-components-textarea--documentation.txt)
- [Technical Information](./react-components-textarea--technical-information.txt)
- [Examples](./react-components-textarea--examples.txt)
## Textarea
# Textarea
_A **Textarea** component allows users to input and edit multiple lines of text._
## Overview
Form Guidelines] }
figmaLink="https://www.figma.com/design/9jDDTcR4a9jPRFcdjawAlf/ODS---UI-Kit?node-id=53-11147"
githubUrl="https://github.com/ovh/design-system/tree/master/packages/ods-react/src/components/textarea"
name="Textarea">
The **Textarea** component is used to capture and display multi-line text input from users.
It is typically used in forms where users need to provide detailed information, comments, or descriptions.
| | |
|---|---|
| Name | undefined |
| Also known as | Text Box |
## Usage
Use the **Textarea** component to allow users to enter multi-line text in forms, such as comments, messages, descriptions, or other detailed information.
Ensure that the **Textarea** is appropriately sized for the expected input and provides clear guidance on what information is needed.
### Dos & Don'ts
**Do**
- Use a Textarea for inputs that may span multiple lines, such as comments, descriptions, or messages
- Always pair the Textarea with a label to clearly explain what is expected
- Use helper text to provide guidance or clarify formatting when needed
- Allow scrolling or resizing if users are likely to enter long text (based on use case)
- Use Textarea for a text longer than a single line
**Don't**
- Don't use a Textarea for short, single-line inputs. Use an Input instead
- Don't rely on a placeholder as a substitute for a proper label since it disappears once the user starts typing
- Don't disable resizing if users are expected to write long-form content and might need a larger view
### Best Practices in Context
1. **Textarea**
2. **Placeholder or textarea text**
3. **Resize handler** - optional
## Placement
**Textarea** should be vertically aligned with other form components on a same page.
## Behavior
**Textarea** can be hovered, focused, disabled, or set to read-only.
When disabled, the component cannot be focused or interacted with.
If the user types more text than the **Textarea** can display, a scrollbar appears to allow scrolling.
The **Textarea** supports native browser resizing, but it is not enabled by default.
## Navigation
### Focus Management
When the **Textarea** is enabled, it can receive focus via keyboard interaction.
A disabled **Textarea** cannot receive focus.
A read-only **Textarea** can receive focus, allowing users to scroll and select content, but its content cannot be modified.
### General Keyboard Shortcuts
Pressing `Tab` moves focus to the **Textarea**.
Pressing `Shift` + `Tab` moves focus to the previous focusable element.
Pressing `Enter` creates a new line within the **Textarea**.
Pressing `Arrow` keys moves the caret within the text content.
Pressing `Ctrl` + `Arrow Left` / `Arrow Right` (or `Option` + `Arrow Left` / `Arrow Right` on macOS) moves the caret by word.
Pressing `Home` / `End` (or `Cmd`+ `Arrow` keys on macOS) moves the caret to the beginning or end of the line.
Pressing `Page Up` / `Page Down` scrolls through the content if it's longer than the visible area.
## Accessibility
To ensure proper accessibility, it must be correctly labeled, and provide live updates if a character limit is set.
### Always provide an explicit label
Every **Textarea** must have a clear and explicit label to ensure that users (especially screen reader users) understand its purpose,
using either **FormField** or a native label tag.
```tsx
Description:
```
Screen readers will announce the label and the field.
### Linking helper text
```tsx
Description:
Enter a brief description
```
Screen readers will announce the label, the field and the helper text.
## Textarea
# Textarea
## Textarea
This component extends all the native `