Web 0.2.0
Atlas is on the current release.
The report was updated just now.
Settings require workspace access.
- Defaultlight7.93 : 1AA 4.5dark9.07 : 1AA 4.5
- Disabledlight7.93 : 1AA exemptdark9.07 : 1AA exempt
- KeyboardTabArrowRightArrowLeftHomeEndEnterSpaceShift+Tab
- measured on 0.2.0
npx shadcn@latest add @maeso/tabs- Size
- 1.6 kB gzipmeasured on 0.2.0
- First install
- Add the registry once
Usage
Connect each tab to its content panel and keep the selected value in sync with the visible panel.
Accessibility
Preserve the tablist, selected state and panel associations. Keep arrow-key navigation and visible focus.
When to use
Use for peer views within one context. Use navigation links when each destination is a separate page.
Install
Add this registry to your project's components.json once, before the first install. Keep your existing settings and other registries.
{
"registries": {
"@maeso": "http://127.0.0.1:4321/r/{name}.json"
}
}Then install the registry's default theme once, and import its sheet in the CSS entry that imports Tailwind. It paints every item from this registry.
npx shadcn@latest add @maeso/maeso@import "./styles/theme.web.css";npx shadcn@latest add @maeso/tabsProps
Tabs
| Prop | Type | Required | Description |
|---|---|---|---|
| activationMode | "automatic" | "manual" | undefined | no | `automatic` opens the tab the arrow keys land on. `manual` only moves focus there, and Enter or Space opens it: the WAI-ARIA choice for a tab whose opening navigates away. |
| defaultValue | string | undefined | no | The tab an uncontrolled list opens on. Ignored once `value` is given. |
| onChange | ((id: string) => void) | undefined | no | |
| onClose | ((id: string) => void) | undefined | no | Makes every tab closable: a close button after its label, a middle click, and Delete on the focused tab. The caller removes the tab and picks the next selection. |
| stretch | boolean | undefined | no | |
| style | CSSProperties | undefined | no | |
| tabs | readonly Tab[] | undefined | no | |
| value | string | undefined | no | The caller owns the selection. Leave it out to let the list own its own. |
Also accepts every <div> attribute278 props
| Prop | Type | Required | Description |
|---|---|---|---|
| about | string | undefined | no | |
| accessKey | string | undefined | no | |
| aria-activedescendant | string | undefined | no | Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. |
| aria-atomic | Booleanish | undefined | no | Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. |
| aria-autocomplete | "both" | "inline" | "list" | "none" | undefined | no | Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made. |
| aria-braillelabel | string | undefined | no | Defines a string value that labels the current element, which is intended to be converted into Braille. |
| aria-brailleroledescription | string | undefined | no | Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille. |
| aria-busy | Booleanish | undefined | no | |
| aria-checked | "false" | "mixed" | "true" | boolean | undefined | no | Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. |
| aria-colcount | number | undefined | no | Defines the total number of columns in a table, grid, or treegrid. |
| aria-colindex | number | undefined | no | Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. |
| aria-colindextext | string | undefined | no | Defines a human readable text alternative of aria-colindex. |
| aria-colspan | number | undefined | no | Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. |
| aria-controls | string | undefined | no | Identifies the element (or elements) whose contents or presence are controlled by the current element. |
| aria-current | "date" | "false" | "location" | "page" | "step" | "time" | "true" | boolean | undefined | no | Indicates the element that represents the current item within a container or set of related elements. |
| aria-describedby | string | undefined | no | Identifies the element (or elements) that describes the object. |
| aria-description | string | undefined | no | Defines a string value that describes or annotates the current element. |
| aria-details | string | undefined | no | Identifies the element that provides a detailed, extended description for the object. |
| aria-disabled | Booleanish | undefined | no | Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. |
| aria-dropeffect | "copy" | "execute" | "link" | "move" | "none" | "popup" | undefined | no | Indicates what functions can be performed when a dragged object is released on the drop target. |
| aria-errormessage | string | undefined | no | Identifies the element that provides an error message for the object. |
| aria-expanded | Booleanish | undefined | no | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. |
| aria-flowto | string | undefined | no | Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order. |
| aria-grabbed | Booleanish | undefined | no | Indicates an element's "grabbed" state in a drag-and-drop operation. |
| aria-haspopup | "dialog" | "false" | "grid" | "listbox" | "menu" | "tree" | "true" | boolean | undefined | no | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. |
| aria-hidden | Booleanish | undefined | no | Indicates whether the element is exposed to an accessibility API. |
| aria-invalid | "false" | "grammar" | "spelling" | "true" | boolean | undefined | no | Indicates the entered value does not conform to the format expected by the application. |
| aria-keyshortcuts | string | undefined | no | Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. |
| aria-label | string | undefined | no | Defines a string value that labels the current element. |
| aria-labelledby | string | undefined | no | Identifies the element (or elements) that labels the current element. |
| aria-level | number | undefined | no | Defines the hierarchical level of an element within a structure. |
| aria-live | "assertive" | "off" | "polite" | undefined | no | Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. |
| aria-modal | Booleanish | undefined | no | Indicates whether an element is modal when displayed. |
| aria-multiline | Booleanish | undefined | no | Indicates whether a text box accepts multiple lines of input or only a single line. |
| aria-multiselectable | Booleanish | undefined | no | Indicates that the user may select more than one item from the current selectable descendants. |
| aria-orientation | "horizontal" | "vertical" | undefined | no | Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. |
| aria-owns | string | undefined | no | Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship. |
| aria-placeholder | string | undefined | no | Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format. |
| aria-posinset | number | undefined | no | Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. |
| aria-pressed | "false" | "mixed" | "true" | boolean | undefined | no | Indicates the current "pressed" state of toggle buttons. |
| aria-readonly | Booleanish | undefined | no | Indicates that the element is not editable, but is otherwise operable. |
| aria-relevant | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | no | Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. |
| aria-required | Booleanish | undefined | no | Indicates that user input is required on the element before a form may be submitted. |
| aria-roledescription | string | undefined | no | Defines a human-readable, author-localized description for the role of an element. |
| aria-rowcount | number | undefined | no | Defines the total number of rows in a table, grid, or treegrid. |
| aria-rowindex | number | undefined | no | Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. |
| aria-rowindextext | string | undefined | no | Defines a human readable text alternative of aria-rowindex. |
| aria-rowspan | number | undefined | no | Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. |
| aria-selected | Booleanish | undefined | no | Indicates the current "selected" state of various widgets. |
| aria-setsize | number | undefined | no | Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. |
| aria-sort | "ascending" | "descending" | "none" | "other" | undefined | no | Indicates if items in a table or grid are sorted in ascending or descending order. |
| aria-valuemax | number | undefined | no | Defines the maximum allowed value for a range widget. |
| aria-valuemin | number | undefined | no | Defines the minimum allowed value for a range widget. |
| aria-valuenow | number | undefined | no | Defines the current value for a range widget. |
| aria-valuetext | string | undefined | no | Defines the human readable text alternative of aria-valuenow for a range widget. |
| autoCapitalize | "characters" | "none" | "off" | "on" | "sentences" | "words" | (string & {}) | undefined | no | |
| autoCorrect | string | undefined | no | |
| autoFocus | boolean | undefined | no | |
| autoSave | string | undefined | no | |
| children | ReactNode | no | |
| className | string | undefined | no | |
| closable | boolean | undefined | no | |
| color | string | undefined | no | |
| content | string | undefined | no | |
| contentEditable | "inherit" | "plaintext-only" | Booleanish | undefined | no | |
| contextMenu | string | undefined | no | |
| dangerouslySetInnerHTML | { __html: string | TrustedHTML; } | undefined | no | |
| datatype | string | undefined | no | |
| defaultChecked | boolean | undefined | no | |
| dir | string | undefined | no | |
| draggable | Booleanish | undefined | no | |
| enterKeyHint | "done" | "enter" | "go" | "next" | "previous" | "search" | "send" | undefined | no | |
| exportparts | string | undefined | no | |
| hidden | boolean | undefined | no | |
| id | string | undefined | no | |
| inert | boolean | undefined | no | |
| inlist | any | no | |
| inputMode | "decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | undefined | no | Hints at the type of data that might be entered by the user while editing the element or its contents |
| is | string | undefined | no | Specify that a standard HTML element should behave like a defined custom built-in element |
| itemID | string | undefined | no | |
| itemProp | string | undefined | no | |
| itemRef | string | undefined | no | |
| itemScope | boolean | undefined | no | |
| itemType | string | undefined | no | |
| lang | string | undefined | no | |
| nonce | string | undefined | no | |
| onAbort | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onAbortCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onAnimationEnd | AnimationEventHandler<HTMLDivElement> | undefined | no | |
| onAnimationEndCapture | AnimationEventHandler<HTMLDivElement> | undefined | no | |
| onAnimationIteration | AnimationEventHandler<HTMLDivElement> | undefined | no | |
| onAnimationIterationCapture | AnimationEventHandler<HTMLDivElement> | undefined | no | |
| onAnimationStart | AnimationEventHandler<HTMLDivElement> | undefined | no | |
| onAnimationStartCapture | AnimationEventHandler<HTMLDivElement> | undefined | no | |
| onAuxClick | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onAuxClickCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onBeforeInput | InputEventHandler<HTMLDivElement> | undefined | no | |
| onBeforeInputCapture | InputEventHandler<HTMLDivElement> | undefined | no | |
| onBeforeToggle | ToggleEventHandler<HTMLDivElement> | undefined | no | |
| onBlur | FocusEventHandler<HTMLDivElement> | undefined | no | |
| onBlurCapture | FocusEventHandler<HTMLDivElement> | undefined | no | |
| onCanPlay | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onCanPlayCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onCanPlayThrough | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onCanPlayThroughCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onChangeCapture | ChangeEventHandler<HTMLDivElement, Element> | undefined | no | |
| onClick | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onClickCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onCompositionEnd | CompositionEventHandler<HTMLDivElement> | undefined | no | |
| onCompositionEndCapture | CompositionEventHandler<HTMLDivElement> | undefined | no | |
| onCompositionStart | CompositionEventHandler<HTMLDivElement> | undefined | no | |
| onCompositionStartCapture | CompositionEventHandler<HTMLDivElement> | undefined | no | |
| onCompositionUpdate | CompositionEventHandler<HTMLDivElement> | undefined | no | |
| onCompositionUpdateCapture | CompositionEventHandler<HTMLDivElement> | undefined | no | |
| onContextMenu | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onContextMenuCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onCopy | ClipboardEventHandler<HTMLDivElement> | undefined | no | |
| onCopyCapture | ClipboardEventHandler<HTMLDivElement> | undefined | no | |
| onCut | ClipboardEventHandler<HTMLDivElement> | undefined | no | |
| onCutCapture | ClipboardEventHandler<HTMLDivElement> | undefined | no | |
| onDoubleClick | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onDoubleClickCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onDrag | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragEnd | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragEndCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragEnter | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragEnterCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragExit | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragExitCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragLeave | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragLeaveCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragOver | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragOverCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragStart | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDragStartCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDrop | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDropCapture | DragEventHandler<HTMLDivElement> | undefined | no | |
| onDurationChange | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onDurationChangeCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onEmptied | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onEmptiedCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onEncrypted | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onEncryptedCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onEnded | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onEndedCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onError | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onErrorCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onFocus | FocusEventHandler<HTMLDivElement> | undefined | no | |
| onFocusCapture | FocusEventHandler<HTMLDivElement> | undefined | no | |
| onGotPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onGotPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onInput | InputEventHandler<HTMLDivElement> | undefined | no | |
| onInputCapture | InputEventHandler<HTMLDivElement> | undefined | no | |
| onInvalid | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onInvalidCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onKeyDown | KeyboardEventHandler<HTMLDivElement> | undefined | no | |
| onKeyDownCapture | KeyboardEventHandler<HTMLDivElement> | undefined | no | |
| onKeyPress | KeyboardEventHandler<HTMLDivElement> | undefined | no | |
| onKeyPressCapture | KeyboardEventHandler<HTMLDivElement> | undefined | no | |
| onKeyUp | KeyboardEventHandler<HTMLDivElement> | undefined | no | |
| onKeyUpCapture | KeyboardEventHandler<HTMLDivElement> | undefined | no | |
| onLoad | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLoadCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLoadedData | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLoadedDataCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLoadedMetadata | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLoadedMetadataCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLoadStart | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLoadStartCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onLostPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onLostPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onMouseDown | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseDownCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseEnter | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseLeave | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseMove | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseMoveCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseOut | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseOutCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseOver | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseOverCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseUp | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onMouseUpCapture | MouseEventHandler<HTMLDivElement> | undefined | no | |
| onPaste | ClipboardEventHandler<HTMLDivElement> | undefined | no | |
| onPasteCapture | ClipboardEventHandler<HTMLDivElement> | undefined | no | |
| onPause | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onPauseCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onPlay | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onPlayCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onPlaying | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onPlayingCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onPointerCancel | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerCancelCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerDown | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerDownCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerEnter | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerLeave | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerMove | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerMoveCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerOut | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerOutCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerOver | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerOverCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerUp | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onPointerUpCapture | PointerEventHandler<HTMLDivElement> | undefined | no | |
| onProgress | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onProgressCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onRateChange | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onRateChangeCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onReset | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onResetCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onScroll | UIEventHandler<HTMLDivElement> | undefined | no | |
| onScrollCapture | UIEventHandler<HTMLDivElement> | undefined | no | |
| onScrollEnd | UIEventHandler<HTMLDivElement> | undefined | no | |
| onScrollEndCapture | UIEventHandler<HTMLDivElement> | undefined | no | |
| onSeeked | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onSeekedCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onSeeking | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onSeekingCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onSelect | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onSelectCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onStalled | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onStalledCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onSubmit | SubmitEventHandler<HTMLDivElement> | undefined | no | |
| onSubmitCapture | SubmitEventHandler<HTMLDivElement> | undefined | no | |
| onSuspend | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onSuspendCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onTimeUpdate | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onTimeUpdateCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onToggle | ToggleEventHandler<HTMLDivElement> | undefined | no | |
| onTouchCancel | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTouchCancelCapture | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTouchEnd | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTouchEndCapture | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTouchMove | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTouchMoveCapture | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTouchStart | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTouchStartCapture | TouchEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionCancel | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionCancelCapture | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionEnd | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionEndCapture | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionRun | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionRunCapture | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionStart | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onTransitionStartCapture | TransitionEventHandler<HTMLDivElement> | undefined | no | |
| onVolumeChange | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onVolumeChangeCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onWaiting | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onWaitingCapture | ReactEventHandler<HTMLDivElement> | undefined | no | |
| onWheel | WheelEventHandler<HTMLDivElement> | undefined | no | |
| onWheelCapture | WheelEventHandler<HTMLDivElement> | undefined | no | |
| part | string | undefined | no | |
| popover | "" | "auto" | "hint" | "manual" | undefined | no | |
| popoverTarget | string | undefined | no | |
| popoverTargetAction | "hide" | "show" | "toggle" | undefined | no | |
| prefix | string | undefined | no | |
| property | string | undefined | no | |
| radioGroup | string | undefined | no | |
| rel | string | undefined | no | |
| resource | string | undefined | no | |
| results | number | undefined | no | |
| rev | string | undefined | no | |
| role | AriaRole | undefined | no | |
| security | string | undefined | no | |
| size | "md" | "sm" | undefined | no | |
| slot | string | undefined | no | |
| spellCheck | Booleanish | undefined | no | |
| suppressContentEditableWarning | boolean | undefined | no | |
| suppressHydrationWarning | boolean | undefined | no | |
| tabIndex | number | undefined | no | |
| title | string | undefined | no | |
| translate | "no" | "yes" | undefined | no | |
| typeof | string | undefined | no | |
| unselectable | "off" | "on" | undefined | no | |
| variant | "segmented" | "underline" | undefined | no | |
| vocab | string | undefined | no |
Proof
Contrast
measured on 0.2.0
| State | Foreground | Background | Ratio | Floor |
|---|---|---|---|---|
| default | rgb(67 77 86) | rgb(248 245 240) | 7.93 | AA 4.5 |
| disabled | rgb(67 77 86) | rgb(248 245 240) | 7.93 | AA exempt |
| default (dark) | rgb(181 182 182) | rgb(7 21 34) | 9.07 | AA 4.5 |
| disabled (dark) | rgb(181 182 182) | rgb(7 21 34) | 9.07 | AA exempt |
Keyboard
measured on 0.2.0
| Key | Action |
|---|---|
| Tab | Enter the active tab or leave for its panel |
| ArrowRight | Focus the next tab with wraparound |
| ArrowLeft | Focus the previous tab with wraparound |
| Home | Focus the first tab |
| End | Focus the last tab |
| Enter | Select the focused tab and show its panel |
| Space | Select the focused tab and show its panel |
| Shift+Tab | Return from the panel to the active tab |
Size
1553 gzip bytes · measured on 0.2.0
Motion
The selection thumb travels to the active tab.
Configured duration: 200 ms
Reduced motion: none
Motion timing
Observed duration: 200 ms · measured on 0.2.0
Reduced motion
passed · measured on 0.2.0
Example
import { Tabs } from "@/components/ui/_kit/navigation/tabs/Tabs";
import { tabsVariants } from "@/components/ui/_kit/navigation/tabs/Tabs.variants";
import { useId } from "react";
import { useState } from "react";
export function TabsPreview() {
const [value, setValue] = useState("overview");
const prefix = useId();
const tabs = [
{ id: "overview", label: "Overview", content: "Atlas is on the current release." },
{ id: "activity", label: "Activity", content: "The report was updated just now." },
{
id: "settings",
label: "Settings",
content: "Settings require workspace access.",
disabled: true,
},
].map(({ id, label, content, disabled }) => ({
id,
label,
content,
disabled,
tabId: `${prefix}-${id}-tab`,
panelId: `${prefix}-${id}-panel`,
}));
const handleChange = (next: string) => setValue(next);
return (
<div className="w-full max-w-105">
<Tabs aria-label="Workspace views" tabs={tabs} value={value} onChange={handleChange} />
{tabs.map((tab) => (
<section
key={tab.id}
id={tab.panelId}
role="tabpanel"
className={tabsVariants({ variant: "underline" }).panel()}
aria-labelledby={tab.tabId}
hidden={tab.id !== value}
tabIndex={0}
>
<p>{tab.content}</p>
</section>
))}
</div>
);
}
const Example = () => <TabsPreview />;
export default Example;not on native yet