# Components

> This section offers a comprehensive list of components along with best practices to guide their effective usage.

## Component List

A list of all the components available in the design system.

### Layout

| Component Name | Description                                                                      |
| -------------- | -------------------------------------------------------------------------------- |
| `Flex`         | A flex component is used to create a flex container.                             |
| `Grid`         | The grid component is used to create a grid container.                           |
| `Inline`       | An inline component is a layout primitive used to arrange elements horizontally. |
| `Stack`        | A stack component is a layout primitive used to arrange elements vertically.     |

### Buttons

| Component Name     | Description                                                                                                                                                                        |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Button`           | A button allows a user to initiate an action.                                                                                                                                      |
| `ButtonGroup`      | A button group handles the spacing and orientation for a grouping of buttons.                                                                                                      |
| `LinkButton`       | A LinkButton looks like a button but behaves like a link.                                                                                                                          |
| `SegmentedControl` | The SegmentedControl component presents a horizontal row of options or actions that are contextually or conceptually related. It allows users to select a single option at a time. |
| `Tile`             | A tile groups information into an interactive element to let users browse and take action on a group of related items.                                                             |
| `TileGroup`        | A TileGroup groups Tiles to let users browse and take action on a group of related items.                                                                                          |
| `ToggleButton`     | Offer a similar experience as a checkbox or radio with the appearance of a button.                                                                                                 |

### Collections

| Component Name | Description                                                                                                                                                                     |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ListBox`      | A listbox is a list of interactive options that appears when users interact with an element or perform a specific action.                                                       |
| `Menu`         | A menu offers a list of choices to the user, such as a set of actions or functions.                                                                                             |
| `TagGroup`     | The TagGroup is a dynamic UI component that encapsulates a collection of tags. Each tag represents a label, category, keyword, or filter, and can be used for various groupings |
| `Tag`          | A tag represents a label, category, keyword, or filter, and can be used for various groupings. If you need multiple tags, consider using the TagGroup component.                |

### Date and time

| Component Name    | Description                                                                                              |
| ----------------- | -------------------------------------------------------------------------------------------------------- |
| `Calendar`        | A calendar displays one or more date grids and allows users to select a single date.                     |
| `DatePicker`      | A date picker allows users to select a single date from a calendar.                                      |
| `DateRangePicker` | A date range picker allows users to select a range of dates from a calendar.                             |
| `RangeCalendar`   | A range calendar displays one or more date grids and allows users to select a contiguous range of dates. |

### Forms

| Component Name  | Description                                                                                                                                                                                                                   |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Checkbox`      | Checkboxes are used for multiple choices, not for mutually exclusive choices. Each checkbox works independently from other checkboxes in the list, therefore checking an additional box does not affect any other selections. |
| `CheckboxGroup` | A checkbox group handles the spacing and orientation for a grouping of checkboxes, as well as providing a label.                                                                                                              |
| `Form`          | Forms are used to gather information from the user.                                                                                                                                                                           |
| `NumberField`   | A number field is a specialized input that allows a user to enter a number.                                                                                                                                                   |
| `PasswordField` | A password field is a specialized text field that allows a user to enter a password.                                                                                                                                          |
| `RadioGroup`    | A radio group is used to group related options together.                                                                                                                                                                      |
| `SearchField`   | A search field is a specialized text input allowing the user to perform a search.                                                                                                                                             |
| `Switch`        | A switch is used to quickly switch between two possible states.                                                                                                                                                               |
| `TextArea`      | A text area serves as a multi-line, plain-text editing interface.                                                                                                                                                             |
| `TextField`     | A text field allows a user to enter a plain text value.                                                                                                                                                                       |

### Icons

| Component Name | Description                                                 |
| -------------- | ----------------------------------------------------------- |
| `Icon`         | An icon component is used to render a custom icon.          |
| `IconList`     | An IconList encapsulates a collection of icons.             |
| `RichIcon`     | A rich icon component is used to render a rich custom icon. |

### Navigation

| Component Name | Description                                                                                                           |
| -------------- | --------------------------------------------------------------------------------------------------------------------- |
| `Accordion`    | An Accordion is a grouping of related disclosures. It supports both single and multiple expanded items.               |
| `Disclosure`   | The disclosure component is used to put long sections of information under a block that users can expand or collapse. |
| `Link`         | A link allows a user to navigate to a different location.                                                             |
| `Tabs`         | Tabs are used to organize content by grouping similar information on the same page.                                   |

### Overlays

| Component Name   | Description                                                                                                                                                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Alert`          | An Alert is a “conversation” between the system and the user. It is prompted when the system needs input from the user or to give the user urgent information concerning their current workflow. |
| `ContextualHelp` | Contextual help shows a user extra information about the state of an adjacent component. It explains a high-level topic about an experience and can point users to more information elsewhere.   |
| `Modal`          | Modals focus the user's attention exclusively on one task or piece of information via a window that sits on top of the page content.                                                             |
| `Popover`        | A popover displays additional content when a user interacts with a trigger element.                                                                                                              |
| `Tooltip`        | Tooltips display additional information upon hover or focus that is contextual, helpful, and nonessential while providing the ability to communicate and give clarity to a user.                 |

### Pickers

| Component Name | Description                                                                                         |
| -------------- | --------------------------------------------------------------------------------------------------- |
| `ComboBox`     | A combo box allows the user to make a selection from a list of suggested, likely or desired values. |
| `Select`       | A select displays a collapsible list of options from which the user can select one.                 |

### Status

| Component Name   | Description                                                                                                                                                                                                                                                |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Badge`          | A badge is used to bring attention to an element.                                                                                                                                                                                                          |
| `Callout`        | A Callout informs users about important changes or persistent conditions. Use this component to communicate to users in a prominent way. Callouts are placed at the top of the page or section they apply to, and below the page or section header.        |
| `CompactCallout` | A CompactCallout informs users about important changes or persistent conditions. Use this component to communicate to users in a prominent way. Callouts are placed at the top of the page or section they apply to, and below the page or section header. |
| `FloatingBadge`  | A floating badge allows the user to position a badge relative to another component.                                                                                                                                                                        |
| `Spinner`        | A spinner indicates that a part of the product is currently performing a task of unknown duration.                                                                                                                                                         |

### Content

| Component Name       | Description                                                                                                                                        |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Avatar`             | Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available. |
| `Card`               | Cards are used to group similar concepts and tasks to make it easier for users to scan, read and get things done.                                  |
| `Divider`            | A divider separates sections of content or groups.                                                                                                 |
| `Heading`            | A heading is a primitive component matching Hopper's typography type scale.                                                                        |
| `IllustratedMessage` | An illustrated message display an image and a message, usually for an empty state or an error page.                                                |
| `Illustration`       | An illustration compose an image with a background color. Use an illustration as an hero in a modal.                                               |
| `Image`              | An image component that can be used to display images.                                                                                             |
| `Label`              | A label is a primitive component matching Hopper's typography type scale.                                                                          |
| `Paragraph`          | A paragraph is used to render blocks of text.                                                                                                      |
| `Text`               | A text component is a primitive component matching Hopper's typography type scale.                                                                 |

### Placeholders

| Component Name | Description                                                |
| -------------- | ---------------------------------------------------------- |
| `Content`      | A placeholder for the main content section of a component. |
| `Footer`       | A placeholder for a footer section.                        |
| `Header`       | A placeholder for an header section.                       |

### Html elements

| Component Name | Description                                                    |
| -------------- | -------------------------------------------------------------- |
| `A`            | A specialized component to represent an HTML anchor element.   |
| `Address`      | A specialized component to represent an HTML address element.  |
| `Article`      | A specialized component to represent an HTML article element.  |
| `Aside`        | A specialized component to represent an HTML aside element.    |
| `Div`          | A specialized component to represent an HTML div element.      |
| `HtmlButton`   | A specialized button component for HTML button element.        |
| `HtmlFooter`   | A specialized component to represent an HTML footer element.   |
| `HtmlHeader`   | A specialized component to represent an HTML header element.   |
| `HtmlInput`    | A specialized component to represent an HTML input element.    |
| `HtmlSection`  | A specialized component to represent an HTML section element.  |
| `Img`          | A specialized component to represent an HTML img element.      |
| `Main`         | A specialized component to represent an HTML main element.     |
| `Nav`          | A specialized component to represent an HTML nav element.      |
| `Span`         | A specialized component to represent an HTML span element.     |
| `Table`        | A specialized component to represent an HTML table element.    |
| `UL`           | A specialized component to represent an HTML ul/ol/li element. |

### Building blocks

| Component Name  | Description                                                                                                                                                          |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Box`           | A flexible container component that can render as any HTML element or React component. Supports all styled system props for consistent spacing, layout, and styling. |
| `ErrorMessage`  | An error message displays validation errors for a form field.                                                                                                        |
| `HelperMessage` | A helper message component displays auxiliary text to guide users in the interface.                                                                                  |
| `PopoverBase`   | A simple React Aria Popover with hopper's styling                                                                                                                    |

## A

A specialized component to represent an HTML anchor element.

```tsx
import { A } from "@hopper-ui/components";

export default function Example() {
    return (
        <A color="neutral-weak" href="https://www.cc.com/shows/futurama">
            Futurama
        </A>
    );
}
```

### Usage

An anchor component accepts all the [anchor HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Accordion

An Accordion is a grouping of related disclosures. It supports both single and multiple expanded items.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/accordion/src/Accordion.tsx>

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Accordion defaultExpandedKeys={["pingboard"]}>
                <Disclosure id="officevibe">
                    <DisclosureHeader>Workleap Officevibe</DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>Workleap Pingboard</DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>Workleap Performance</DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

### Anatomy

#### Structure

```tsx
<Accordion>
    <Disclosure> /* (Required) A disclosure for the Accordion */
        <DisclosureHeader> /* (Required) A header for the Disclosure */
            <Text /> /* (Optional) A text description for the DisclosureHeader */
            <Icon /> /* (Optional) An icon for the DisclosureHeader */
        </DisclosureHeader>
        <DisclosurePanel /> /* (Required) A panel for the Disclosure */
    </Disclosure>
</Accordion>
```

#### Composed Components

An `Accordion` uses the following components.

| Component  | Description                                                                                                           |
| ---------- | --------------------------------------------------------------------------------------------------------------------- |
| Disclosure | The disclosure component is used to put long sections of information under a block that users can expand or collapse. |
| Icon       | An icon component is used to render a custom icon.                                                                    |
| Text       | A text component is a primitive component matching Hopper's typography type scale.                                    |

### Usage

#### Disabled

An accordion can be disabled.

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Accordion isDisabled>
                <Disclosure id="officevibe">
                    <DisclosureHeader>Workleap Officevibe</DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>Workleap Pingboard</DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>Workleap Performance</DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

#### Variants

An accordion has multiple variants.

**Standalone** - Used when the accordion is not inside a container.

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Accordion variant="standalone">
                <Disclosure id="officevibe">
                    <DisclosureHeader>Workleap Officevibe</DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>Workleap Pingboard</DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>Workleap Performance</DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

**Inline** - Used when placing a accordion inside a container.

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Accordion variant="inline">
                <Disclosure id="officevibe">
                    <DisclosureHeader>Workleap Officevibe</DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>Workleap Pingboard</DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>Workleap Performance</DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

#### Expanded

By default, only one disclosure will be expanded at a time. Use `allowsMultipleExpanded` prop to expand multiple disclosures.

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Accordion defaultExpandedKeys={["pingboard", "performance"]} allowsMultipleExpanded>
                <Disclosure id="officevibe">
                    <DisclosureHeader>Workleap Officevibe</DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>Workleap Pingboard</DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>Workleap Performance</DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

#### Icon

An accordion heading can contain an icon.

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div, Text } from "@hopper-ui/components";
import { PinSolidIcon, SparklesIcon, SproutIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Accordion defaultExpandedKeys={["pingboard"]}>
                <Disclosure id="officevibe">
                    <DisclosureHeader>
                        <SparklesIcon />
                        <Text>Workleap Officevibe</Text>
                    </DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>
                        <PinSolidIcon />
                        <Text>Workleap Pingboard</Text>
                    </DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>
                        <SproutIcon />
                        <Text>Workleap Performance</Text>
                    </DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

#### Description

An accordion heading can contain a description.

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div, Inline, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Accordion>
                <Disclosure id="officevibe">
                    <DisclosureHeader>
                        <Inline columnGap="inline-sm" rowGap="core_0" alignY="baseline">
                            <Text>Workleap Officevibe</Text>
                            <Text color="neutral-weak" size="sm">Engagement survey and feedback</Text>
                        </Inline>
                    </DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>
                        <Inline columnGap="inline-sm" rowGap="core_0" alignY="baseline">
                            <Text>Workleap Pingboard</Text>
                            <Text color="neutral-weak" size="sm">Interactive org chart and directory</Text>
                        </Inline>
                    </DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>
                        <Inline columnGap="inline-sm" rowGap="core_0" alignY="baseline">
                            <Text>Workleap Performance</Text>
                            <Text color="neutral-weak" size="sm">Performance review management and tracking</Text>
                        </Inline>
                    </DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

#### Controlled

An accordion can handle its opened panels in controlled mode.

```tsx
import { Accordion, Disclosure, DisclosureHeader, DisclosurePanel, Div, Span } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [expandedKeys, setExpandedKeys] = useState<Set<string | number>>(new Set());

    const handleExpandedChange = (keys: Set<string | number>) => {
        setExpandedKeys(keys);
    };

    return (
        <Div width="100%" paddingX="core_320" paddingY="core_480">
            <Span
                display="flex"
                marginBottom="stack-md"
            >
                {expandedKeys.size > 0 ? `${Array.from(expandedKeys).join(", ")} is opened.` : "No sections are opened."}
            </Span>
            <Accordion
                onExpandedChange={handleExpandedChange}
                expandedKeys={expandedKeys}
                allowsMultipleExpanded
            >
                <Disclosure id="officevibe">
                    <DisclosureHeader>Workleap Officevibe</DisclosureHeader>
                    <DisclosurePanel>Help employees speak up and make sure they feel heard. Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="pingboard">
                    <DisclosureHeader>Workleap Pingboard</DisclosureHeader>
                    <DisclosurePanel>Make teamwork work. Use your org chart to create lasting connections across your distributed and hybrid teams to make collaboration easier.</DisclosurePanel>
                </Disclosure>
                <Disclosure id="performance">
                    <DisclosureHeader>Workleap Performance</DisclosureHeader>
                    <DisclosurePanel>Drive impact by simplifying how your leaders and you manage team performance throughout the year.</DisclosurePanel>
                </Disclosure>
            </Accordion>
        </Div>
    );
}
```

### Props

| Prop                   | Type                                              | Default | Description                                                                                                                                                                        |
| ---------------------- | ------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| variant                | `"standalone" \| "inline"`                        |         |                                                                                                                                                                                    |
| style                  | `StyleOrFunction<DisclosureGroupRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| allowsMultipleExpanded | `boolean`                                         |         | Whether multiple items can be expanded at the same time.                                                                                                                           |
| isDisabled             | `boolean`                                         |         | Whether all items are disabled.                                                                                                                                                    |
| expandedKeys           | `Iterable<Key>`                                   |         | The currently expanded keys in the group (controlled).                                                                                                                             |
| defaultExpandedKeys    | `Iterable<Key>`                                   |         | The initial expanded keys in the group (uncontrolled).                                                                                                                             |
| children               | `ChildrenOrFunction<DisclosureGroupRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className              | `ClassNameOrFunction<DisclosureGroupRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| dir                    | `string`                                          |         |                                                                                                                                                                                    |
| lang                   | `string`                                          |         |                                                                                                                                                                                    |
| inert                  | `boolean`                                         |         |                                                                                                                                                                                    |
| translate              | `"yes" \| "no"`                                   |         |                                                                                                                                                                                    |

##### Events

| Prop                        | Type                                     | Default | Description                                                  |
| --------------------------- | ---------------------------------------- | ------- | ------------------------------------------------------------ |
| onExpandedChange            | `((keys: Set<Key>) => any)`              |         | Handler that is called when items are expanded or collapsed. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                              |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                              |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                              |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                              |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                              |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                              |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                              |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                              |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                              |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                              |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                              |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                              |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                              |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop | Type     | Default | Description                                                                                                         |
| ---- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id   | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `expansionMode="multiple"` has been replaced with `allowsMultipleExpanded`.
* `borderless` and `bordered` variants are no more. `inline` and `standalone` are the new variants. There is no direct match; the new variants are context-based, depending on whether an accordion is contained or not.
* `autofocus` is removed. It did not make sense to have.
* The `disclosure` component is used instead of `Item`.
* `disabled` is renamed to `isDisabled` on the item/disclosure.

## Address

A specialized component to represent an HTML address element.

```tsx
import { Address, Link } from "@hopper-ui/components";

export default function Example() {
    return (
        <Address color="neutral-weak">
            <Link href="mailto:media@spacex.com">media@spacex.com</Link>
            <br />
            <Link href="tel:+13103636000">(310) 363-6000</Link>
        </Address>
    );
}
```

### Usage

An address component accepts all the [address HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/address) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Alert

An Alert is a “conversation” between the system and the user. It is prompted when the system needs input from the user or to give the user urgent information concerning their current workflow.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/alert/src/Alert.tsx>

Alerts work best when used for short tasks or to warn the user to task relevant information. Alerts are useful in many scenarios; they are less disorientating than navigating a user to a new page for simple tasks or knowledge gathering. However, Alerts are disruptive and can be distracting to the user. Use them sparingly.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonLabel="Leap ahead!">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

### Anatomy

#### Structure

```tsx
<Alert>
    <Heading /> /* (Required) The heading of the Alert */
    <Content /> /* (Required) The content of the Alert */
</Alert>
```

#### Composed Components

A `Alert` uses the following components:

| Component | Description                                                                 |
| --------- | --------------------------------------------------------------------------- |
| Content   | A placeholder for the main content section of a component.                  |
| Heading   | A heading is a primitive component matching Hopper's typography type scale. |

### Usage

#### Default

An alert must have a heading, some content and a primary button label.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonLabel="Leap ahead!" cancelButtonLabel="Cancel">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Secondary button

An alert can have a secondary button.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonLabel="Leap ahead!" secondaryButtonLabel="Leap back">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Cancel button

An alert can have a cancel button.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonLabel="Leap ahead!" cancelButtonLabel="Cancel">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Disabled buttons

An alert primary and secondary buttons can be disabled.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonDisabled primaryButtonLabel="Leap ahead!" secondaryButtonLabel="Leap back">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Confirmation

Use a confirmation alert when a non-destructive action is required from a user.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonLabel="Leap ahead!" secondaryButtonLabel="Leap back" variant="confirmation">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Destructive

Use a destructive alert to confirm a permanent change, like deleting data.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonLabel="Escape the swamp" secondaryButtonLabel="Stay in the mud" variant="destructive">
                <Heading>Frog-tastrophe!</Heading>
                <Content>
                    Something went wrong in the pond. Better leap out before it gets warty!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Not Dismissable

An alert can be undismissable.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open</Button>
            <Alert isDismissable={false} primaryButtonLabel="Leap ahead!" cancelButtonLabel="Cancel">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Controlled

The open state can be handled in controlled mode.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [isOpen, setIsOpen] = useState(false);

    const handleOpenChange = useCallback((open: boolean) => {
        setIsOpen(open);
    }, [setIsOpen]);

    return (
        <AlertTrigger isOpen={isOpen} onOpenChange={handleOpenChange}>
            <Button variant="secondary">Open</Button>
            <Alert primaryButtonLabel="Leap ahead!" cancelButtonLabel="Cancel">
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Pending

An alert can show a pending state. This is useful when you want to show that an action is in progress.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [isLoading, setIsLoading] = useState(false);
    const [isOpen, setIsOpen] = useState(false);

    const handleOpenChange = useCallback((open: boolean) => {
        if (isLoading && !open) {
            return;
        }

        setIsOpen(open);
    }, [setIsOpen, isLoading]);

    const handlePrimaryButtonClick = useCallback(async () => {
        setIsLoading(true);

        await new Promise(resolve => setTimeout(resolve, 3000));

        setIsLoading(false);
        setIsOpen(false);
    }, []);

    return (
        <AlertTrigger isOpen={isOpen} onOpenChange={handleOpenChange}>
            <Button variant="secondary">Open</Button>
            <Alert
                isLoading={isLoading}
                onPrimaryButtonClick={handlePrimaryButtonClick}
                primaryButtonLabel="Leap ahead!"
                cancelButtonLabel="Cancel"
            >
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

#### Sizes

A Alert can be small or medium. The default size is medium.

```tsx
import { Alert, type AlertProps, AlertTrigger, Button, Content, Heading, Stack } from "@hopper-ui/components";

export default function Example() {
    const alert = (size: AlertProps["size"]) => (
        <AlertTrigger>
            <Button variant="secondary">Open {`${size}`}</Button>
            <Alert primaryButtonLabel="Leap ahead!" cancelButtonLabel="Cancel" size={size}>
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );

    return (
        <Stack gap="stack-md">
            {alert("sm")}
            {alert("md")}
        </Stack>
    );
}
```

#### Responsive sizes

A Alert can have different size in mobile and desktop view.

```tsx
import { Alert, AlertTrigger, Button, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <AlertTrigger>
            <Button variant="secondary">Open responsive alert</Button>
            <Alert
                primaryButtonLabel="Leap ahead!"
                cancelButtonLabel="Cancel"
                size={{
                    xs: "sm",
                    sm: "md"
                }}
            >
                <Heading>Ribbit Reminder!</Heading>
                <Content>
                    Your changes have been saved—no need to leap again. Hop along, hero!
                </Content>
            </Alert>
        </AlertTrigger>
    );
}
```

### Best Practices

#### Use alerts sparingly

Don't overuse alerts. They are disruptive and can easily annoy the user if used incorrectly or too frequently. When alerts are used for non-workflow related tasks, it is likely a user will start ignoring or dismissing the alert without fully understanding the content. This can cause users to make hurried or impulsive choices when dealing with more critical alerts.

#### Alerts should be user initiated

A user action, such as clicking a button, should trigger the alert to open. Don't interrupt the user by opening an alert when they aren't expecting it. Avoid system generated pop-ups that distract the user while working. Triggers can either be a direct or indirect consequence of a user's action. An example of an indirect action is a user closing a tab with unsaved content that then causes an alert to ask if they want to save their changes before closing. If the system is autogenerating an alert that is not a consequence of a user's action, but a response to processes happening in the background, then a toast notification should be used instead.

#### Keep alert tasks simple and focused

Alert tasks should be direct and easy to complete. Avoid feature creep in alerts where a once simple alert has become bloated with interactions. When deciding to use an alert consider how the task could expand in the future and if an alert will be able to effectively incorporate additions.

#### Dismissing an alert

* Task completion: clicking the primary action will complete the task and automatically close the alert
* Cancel button: clicking the Cancel button will close the modal and return the user to its previous context. Cancel undoes all applied changes.
* X: Clicking the Dismiss button at the upper right will close the alert without submitting any data and return the user to its previous context.
* Esc: Press ESC on the keyboard.

### Props

#### Alert

| Prop                    | Type                                                    | Default        | Description                                                                                              |
| ----------------------- | ------------------------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------- |
| autoFocusButton         | `"primary" \| "secondary" \| "cancel"`                  |                | The button to focus by default when the alert open.                                                      |
| cancelButtonLabel       | `string`                                                |                | The cancel button label.                                                                                 |
| isDismissable           | `boolean`                                               | true           | Whether or not the dialog should close on outside interactions.                                          |
| primaryButtonDisabled   | `boolean`                                               |                | Whether or not the primary button is disabled.                                                           |
| primaryButtonLabel      | `string`                                                |                | The primary button label.                                                                                |
| secondaryButtonDisabled | `boolean`                                               |                | Whether or not the secondary button is disabled.                                                         |
| secondaryButtonLabel    | `string`                                                |                | The secondary button label.                                                                              |
| variant                 | `"confirmation" \| "destructive"`                       | "confirmation" | The visual style of the Alert.                                                                           |
| size                    | `ResponsiveProp<"sm" \| "md">`                          | "md"           | The size of the Alert.                                                                                   |
| overlayProps            | `Partial<BaseModalProps>`                               |                | Additional props to render on the wrapper element.                                                       |
| isLoading               | `boolean`                                               |                | Whether or not the Alert is loading.                                                                     |
| style                   | `CSSProperties`                                         |                | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children                | `ReactNode \| ((opts: DialogRenderProps) => ReactNode)` |                | Children of the dialog. A function may be provided to access a function to close the dialog.             |
| className               | `string`                                                |                | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| dir                     | `string`                                                |                |                                                                                                          |
| lang                    | `string`                                                |                |                                                                                                          |
| inert                   | `boolean`                                               |                |                                                                                                          |
| translate               | `"yes" \| "no"`                                         |                |                                                                                                          |
| isOpen                  | `boolean`                                               |                | Whether the overlay is open by default (controlled).                                                     |
| defaultOpen             | `boolean`                                               |                | Whether the overlay is open by default (uncontrolled).                                                   |

##### Events

| Prop                        | Type                                  | Default | Description                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onCancelButtonClick         | `(() => void)`                        |         | Called when the cancel button is clicked                                                                                                                                                                                    |
| onPrimaryButtonClick        | `(() => void)`                        |         | Called when the primary button is clicked.                                                                                                                                                                                  |
| onSecondaryButtonClick      | `(() => void)`                        |         | Called when the secondary button is clicked.                                                                                                                                                                                |
| onOpenChange                | `((isOpen: boolean) => void)`         |         | Handler that is called when the alert's open state changes. This handler is only called when the alert is not used inside a `AlertTrigger`. Use the `onOpenChange` prop of `AlertTrigger` instead if it's part of a trigger |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |                                                                                                                                                                                                                             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |                                                                                                                                                                                                                             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type                        | Default  | Description                                                                                                         |
| ---------------- | --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| role             | `"dialog" \| "alertdialog"` | 'dialog' | The accessibility role for the dialog.                                                                              |
| id               | `string`                    |          | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string`                    |          | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string`                    |          | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string`                    |          | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string`                    |          | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

#### AlertTrigger

| Prop        | Type      | Default | Description                                            |
| ----------- | --------- | ------- | ------------------------------------------------------ |
| isOpen      | `boolean` |         | Whether the overlay is open by default (controlled).   |
| defaultOpen | `boolean` |         | Whether the overlay is open by default (uncontrolled). |

##### Events

| Prop         | Type                          | Default | Description                                                   |
| ------------ | ----------------------------- | ------- | ------------------------------------------------------------- |
| onOpenChange | `((isOpen: boolean) => void)` |         | Handler that is called when the overlay's open state changes. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `dismissable` has been renamed `isDismissable`.
* `wrapperProps` has been renamed `overlayProps`.
* `onClose` has been removed.

## Article

A specialized component to represent an HTML article element.

```tsx
import { Aside, Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <Aside color="neutral-weak">
            <Paragraph>
                The Universe is under no obligation to make sense to you. The Earth is the cradle of
                humanity, but mankind cannot stay in the cradle forever.
            </Paragraph>
        </Aside>
    );
}
```

### Usage

An article component accepts all the [article HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/article) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Aside

A specialized component to represent an HTML aside element.

```tsx
import { Aside, Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <Aside color="neutral-weak">
            <Paragraph>
                The Universe is under no obligation to make sense to you. The Earth is the cradle of
                humanity, but mankind cannot stay in the cradle forever.
            </Paragraph>
        </Aside>
    );
}
```

### Usage

An aside component accepts all the [aside HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/aside) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Avatar

Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/avatar/src/Avatar.tsx>

```tsx
import { Avatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Avatar name="John Doe" />
    );
}
```

### Usage

#### Local Image

An avatar can display a local image.

```tsx
import { Avatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Avatar name="Kermit Frog" src="/frog.jpg" />
    );
}
```

#### Remote image

An avatar can fetch a remote image.

```tsx
import { Avatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Avatar name="John Doe" src="https://i.pravatar.cc/96?img=1" />
    );
}
```

#### Fallback image

A fallback image can be set in case the `src` fails to load.

```tsx
import { Avatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Avatar
            name="John Doe"
            src="https://example.com/image.jpg"
            fallbackSrc="https://i.pravatar.cc/96?img=2"
        />
    );
}
```

#### Loading Failure

When an image fails to load, a default image will be displayed.

```tsx
import { Avatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Avatar
            name="John Doe"
            src="https://example.com/image.jpg"
        />
    );
}
```

#### Double Failure

When the fallback image fails to load, a default image will be displayed.

```tsx
import { Avatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Avatar
            name="John Doe"
            src="https://example.com/image.jpg"
            fallbackSrc="https://example.com/image2.jpg"
        />
    );
}
```

#### Src and Fallback Bypass

If no fallback image is provided and the image fails to load, the initials will be displayed instead.

```tsx
import { Avatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Avatar
            name="John Doe"
            src="https://example.com/image.jpg"
            fallbackSrc={null}
        />
    );
}
```

#### Anonymous

An anonymous avatar can be displayed.

```tsx
import { AnonymousAvatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <AnonymousAvatar
            aria-label="anonymous"
        />
    );
}
```

#### Deleted

A deleted avatar can be displayed.

```tsx
import { DeletedAvatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <DeletedAvatar
            aria-label="deleted user"
        />
    );
}
```

#### Broken

A broken avatar can be displayed.

```tsx
import { BrokenAvatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <BrokenAvatar
            aria-label="broken"
        />
    );
}
```

#### Sizes

An avatar can be displayed in different sizes.

* Extra small (16px): use in tightly condensed layouts. This size can only accommodate one letter when using the Initials variant.
* Small (24px): use when the medium size is too big for the layout, or when the avatar has less importance in the context.
* Medium (32px): use as the default size
* Large (48px): use when an avatar is a focal point, such on a member page header
* Extra large (64px): use when an avatar is a focal point, such on a member page header

```tsx
import { Avatar, Stack, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Inline>
                <Avatar name="John Doe" size="xs" />
                <Avatar name="John Doe" size="sm" />
                <Avatar name="John Doe" size="md" />
                <Avatar name="John Doe" size="lg" />
                <Avatar name="John Doe" size="xl" />
                <Avatar name="John Doe" size="2xl" />
            </Inline>
            <Inline>
                <Avatar name="John Doe" size="xs" src="https://i.pravatar.cc/96?img=1" />
                <Avatar name="John Doe" size="sm" src="https://i.pravatar.cc/96?img=1" />
                <Avatar name="John Doe" size="md" src="https://i.pravatar.cc/96?img=1" />
                <Avatar name="John Doe" size="lg" src="https://i.pravatar.cc/96?img=1" />
                <Avatar name="John Doe" size="xl" src="https://i.pravatar.cc/96?img=1" />
                <Avatar name="John Doe" size="2xl" src="https://i.pravatar.cc/96?img=1" />
            </Inline>
            <Inline>
                <Avatar name="John Doe" size="xs" src="https://example.com/image.jpg" />
                <Avatar name="John Doe" size="sm" src="https://example.com/image.jpg" />
                <Avatar name="John Doe" size="md" src="https://example.com/image.jpg" />
                <Avatar name="John Doe" size="lg" src="https://example.com/image.jpg" />
                <Avatar name="John Doe" size="xl" src="https://example.com/image.jpg" />
                <Avatar name="John Doe" size="2xl" src="https://example.com/image.jpg" />
            </Inline>
        </Stack>
    );
}
```

#### Disabled

An avatar can be disabled.

```tsx
import { AnonymousAvatar, Avatar, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Avatar name="John Doe" size="lg" isDisabled />
            <Avatar name="John Doe" size="lg" isDisabled src="https://i.pravatar.cc/96?img=1" />
            <AnonymousAvatar aria-label="anonymous" size="lg" isDisabled />
        </Inline>
    );
}
```

#### Pressable

An avatar can be pressed, which will trigger an action when pressed.

```tsx
import { AnonymousAvatar, Avatar, BrokenAvatar, DeletedAvatar, Inline } from "@hopper-ui/components";
import { useCallback } from "react";

export default function Example() {
    const handlePress = useCallback(() => {
        alert("Avatar pressed!");
    }, []);

    return (
        <Inline>
            <Avatar name="John Doe" onPress={handlePress} />
            <DeletedAvatar aria-label="Deleted User" onPress={handlePress} />
            <AnonymousAvatar aria-label="Anonymous User" onPress={handlePress} />
            <BrokenAvatar aria-label="Broken User" onPress={handlePress} />
        </Inline>
    );
}
```

#### Customize the image props

Using a custom hook to retry loading the image up to 5 times with a 250ms delay.

```tsx
import { Avatar, Paragraph, Stack } from "@hopper-ui/components";
import { type ReactEventHandler, useEffect, useState } from "react";

function useAsyncImage(src: string, retryCount = 5, delay = 250) {
    const [currentSrc, setCurrentSrc] = useState(src);
    const [isLoaded, setIsLoaded] = useState(false);
    const [failureCount, setFailureCount] = useState(0);

    useEffect(() => {
        if (isLoaded || failureCount >= retryCount) {
            return;
        }

        const loadImage = () => {
            const image: HTMLImageElement = new Image();

            image.src = currentSrc;

            image.onload = () => {
                setIsLoaded(true);
            };

            image.onerror = () => {
                if (failureCount < retryCount) {
                    setFailureCount(prevCount => prevCount + 1);
                    setCurrentSrc(src); // Trigger retry by resetting src
                }
            };
        };

        const timeoutId = setTimeout(loadImage, delay);

        return () => {
            clearTimeout(timeoutId);
        };
    }, [currentSrc, isLoaded, failureCount, retryCount, delay, src]);

    const onError: ReactEventHandler<HTMLImageElement> | undefined = () => {
        if (failureCount < retryCount) {
            setFailureCount(prevCount => prevCount + 1);
            setCurrentSrc(src); // Manually trigger retry
        }
    };

    return [isLoaded ? currentSrc : undefined, onError, failureCount] as const;
}

export default function Example() {
    const [src, handleError, failureCount] = useAsyncImage("https://example.com/image.jpg");
    const [src2, handleError2, failureCount2] = useAsyncImage("https://i.pravatar.cc/96?img=1");

    return (
        <Stack>
            <Stack alignX="center">
                <Avatar
                    name="John Doe"
                    src={src}
                    imageProps={{ onError: handleError }}
                />
                <Paragraph>The avatar failed to load <strong>{failureCount}</strong> times.</Paragraph>
            </Stack>
            <Stack alignX="center">
                <Avatar
                    name="John Doe"
                    src={src2}
                    imageProps={{ onError: handleError2 }}
                />
                <Paragraph>The avatar failed to load <strong>{failureCount2}</strong> times.</Paragraph>
            </Stack>
        </Stack>
    );
}
```

#### AvatarGroup

An avatar group can be used to display multiple avatars.

```tsx
import { Avatar, AvatarGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <AvatarGroup>
            <Avatar name="John Doe" />
            <Avatar name="Alex Turner" />
            <Avatar name="Chris Dalton" />
        </AvatarGroup>
    );
}
```

##### Too many avatars

When there are too many avatars, a counter will be displayed.

```tsx
import { AnonymousAvatar, Avatar, AvatarGroup, DeletedAvatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <AvatarGroup>
            <Avatar name="John Doe" />
            <Avatar name="Alex Turner" />
            <Avatar name="Chris Dalton" />
            <Avatar name="Alan Turing" />
            <Avatar name="Ada Lovelace" />
            <Avatar name="Grace Hopper" />
            <Avatar name="Marie Curie" />
            <Avatar name="Rosalind Franklin" />
            <DeletedAvatar aria-label="Alan Sheppard" />
            <AnonymousAvatar aria-label="Anonymous" />
        </AvatarGroup>
    );
}
```

##### Sizes

An avatar group can be displayed in different sizes.

```tsx
import { Avatar, AvatarGroup, Stack } from "@hopper-ui/components";

export default function Example() {
    const avatars = [
        <Avatar name="John Doe" />,
        <Avatar name="Alex Turner" />,
        <Avatar name="Chris Dalton" />
    ];

    return (
        <Stack>
            <AvatarGroup size="xs">
                {avatars}
            </AvatarGroup>
            <AvatarGroup size="sm">
                {avatars}
            </AvatarGroup>
            <AvatarGroup size="md">
                {avatars}
            </AvatarGroup>
            <AvatarGroup size="lg">
                {avatars}
            </AvatarGroup>
            <AvatarGroup size="xl">
                {avatars}
            </AvatarGroup>
            <AvatarGroup size="2xl">
                {avatars}
            </AvatarGroup>
        </Stack>
    );
}
```

##### Pressable avatars

An avatar group can have pressable avatars, which will trigger an action when pressed.

```tsx
import { Avatar, AvatarGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <AvatarGroup>
            <Avatar name="John Doe" onPress={() => alert("John Doe")} />
            <Avatar name="Alex Turner" />
            <Avatar name="Chris Dalton" onPress={() => alert("Chris Dalton")} />
        </AvatarGroup>
    );
}
```

##### Max number of avatars

An avatar group can be limited to a maximum number of avatars.

```tsx
import { AnonymousAvatar, Avatar, AvatarGroup, DeletedAvatar } from "@hopper-ui/components";

export default function Example() {
    return (
        <AvatarGroup maxNumberOfAvatar={7}>
            <Avatar name="John Doe" />
            <Avatar name="Alex Turner" />
            <Avatar name="Chris Dalton" />
            <Avatar name="Alan Turing" />
            <Avatar name="Ada Lovelace" />
            <Avatar name="Grace Hopper" />
            <Avatar name="Marie Curie" />
            <Avatar name="Rosalind Franklin" />
            <DeletedAvatar aria-label="Alan Sheppard" />
            <AnonymousAvatar aria-label="Anonynous" />
        </AvatarGroup>
    );
}
```

### Best Practices

Any time you use an image to communicate a concept in Workleap, it's important to use descriptive alt text. Doing this is important for accessibility because it allows screen readers to describe what's in the image to people who may not be able to see it.

### Props

#### Avatar

| Prop        | Type                                                                                                 | Default               | Description                                                                                                                                                                        |
| ----------- | ---------------------------------------------------------------------------------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fallbackSrc | `string \| null`                                                                                     | "BrokenImageRichIcon" | The src of the image to display if the image fails to load. If set to null, the initials will be displayed instead.                                                                |
| imageProps  | `AvatarImageBaseProps`                                                                               |                       | Props to add to the img element when src is provided.                                                                                                                              |
| isDisabled  | `boolean`                                                                                            |                       | Whether or not the avatar is disabled.                                                                                                                                             |
| name        | `string`                                                                                             |                       | The name of the Avatar. This will be used for the alt text of the image or the initials if no image is provided.                                                                   |
| size        | `ResponsiveProp<AvatarSize>`                                                                         | "md"                  | The size of the avatar.                                                                                                                                                            |
| src         | `string`                                                                                             |                       | The src of the image to display. If not provided, the initials will be displayed instead.                                                                                          |
| className   | `string \| ((values: AvatarRenderProps & { defaultClassName: string; }) => string)`                  |                       | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| style       | `CSSProperties \| ((values: AvatarRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties)` |                       | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |

##### Events

| Prop    | Type                            | Default | Description                       |
| ------- | ------------------------------- | ------- | --------------------------------- |
| onPress | `((event: PressEvent) => void)` |         | Called when the avatar is pressed |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

#### AvatarGroup

| Prop              | Type                                         | Default | Description                                                                                              |
| ----------------- | -------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| size              | `ResponsiveProp<AvatarSize>`                 | "md"    | The size of the avatar.                                                                                  |
| maxNumberOfAvatar | `ResponsiveProp<number>`                     | 3       | The maximum number of avatars to show before showing the overflow indicator.                             |
| wrap              | `ResponsiveProp<boolean>`                    | true    | Whether or not to wrap the avatars.                                                                      |
| reverse           | `boolean`                                    |         | Whether or not to reverse the order of the avatars.                                                      |
| align             | `ResponsiveProp<Align>`                      | 'start' | The alignment of the avatars within the AvatarGroup.                                                     |
| children          | `AvatarGroupElement \| AvatarGroupElement[]` |         | The content of the AvatarGroup.                                                                          |
| style             | `CSSProperties`                              |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| className         | `string`                                     |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `retryCount` has been removed.
* `onClick` has been renamed to `onPress` to be closer to the [React Aria API](https://react-spectrum.adobe.com/react-aria/Button.html#events).

## Badge

A badge is used to bring attention to an element.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/badge/src/Badge.tsx>

A badge will communicate a small piece of information that users may be interested in, but would not impede them from achieving their task. They can also display the amount of item for an object.

```tsx
import { Badge } from "@hopper-ui/components";

export default function Example() {
    return (
        <Badge>12</Badge>
    );
}
```

### Usage

#### Disabled

A disabled badge is usually used inside other components that may be disabled, like a tag or a list box.

```tsx
import { Badge } from "@hopper-ui/components";

export default function Example() {
    return (
        <Badge isDisabled>12</Badge>
    );
}
```

#### Indeterminate

An indeterminate badge is used when the value is unknown or not applicable.

```tsx
import { Badge } from "@hopper-ui/components";

export default function Example() {
    return (
        <Badge />
    );
}
```

#### Variants

The different variants of a badge.

```tsx
import { Badge, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Badge variant="primary">BETA</Badge>
            <Badge variant="secondary">NEW</Badge>
            <Badge variant="subdued">50</Badge>
        </Inline>
    );
}
```

#### High Count

If a value above 99 is needed, use `99+` instead of the number.

```tsx
import { Badge } from "@hopper-ui/components";

export default function Example() {
    return (
        <Badge>99+</Badge>
    );
}
```

#### Text

A badge can have any text content.

```tsx
import { Badge } from "@hopper-ui/components";

export default function Example() {
    return (
        <Badge>New</Badge>
    );
}
```

### Best Practices

Badges benefit users by:

* Being clearly labeled with short, scannable text
* Being positioned to clearly identify the object they're informing or labelling.

#### Qualificative Badges

Badges can be used to qualify an object with a word or two. Most likely, badges will be used in specific situations, but are not limited to:

* New: to announce a new functionality or feature in Workleap. This badge should have a defined lifespan where at the end it is removed.
* Beta: to highlight that a functionality or feature is being released early to test and gather feedback. This badge should be accompanied by a Popover to provide more information to the user. This badge should have a defined lifespan where at the end it is removed.

#### Quantitative Badges

Badges can also be used to count the number of item for an object. To ensure the best scannability quantitative badges should:

* Not be displayed if the count is at zero.
* Display “+99” if the count goes beyond 99 items.
* Use the same interaction state of the related object.

### Props

| Prop            | Type                                                                                                | Default   | Description                                                                                                                                                                        |
| --------------- | --------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| variant         | `BadgeVariant`                                                                                      | "primary" | The visual style of the badge.                                                                                                                                                     |
| isDisabled      | `boolean`                                                                                           |           | Whether or not the badge is disabled.                                                                                                                                              |
| isIndeterminate | `boolean`                                                                                           |           | Whether or not the badge is indeterminate and should just be a dot. This will ignore any children.                                                                                 |
| children        | `ReactNode \| ((values: BadgeRenderProps & { defaultChildren: ReactNode; }) => ReactNode)`          |           | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className       | `string \| ((values: BadgeRenderProps & { defaultClassName: string; }) => string)`                  |           | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| style           | `CSSProperties \| ((values: BadgeRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties)` |           | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `highlight` is not supported.
* `pushed` is not supported.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* `size` is not supported.
* `variant` has different values.
* `icon` variant it not supported.
* `wrapperProps` has been removed.
* Badge is no longer floating. Use the `FloatingBadge` component to add this feature.
* `FloatingBadge` has new props such as `placement` and `offset`.
* `overlap` is used inside `FloatingBadge` and the new values are `circular` and `rectangular`.

## Box

A flexible container component that can render as any HTML element or React component. Supports all styled system props for consistent spacing, layout, and styling.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/box/src/Box.tsx>

```tsx
import { Box } from "@hopper-ui/components";

export default function Example() {
    return (
        <Box as="div" border="neutral" padding="inset-md">
            Software built for everyone to do their best work.
        </Box>
    );
}
```

### Best Practices

The `Box` component should not be used in place of standard HTML elements. Use `Div` or `Span` directly for that purpose. `Box` is meant to provide styled system properties to components that already accept `style` and `className`, such as third-party components.

`Box` should:

* Be used to **augment** components (often third-party) with layout/spacing/visual props when those components accept `className`/`style`.
* Keep the DOM **semantic**: always prefer the correct native element, or [use `htmlElement()` function](/styled-system/concepts/html-elements.md) for missing tags, instead of forcing `Box`.
* Use the `as` prop **sparingly**, and typically only to target non-native components (e.g., `as={RACButton}`) or in rare conditional cases where semantics truly change.
* Avoid introducing conflicting layout: prefer composing spacing on the **outermost** appropriate element.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Box } from "@hopper-ui/components";
  import { Button as RACButton } from "react-aria-components";

  export function Example() {
      return (
          <Box as={RACButton} padding="inset-sm" border="neutral">
              Click me
          </Box>
      );
  }
  ```

  Use Box to add spacing/layout to a third-party component that accepts className/style

* 🚫 Don't:

  ```tsx
  import { Box } from "@hopper-ui/components";

  export function Example() {
      return (
          <>
              <Box display="flex">
                  This should just be a <code>&lt;Inline&gt;</code>
              </Box>
              <Box display="flex" flexDirection="column">
                  This should just be a <code>&lt;Stack&gt;</code>
              </Box>
          </>
      );
  }
  ```

  Use Box as a generic \<Inline> or \<Stack> substitute

**Rule 2**

* ✅ Do:

  ```tsx
  import { htmlElement } from "@hopper-ui/styled-system";

  const IFrame = htmlElement("iframe");

  export function Example() {
      return (
          <IFrame src="https://example.com" width="core_1280" height="core_1280" />
      );
  }
  ```

  Create missing HTML elements with htmlElement() (e.g., IFrame) and use them directly

* 🚫 Don't:

  ```tsx
  import { Box } from "@hopper-ui/components";

  export function Example() {
      return (
          <Box as="iframe" src="https://example.com" />
      );
  }
  ```

  Render missing HTML tags via Box (e.g., \<Box as='iframe'>)

**Rule 3**

* ✅ Do:

  ```tsx
  import { Box } from "@hopper-ui/components";

  export function Example({ isClickable }: { isClickable: boolean }) {
      return (
          <Box as={isClickable ? "button" : "div"}>
              It is acceptable but not recommended
          </Box>
      );
  }
  ```

  Use the 'as' prop to flip between components

**Rule 4**

* 🚫 Don't:

  ```tsx
  import { Box, Card } from "@hopper-ui/components";

  export function Example() {
      return (
          <Box>
              <Box>
                  <Box>
                      <Card>Too many Boxes…</Card>
                  </Box>
              </Box>
          </Box>
      );
  }
  ```

  Wrap everything in Box or use it to override intrinsic spacing/styles of the child component

### Props

| Prop | Type          | Default | Description                    |
| ---- | ------------- | ------- | ------------------------------ |
| as   | `ElementType` | "div"   | The element type to render as. |

## Button

A button allows a user to initiate an action.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/buttons/src/Button.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/button/>

```tsx
import { Button, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Button>
            <SparklesIcon />
            <Text>Save</Text>
        </Button>
    );
}
```

### Anatomy

#### Structure

```tsx
<Button>
    <IconList /> /* (Optional) A list of icons in the button */
    <Icon /> /* (Optional) An icon in the button */
    <Text /> /* (Optional) Text in the button, required if using an Icon or an IconList */
</Button>
```

#### Composed Components

A `Button` uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| IconList  | An IconList encapsulates a collection of icons.                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### Variants

Each button variant has a particular function and its design signals that function to the user. It is therefore very important that the different variants are implemented consistently across products so that they message the correct actions.

```tsx
import { Button, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Button variant="primary">Save</Button>
            <Button variant="secondary">Save</Button>
            <Button variant="upsell">Save</Button>
            <Button variant="danger">Save</Button>
            <Button variant="ghost-primary">Save</Button>
            <Button variant="ghost-secondary">Save</Button>
            <Button variant="ghost-danger">Save</Button>
        </Inline>
    );
}
```

| Variant   | Purpose                                                                                                                                                                                                                                                                                         |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Primary   | For the principal call to action on the page. Primary buttons should only appear once per screen (not including the application header, modal or side panel).                                                                                                                                   |
| Secondary | For secondary actions on each page. Secondary buttons can be used in conjunction with a primary button or on its own. Paired with a Primary button, the secondary button usually performs the negative action of the set, such as “Cancel.”                                                     |
| Ghost     | For less prominent, and sometimes independent, actions. Ghost buttons can be used in isolation or paired with a primary button when there are multiple calls to action. Ghost buttons can also be used for sub-tasks on a page where a primary button for the main and final action is present. |
| Upsell    | For upsell actions that relates to upgrading an account or a plan. Use the upsell button to distinguish from an existing primary button. In some case a primary button can be used in its place when the general context of the page is about upselling.                                        |
| Danger    | For actions that could have destructive effects on the user's data.                                                                                                                                                                                                                             |

#### Sizes

A button can vary in size.

```tsx
import { Button, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Button variant="primary">Save</Button>
            <Button size="sm" variant="primary">Save</Button>
            <Button size="xs" variant="primary">Save</Button>
        </Inline>
    );
}
```

#### Disabled

A button can be disabled.

```tsx
import { Button, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Button isDisabled variant="primary">Save</Button>
            <Button isDisabled variant="ghost-primary">Save</Button>
        </Inline>
    );
}
```

#### Loading

A button can show a loading indicator. The button text is hidden but the button maintains the width that it would have if the text were visible.

```tsx
import { Button, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Button isLoading variant="primary">Save</Button>
            <Button isLoading variant="secondary">Save</Button>
            <Button isLoading variant="upsell">Save</Button>
            <Button isLoading variant="danger">Save</Button>
            <Button isLoading variant="ghost-primary">Save</Button>
            <Button isLoading variant="ghost-secondary">Save</Button>
            <Button isLoading variant="ghost-danger">Save</Button>
        </Inline>
    );
}
```

#### Pending

Buttons can indicate that a quick progress task is taking place (e.g., saving settings on a server). After a 1 second delay, an indeterminate spinner will be displayed in place of the button label and icon.

```tsx
import { Button } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [isLoading, setIsLoading] = useState(false);

    const handlePress = useCallback(() => {
        setIsLoading(true);

        setTimeout(() => {
            setIsLoading(false);
        }, 3000);
    }, [setIsLoading]);

    return (
        <Button isLoading={isLoading} onPress={handlePress}>
            Click me!
        </Button>
    );
}
```

#### Fluid

A button can be expanded to full width to fill its parent container.

```tsx
import { Button, Inline, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Button isFluid variant="primary">
                Save
            </Button>
            <Button isFluid variant="primary">
                <SparklesIcon />
                <Text>Save</Text>
            </Button>
            <Button isFluid>
                <Text>Save</Text>
                <SparklesIcon slot="end-icon" />
            </Button>
        </Inline>
    );
}
```

#### Icon Only

A button can contain only an icon. An accessible name must be provided through [aria-label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) prop. See also [WCAG practices](https://www.w3.org/TR/WCAG20-TECHS/ARIA6.html).

```tsx
import { Button, Inline } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Button aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </Button>
            <Button size="sm" aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </Button>
            <Button size="xs" aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </Button>
        </Inline>
    );
}
```

#### Icon

A button can contain icons.

```tsx
import { Button, Inline, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Button aria-label="Save" variant="secondary">
                <SparklesIcon />
                <Text>Save</Text>
            </Button>
            <Button size="sm" aria-label="Save" variant="secondary">
                <SparklesIcon />
                <Text>Save</Text>
            </Button>
            <Button size="xs" aria-label="Save" variant="secondary">
                <SparklesIcon />
                <Text>Save</Text>
            </Button>
        </Inline>
    );
}
```

#### End Icon

Nonstandard end icons can be provided to handle special cases. However, think twice before adding end icons, start icons should be your go-to.

```tsx
import { Button, Inline, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Button aria-label="Save" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Save</Text>
            </Button>
            <Button size="sm" aria-label="Save" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Save</Text>
            </Button>
            <Button size="xs" aria-label="Save" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Save</Text>
            </Button>
        </Inline>
    );
}
```

### Best Practices

Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. Button labels express what action will occur when the user interacts with it. Use buttons to communicate actions users can take and to allow users to interact with the page. Each page should have only one primary button, and any remaining calls to action should be represented as lower emphasis buttons.

#### Emphasis

You don't necessarily need to use the buttons in the order that their labels imply. For example, you don't always need to use the secondary button as the second button in your layout. The most important thing is to establish a visual hierarchy between the buttons in your interface. Keep these best practices in mind.

##### A single, high-emphasis button

As a general rule, a layout should contain a single high-emphasis button that makes it clear that other buttons have less importance in the hierarchy. This high-emphasis button commands the most attention.

##### Multiple button emphasis

A high-emphasis button can be accompanied by medium- and low-emphasis buttons that perform less important actions. Keep in mind that you should only groups together calls to action that have a relationship to one another.

#### Alignment

Alignment refers to whether the buttons are aligned to the right or the left of a container or layout. Buttons are unique, more so than any other component, in that their alignment depends on where they appear and whether or not they're contained within another component.

As a general rule, on full-page designs, the primary button is on the right side of the page. When the browser window is large and the user is scrolling to read, it's best to have the primary button where the users's attention has been focused all along. Whereas in wizards, where a user is progressing through a series of steps or modal, the primary action traditionally sits at the bottom right. Buttons within components are also right-aligned.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Button, Text } from "@hopper-ui/components";
  import { SparklesIcon } from "@hopper-ui/icons";

  <Button>
      <SparklesIcon />
      <Text>Save</Text>
  </Button>;
  ```

  When a Button contains anything other than a single text node, the accompanying text must be wrapped in a \<Text> component.

* 🚫 Don't:

  ```tsx
  import { Button } from "@hopper-ui/components";
  import { SparklesIcon } from "@hopper-ui/icons";

  <Button>
      <SparklesIcon />
      Save
  </Button>;
  ```

  Use text without \<Text> if you have anything other than a single text node inside the Button.

**Rule 2**

* ✅ Do:

  ```tsx
  import { Button } from "@hopper-ui/components";

  export default function Example() {
      return (
          <Button>
              Get started
          </Button>
      );
  }
  ```

  Use 1 or 2 words, no longer than 4 words, with fewer than 20 characters including spaces.

* 🚫 Don't:

  ```tsx
  import { Button } from "@hopper-ui/components";

  export default function Example() {
      return (
          <Button>
              Get started and enjoy discount!
          </Button>
      );
  }
  ```

  Use punctuation marks such as periods or exclamation points.

**Rule 3**

* ✅ Do:

  Use links when the desired action is to take the user to a new page.

* 🚫 Don't:

  Use buttons as navigational elements.

### Props

| Prop           | Type                                     | Default   | Description                                                                                                                                                                                                                    |
| -------------- | ---------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| variant        | `ButtonVariant`                          | "primary" | The visual style of the button.                                                                                                                                                                                                |
| size           | `ResponsiveProp<ButtonSize>`             | "md"      | A button can vary in size.                                                                                                                                                                                                     |
| isFluid        | `ResponsiveProp<boolean>`                |           | Whether or not the button takes up the width of its container.                                                                                                                                                                 |
| isLoading      | `boolean`                                |           | A button can show a loading indicator.                                                                                                                                                                                         |
| spinnerProps   | `SpinnerProps`                           |           | The props for the Spinner.                                                                                                                                                                                                     |
| form           | `string`                                 |           | The `<form>` element to associate the button with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form). |
| style          | `StyleOrFunction<ButtonRenderProps>`     |           | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                              |
| children       | `ChildrenOrFunction<ButtonRenderProps>`  |           | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                      |
| isDisabled     | `boolean`                                |           | Whether the button is disabled.                                                                                                                                                                                                |
| autoFocus      | `boolean`                                |           | Whether the element should receive focus on render.                                                                                                                                                                            |
| type           | `"button" \| "submit" \| "reset"`        | 'button'  | The behavior of the button when used in an HTML form.                                                                                                                                                                          |
| formAction     | `string`                                 |           | The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner.                                                                                                     |
| formEncType    | `string`                                 |           | Indicates how to encode the form data that is submitted.                                                                                                                                                                       |
| formMethod     | `string`                                 |           | Indicates the HTTP method used to submit the form.                                                                                                                                                                             |
| formNoValidate | `boolean`                                |           | Indicates that the form is not to be validated when it is submitted.                                                                                                                                                           |
| formTarget     | `string`                                 |           | Overrides the target attribute of the button's form owner.                                                                                                                                                                     |
| name           | `string`                                 |           | Submitted as a pair with the button's value as part of the form data.                                                                                                                                                          |
| value          | `string`                                 |           | The value associated with the button's name when it's submitted with the form data.                                                                                                                                            |
| dir            | `string`                                 |           |                                                                                                                                                                                                                                |
| lang           | `string`                                 |           |                                                                                                                                                                                                                                |
| inert          | `boolean`                                |           |                                                                                                                                                                                                                                |
| translate      | `"yes" \| "no"`                          |           |                                                                                                                                                                                                                                |
| className      | `ClassNameOrFunction<ButtonRenderProps>` |           | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                             |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLButtonElement>`                       |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLButtonElement>`                       |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-disabled       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element is disabled to users of assistive technology.                                                                                                                                                                                                                   |
| aria-expanded       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.                                                                                                                                                                                   |
| aria-haspopup       | `boolean \| "dialog" \| "menu" \| "grid" \| "true" \| "false" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls       | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-pressed        | `boolean \| "true" \| "false" \| "mixed"`                                             |         | Indicates the current "pressed" state of toggle buttons.                                                                                                                                                                                                                                      |
| aria-current        | `boolean \| "time" \| "true" \| "false" \| "page" \| "step" \| "location" \| "date"`  |         | Indicates whether this element represents the current item within a container or set of related elements.                                                                                                                                                                                     |
| preventFocusOnPress | `boolean`                                                                             |         | Whether to prevent focus from moving to the button when pressing it.Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.                  |
| excludeFromTabOrder | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                  | `string`                                                                              |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-label          | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby     | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby    | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details        | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `onClick` has been renamed to `onPress` to be closer to the [React Aria API](https://react-spectrum.adobe.com/react-aria/Button.html#events).
* `Counter` is no longer allowed as a specialized slot.
* `ButtonAsLink` is renamed to `LinkButton`.
* `IconButton` is now integrated into the Button component.
* `as(Button, ReactRouterLink)` is now integrated into the Button component.

## ButtonGroup

A button group handles the spacing and orientation for a grouping of buttons.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/buttons/src/ButtonGroup.tsx>

```tsx
import { Button, ButtonGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <ButtonGroup>
            <Button variant="secondary">No, thanks</Button>
            <Button variant="secondary">Remind me later</Button>
            <Button variant="primary">Rate Now</Button>
        </ButtonGroup>
    );
}
```

### Anatomy

#### Structure

```tsx
<ButtonGroup>
    {/* ButtonGroup requires at least two button components */}
    <Button /> /* A button in the button group */
    <LinkButton /> /* A link button in the button group */
</ButtonGroup>
```

#### Composed Components

A `ButtonGroup` uses the following component.

| Component  | Description                                               |
| ---------- | --------------------------------------------------------- |
| Button     | A button allows a user to initiate an action.             |
| LinkButton | A LinkButton looks like a button but behaves like a link. |

### Usage

#### Orientation

A button group can render his items vertically.

```tsx
import { Button, ButtonGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <ButtonGroup orientation="vertical">
            <Button variant="secondary">No, thanks</Button>
            <Button variant="secondary">Remind me later</Button>
            <Button variant="primary">Rate Now</Button>
        </ButtonGroup>
    );
}
```

#### Alignment

A button group can change the alignment of his items.

```tsx
import { Button, ButtonGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <ButtonGroup width="100%" align="end">
            <Button variant="secondary">No, thanks</Button>
            <Button variant="secondary">Remind me later</Button>
            <Button variant="primary">Rate Now</Button>
        </ButtonGroup>
    );
}
```

#### Disabled

A button group can be disabled.

```tsx
import { Button, ButtonGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <ButtonGroup isDisabled>
            <Button variant="secondary">No, thanks</Button>
            <Button variant="secondary">Remind me later</Button>
            <Button variant="primary">Rate Now</Button>
        </ButtonGroup>
    );
}
```

#### Fluid

A button group can be fluid.

```tsx
import { Button, ButtonGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <ButtonGroup isFluid>
            <Button variant="secondary">No, thanks</Button>
            <Button variant="secondary">Remind me later</Button>
            <Button variant="primary">Rate Now</Button>
        </ButtonGroup>
    );
}
```

#### Sizes

A button group can be of different sizes.

```tsx
import { Button, ButtonGroup, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <ButtonGroup>
                <Button variant="secondary">No, thanks</Button>
                <Button variant="secondary">Remind me later</Button>
                <Button variant="primary">Rate Now</Button>
            </ButtonGroup>
            <ButtonGroup size="sm">
                <Button variant="secondary">No, thanks</Button>
                <Button variant="secondary">Remind me later</Button>
                <Button variant="primary">Rate Now</Button>
            </ButtonGroup>
            <ButtonGroup size="xs">
                <Button variant="secondary">No, thanks</Button>
                <Button variant="secondary">Remind me later</Button>
                <Button variant="primary">Rate Now</Button>
            </ButtonGroup>
        </Stack>
    );
}
```

### Best Practices

#### Emphasis

You don't necessarily need to use the buttons in the order that their labels imply. For example, you don't always need to use the secondary button as the second button in your layout. The most important thing is to establish a visual hierarchy between the buttons in your interface. Keep these best practices in mind.

##### A single, high-emphasis button

As a general rule, a layout should contain a single high-emphasis button that makes it clear that other buttons have less importance in the hierarchy. This high-emphasis button commands the most attention.

##### Multiple button emphasis

A high-emphasis button can be accompanied by medium- and low-emphasis buttons that perform less important actions. Keep in mind that you should only groups together calls to action that have a relationship to one another.

#### Alignment

Alignment refers to whether the buttons are aligned to the right or the left of a container or layout. Buttons are unique, more so than any other component, in that their alignment depends on where they appear and whether or not they're contained within another component.

As a general rule, on full-page designs, the primary button is on the right side of the page. When the browser window is large and the user is scrolling to read, it's best to have the primary button where the users's attention has been focused all along. Whereas in wizards, where a user is progressing through a series of steps or modal, the primary action traditionally sits at the bottom right. Buttons within components are also right-aligned.

### Props

| Prop        | Type                          | Default      | Description                                                                                              |
| ----------- | ----------------------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| orientation | `ResponsiveProp<Orientation>` | 'horizontal' | The axis the ButtonGroup should align with.                                                              |
| isDisabled  | `boolean`                     |              | Whether the Buttons in the ButtonGroup are all disabled.                                                 |
| isFluid     | `ResponsiveProp<boolean>`     |              | Whether the Buttons in the ButtonGroup are all fluid.                                                    |
| size        | `ResponsiveProp<ButtonSize>`  | "md"         | The size of the buttons in the ButtonGroup.                                                              |
| wrap        | `ResponsiveProp<boolean>`     | true         | Whether elements are forced onto one line or can wrap onto multiple rows.                                |
| align       | `ResponsiveProp<Align>`       | 'start'      | The alignment of the buttons within the ButtonGroup.                                                     |
| style       | `CSSProperties`               |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children    | `ReactNode`                   |              | The children of the component.                                                                           |
| className   | `string`                      |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `fluid` has been renamed `isFluid`.
* `disabled` has been renamed `isDisabled`.

## Calendar

A calendar displays one or more date grids and allows users to select a single date.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/calendar/src/Calendar.tsx>

```tsx
import { Calendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" />
    );
}
```

### Usage

#### Value

A Calendar has no selection by default. An initial, uncontrolled value can be provided to the Calendar using the `defaultValue` prop. Alternatively, a controlled value can be provided using the `value` prop.

Date values are provided using objects in the [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/index.html) package. This library handles correct international date manipulation across calendars, time zones, and other localization concerns.

Calendar supports values with both date and time components, but only allows users to modify the date. By default, Calendar will emit `CalendarDate` objects in the onChange event, but if a `CalendarDateTime` or `ZonedDateTime` object is passed as the value or defaultValue, values of that type will be emitted, changing only the date and preserving the time components.

```tsx
import { Calendar, Inline, type DateValue } from "@hopper-ui/components";
import { parseDate } from "@internationalized/date";
import { useState } from "react";

export default function Example() {
    const [value, setValue] = useState<DateValue>(parseDate("2020-02-03"));

    return (
        <Inline>
            <Calendar
                aria-label="Date (uncontrolled)"
                defaultValue={parseDate("2020-02-03")}
            />
            <Calendar
                aria-label="Date (controlled)"
                value={value}
                onChange={setValue}
            />
        </Inline>
    );
}
```

#### Controlled

A calendar can handle value state in controlled mode.

```tsx
import { Calendar, Paragraph, Stack, type DateValue } from "@hopper-ui/components";
import { getLocalTimeZone, parseDate } from "@internationalized/date";
import { useState } from "react";
import { useDateFormatter } from "react-aria";

export default function Example() {
    const [date, setDate] = useState<DateValue>(parseDate("2020-02-03"));
    const formatter = useDateFormatter({ dateStyle: "full" });

    return (
        <Stack>
            <Calendar
                aria-label="Date (controlled)"
                value={date}
                onChange={setDate}
            />
            <Paragraph>Selected date: {formatter.format(date.toDate(getLocalTimeZone()))}</Paragraph>
        </Stack>
    );
}
```

#### Multi-month

Multiple CalendarGrid elements can be rendered to show multiple months at once. The `visibleMonths` prop should be provided to the Calendar component to specify how many months are visible.

```tsx
import { Calendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" visibleMonths={3} />
    );
}
```

##### Page Behavior

The `pageBehavior` prop allows you to control how the calendar navigates between months. By default, the calendar will navigate by `visibleMonths`, but by setting `pageBehavior` to `single`, pagination will be by one month.

```tsx
import { Calendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" visibleMonths={3} pageBehavior="single" />
    );
}
```

##### Fixed weeks

The `isFixedWeeks` prop allows you to control whether the calendar displays fixed weeks. By default, the calendar will display variable weeks, but by setting `isFixedWeeks` to true, all months will be displayed with 6 weeks. This ensures that the height of the calendar does not change when navigating between months.

```tsx
import { Calendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" isFixedWeeks />
    );
}
```

#### Validation

##### Min and Max

The `minValue` and `maxValue` props can be used to limit the range of dates that a user can select.

```tsx
import { Calendar } from "@hopper-ui/components";
import { getLocalTimeZone, today } from "@internationalized/date";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" minValue={today(getLocalTimeZone())} />
    );
}
```

##### Unavailable Dates

Calendar supports marking certain dates as unavailable. These dates remain focusable with the keyboard so that navigation is consistent, but cannot be selected by the user. The `isDateUnavailable` prop accepts a callback that is called to evaluate whether each visible date is unavailable.

This example includes multiple unavailable date ranges, e.g. dates when no appointments are available. In addition, all weekends are unavailable. The `minValue` prop is also used to prevent selecting dates before today.

```tsx
import { Calendar, useLocale, type DateValue } from "@hopper-ui/components";
import { getLocalTimeZone, isWeekend, today } from "@internationalized/date";

export default function Example() {
    const now = today(getLocalTimeZone());
    const disabledRanges = [
        [now, now.add({ days: 5 })],
        [now.add({ days: 14 }), now.add({ days: 16 })],
        [now.add({ days: 23 }), now.add({ days: 24 })]
    ];

    const { locale } = useLocale();
    const getIsDateUnavailable = (date: DateValue) =>
        isWeekend(date, locale) ||
        disabledRanges.some(interval => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0);

    return (
        <Calendar aria-label="Appointment date" minValue={today(getLocalTimeZone())} isDateUnavailable={getIsDateUnavailable} />
    );
}
```

##### Error message

Calendar tries to avoid allowing the user to select invalid dates in the first place. However, if according to application logic a selected date is invalid, the `isInvalid` prop can be set. This alerts assistive technology users that the selection is invalid, and can be used for styling purposes as well. In addition, the errorMessage slot may be used to help the user fix the issue.

This example validates that the selected date is a weekday and not a weekend according to the current locale.

```tsx
import { Calendar, useLocale, type DateValue } from "@hopper-ui/components";
import { isWeekend, parseDate } from "@internationalized/date";
import { useState } from "react";

export default function Example() {
    const [date, setDate] = useState<DateValue>(parseDate("2023-06-25"));
    const { locale } = useLocale();
    const isInvalid = isWeekend(date, locale);

    return (
        <Calendar
            aria-label="Appointment date"
            value={date}
            onChange={setDate}
            isInvalid={isInvalid}
            errorMessage="We are closed on weekends"
        />
    );
}
```

#### Disabled

A calendar can be disabled.

```tsx
import { Calendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" isDisabled />
    );
}
```

#### Read-only

A calendar can be read-only.

```tsx
import { Calendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" isReadOnly />
    );
}
```

#### Custom First Day of the Week

By default, the first day of the week is automatically set based on the current locale. This can be changed by setting the `firstDayOfWeek` prop to "sun", "mon", "tue", "wed", "thu", "fri", or "sat".

```tsx
import { Calendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <Calendar aria-label="Appointment date" firstDayOfWeek="mon" />
    );
}
```

### Props

| Prop                | Type                                                          | Default  | Description                                                                                                                                                                                                                                      |
| ------------------- | ------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| errorMessage        | `ReactNode`                                                   |          | The error message to display when the calendar is invalid.                                                                                                                                                                                       |
| visibleMonths       | `number`                                                      | 1        | The number of months to display at once.                                                                                                                                                                                                         |
| isFixedWeeks        | `boolean`                                                     | false    | Whether the calendar should always display 6 weeks.                                                                                                                                                                                              |
| style               | `StyleOrFunction<CalendarRenderProps>`                        |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                |
| minValue            | `DateValue \| null`                                           |          | The minimum allowed date that a user may select.                                                                                                                                                                                                 |
| maxValue            | `DateValue \| null`                                           |          | The maximum allowed date that a user may select.                                                                                                                                                                                                 |
| isDateUnavailable   | `((date: DateValue) => boolean)`                              |          | Callback that is called for each date of the calendar. If it returns true, then the date is unavailable.                                                                                                                                         |
| isDisabled          | `boolean`                                                     | false    | Whether the calendar is disabled.                                                                                                                                                                                                                |
| isReadOnly          | `boolean`                                                     | false    | Whether the calendar value is immutable.                                                                                                                                                                                                         |
| autoFocus           | `boolean`                                                     | false    | Whether to automatically focus the calendar when it mounts.                                                                                                                                                                                      |
| focusedValue        | `DateValue \| null`                                           |          | Controls the currently focused date within the calendar.                                                                                                                                                                                         |
| defaultFocusedValue | `DateValue \| null`                                           |          | The date that is focused when the calendar first mounts (uncountrolled).                                                                                                                                                                         |
| isInvalid           | `boolean`                                                     |          | Whether the current selection is invalid according to application logic.                                                                                                                                                                         |
| pageBehavior        | `PageBehavior`                                                | visible  | Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.                                                                                              |
| firstDayOfWeek      | `"sun" \| "mon" \| "tue" \| "wed" \| "thu" \| "fri" \| "sat"` |          | The day that starts the week.                                                                                                                                                                                                                    |
| selectionAlignment  | `"center" \| "start" \| "end"`                                | 'center' | Determines the alignment of the visible months on initial render based on the current selection or current date if there is no selection.                                                                                                        |
| value               | `DateValue \| null`                                           |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue        | `DateValue \| null`                                           |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| createCalendar      | `((identifier: CalendarIdentifier) => Calendar)`              |          | A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a given calendar identifier. If not provided, the `createCalendar` function from `@internationalized/date` will be used. |
| className           | `ClassNameOrFunction<CalendarRenderProps>`                    |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                               |
| dir                 | `string`                                                      |          |                                                                                                                                                                                                                                                  |
| lang                | `string`                                                      |          |                                                                                                                                                                                                                                                  |
| inert               | `boolean`                                                     |          |                                                                                                                                                                                                                                                  |
| translate           | `"yes" \| "no"`                                               |          |                                                                                                                                                                                                                                                  |

##### Events

| Prop                        | Type                                     | Default | Description                                           |
| --------------------------- | ---------------------------------------- | ------- | ----------------------------------------------------- |
| onFocusChange               | `((date: CalendarDate) => void)`         |         | Handler that is called when the focused date changes. |
| onChange                    | `((value: DateValue) => void)`           |         | Handler that is called when the value changes.        |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                       |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                       |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                       |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                       |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                       |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                       |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                       |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                       |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                       |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                       |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                       |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                       |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                       |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## Callout

A Callout informs users about important changes or persistent conditions. Use this component to communicate to users in a prominent way. Callouts are placed at the top of the page or section they apply to, and below the page or section header.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/callout/src/Callout.tsx>

```tsx
import { Button, Callout, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <Callout onClose={() => alert("Closed")}>
            <Heading>New users will be automatically invited</Heading>
            <Content>You have selected to automatically invite users when they are created.</Content>
            <Button >Undo</Button>
        </Callout>
    );
}
```

### Anatomy

#### Structure

```tsx
<Callout>
    <Header /> /* (Optional) A header for the callout */
    <Content /> /* (Required) The main content of the callout */
    <Button /> /* (Optional) A button for the callout */
    <RichIcon /> /* (Optional) A rich icon for the callout */
</Callout>
```

#### Composed Components

A `Callout` uses the following components:

| Component | Description                                                 |
| --------- | ----------------------------------------------------------- |
| Button    | A button allows a user to initiate an action.               |
| Content   | A placeholder for the main content section of a component.  |
| Header    | A placeholder for an header section.                        |
| RichIcon  | A rich icon component is used to render a rich custom icon. |

### Usage

#### Variants

A callout can use different variants.

```tsx
import { Button, Callout, Content, Heading, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Callout onClose={() => alert("Closed")}>
                <Heading>New users will be automatically invited</Heading>
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button >Undo</Button>
            </Callout>
            <Callout onClose={() => alert("Closed")} variant="success">
                <Heading>New users will be automatically invited</Heading>
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button >Undo</Button>
            </Callout>
            <Callout onClose={() => alert("Closed")} variant="warning">
                <Heading>New users will be automatically invited</Heading>
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button >Undo</Button>
            </Callout>
            <Callout onClose={() => alert("Closed")} variant="upsell">
                <Heading>New users will be automatically invited</Heading>
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button >Undo</Button>
            </Callout>
        </Stack>

    );
}
```

#### Hide Icon

A callout can hide the icon in scenarios where it takes up too much space, such as very small breakpoints.

```tsx
import { Button, Callout, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <Callout onClose={() => alert("Closed")} hideIcon>
            <Heading>New users will be automatically invited</Heading>
            <Content>You have selected to automatically invite users when they are created.</Content>
            <Button >Undo</Button>
        </Callout>
    );
}
```

#### Custom Icon

A callout can have a custom rich icon.

```tsx
import { Button, Callout, Content, Heading } from "@hopper-ui/components";
import { IdeaRichIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Callout onClose={() => alert("Closed")}>
            <IdeaRichIcon />
            <Heading>New users will be automatically invited</Heading>
            <Content>You have selected to automatically invite users when they are created.</Content>
            <Button >Undo</Button>
        </Callout>
    );
}
```

#### Dismissable

A callout is only dismissable when `onClose` prop is set.

Here's an example without `onClose`.

```tsx
import { Button, Callout, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <Callout>
            <Heading>New users will be automatically invited</Heading>
            <Content>You have selected to automatically invite users when they are created.</Content>
            <Button >Undo</Button>
        </Callout>
    );
}
```

#### Inline callout

Within a container, a callout shouldn't have borders. Here's an example of a callout inside a Card.

```tsx
import { Button, Callout, Card, Content, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <Card padding="core_240">
            <Callout onClose={() => alert("Closed")} fillStyle="subtleFill">
                <Heading>New users will be automatically invited</Heading>
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button >Undo</Button>
            </Callout>
        </Card>
    );
}
```

### Best Practices

Callouts should:

* Be used thoughtfully and sparingly for only the most important information.
* Not be used to call attention to what a user needs to do in the interface instead of making the action clear in the UI itself.
* Not be the primary entry point to information or actions users need to take.
* Remove the icon only in scenarios where it takes up too much space, such as very small breakpoints.

#### Placement

Callouts should be place in the appropriate context:

* Callouts relevant to an entire page should be placed at the top of that page, below the page header. They should occupy the full width of the content area.
* Callouts related to a section of a page should be placed inside that section, below any section heading. These callouts have less spacing and a pared-back design to fit within a content context.
* Banner related to an element more specific than a section should be placed immediately above or below that element.

### Props

#### Callout

| Prop      | Type                       | Default       | Description                                                                                              |
| --------- | -------------------------- | ------------- | -------------------------------------------------------------------------------------------------------- |
| variant   | `CalloutVariant`           | "information" | The overall hue of the callout.                                                                          |
| fillStyle | `"border" \| "subtleFill"` | "border"      | The appearance of the callout.                                                                           |
| hideIcon  | `ResponsiveProp<boolean>`  |               | If true, the callout won't have an icon                                                                  |
| style     | `CSSProperties`            |               | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children  | `ReactNode`                |               | The children of the component.                                                                           |
| className | `string`                   |               | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Events

| Prop    | Type           | Default | Description                                                   |
| ------- | -------------- | ------- | ------------------------------------------------------------- |
| onClose | `(() => void)` |         | Callback function that happens when the callout is dismissed. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## Card

Cards are used to group similar concepts and tasks to make it easier for users to scan, read and get things done.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/card/src/Card.tsx>

```tsx
import { Card } from "@hopper-ui/components";

export default function Example() {
    return (
        <Card padding="inset-squish-lg" maxWidth="1/2">
            Software built for everyone to do their best work
        </Card>
    );
}
```

### Usage

#### Variants

A card can use different variants. Second-level cards need to be used within a first-level card.

| Variant      | Purpose                                                                                                                                                                                |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| main         | Main cards are used to set the first level of content of the page. They use neutral-surface and border-weak tokens with no elevation. Most content is intended to be set in this card. |
| second-level | Second-level cards are used to group elements that are interactive within a main card with an overarching context, like a small form. They use a neutral-surface-weak token.           |

```tsx
import { Card, H2, H3, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Card padding="inset-squish-lg" width="3/4" gap="stack-md">
            <H2>Roles</H2>
            <Card gap="stack-md" padding="inset-squish-lg" variant="second-level">
                <H3>Manager</H3>
                <Text>A manager leads team operations, aligns goals, and fosters a productive work environment to achieve results.</Text>
            </Card>
        </Card>
    );
}
```

#### Sections

A card can use a header, content, and footer section.

```tsx
import { Card, H3, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Card gap="inline-lg" padding="inset-squish-lg" UNSAFE_maxWidth="30rem" width="100%">
            <H3>Developer</H3>
            <Text>
                A developer builds and maintains software, ensuring functionality, performance, and alignment with project goals.
            </Text>
            <Text>Start date : <em>September 13th</em></Text>
        </Card>
    );
}
```

#### Layout Samples

To facilitate the migration process, we've provided layout samples as reference guides. These examples demonstrate how to recreate features previously supported in [Orbiter](https://wl-orbiter-website.netlify.app/?path=/docs/card--default-story).

##### Default

```tsx
import { Card, H3, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Card padding="inset-lg" UNSAFE_maxWidth="30rem" width="100%" gap="stack-md">
            <H3>NASA Headquarters</H3>
            <Text>NASA Headquarters, officially known as Mary W. Jackson NASA Headquarters or NASA HQ and formerly named Two Independence Square, is a low-rise office building in the two-building Independence Square complex at 300 E Street SW in Washington, D.C.</Text>
        </Card>
    );
}
```

##### Image

```tsx
import { Card, H3, Image, Stack, Text } from "@hopper-ui/components";

import SpaceLandscape from "./assets/space-landscape.png";

export default function Example() {
    return (
        <Card UNSAFE_maxWidth="30rem" width="100%" overflow="hidden">
            <Image src={SpaceLandscape.src} alt="Space landscape" objectFit="cover" width="100%" UNSAFE_height="8rem" />
            <Stack padding="inset-lg">
                <H3>NASA Headquarters</H3>
                <Text>NASA Headquarters, officially known as Mary W. Jackson NASA Headquarters or NASA HQ and formerly named Two Independence Square, is a low-rise office building in the two-building Independence Square complex at 300 E Street SW in Washington, D.C.</Text>
            </Stack>
        </Card>
    );
}
```

##### Illustration

```tsx
import { Card, Flex, H3, Image, Stack, Text } from "@hopper-ui/components";

import planet from "./assets/planet.png";

export default function Example() {
    return (
        <Card UNSAFE_maxWidth="30rem" width="100%" overflow="hidden">
            <Flex UNSAFE_height="8rem" backgroundColor="primary-weak" alignItems="center" justifyContent="center">
                <Image src={planet.src} alt="Planet" />
            </Flex>
            <Stack padding="inset-lg">
                <H3 marginBottom="inline-lg">NASA Headquarters</H3>
                <Text>NASA Headquarters, officially known as Mary W. Jackson NASA Headquarters or NASA HQ and formerly named Two Independence Square, is a low-rise office building in the two-building Independence Square complex at 300 E Street SW in Washington, D.C.</Text>
            </Stack>
        </Card>
    );
}
```

##### Size

```tsx
import { Card, H3, Inline, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline gap="inline-sm" wrap="wrap">
            <Card padding="inset-lg" UNSAFE_maxWidth="16rem" width="100%" gap="stack-md">
                <H3>XS Card</H3>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                </Text>
            </Card>
            <Card padding="inset-lg" UNSAFE_maxWidth="20rem" width="100%" gap="stack-md">
                <H3>SM Card</H3>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                </Text>
            </Card>
            <Card padding="inset-lg" UNSAFE_maxWidth="30rem" width="100%" gap="stack-md">
                <H3>MD Card</H3>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                </Text>
            </Card>
            <Card padding="inset-lg" UNSAFE_maxWidth="35rem" width="100%" gap="stack-md">
                <H3>LG Card</H3>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                </Text>
            </Card>
            <Card padding="inset-lg" UNSAFE_maxWidth="40rem" width="100%" gap="stack-md">
                <H3>XL Card</H3>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                </Text>
            </Card>
        </Inline>
    );
}
```

##### Button

```tsx
import { Button, Card, H3, Inline, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Card padding="inset-lg" UNSAFE_maxWidth="30rem" width="100%" gap="stack-md">
            <Inline alignX="space-between" wrap gap="inline-md">
                <H3>NASA Headquarters</H3>
                <Text>No visitors allowed.</Text>
            </Inline>
            <Text>NASA Headquarters, officially known as Mary W. Jackson NASA Headquarters or NASA HQ and formerly named Two Independence Square, is a low-rise office building in the two-building Independence Square complex at 300 E Street SW in Washington, D.C.</Text>
            <Button variant="secondary">Plan a visit</Button>
        </Card>
    );
}
```

##### Button group

```tsx
import { Button, ButtonGroup, Card, H3, Stack, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Card gap="stack-md" padding="inset-lg" UNSAFE_maxWidth="30rem" width="100%">
            <H3>NASA Headquarters</H3>
            <Stack>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                    <br />
                </Text>
                <em>Any trespassers are going to be sent in space.</em>
            </Stack>
            <ButtonGroup>
                <Button>Plan a visit</Button>
                <Button variant="secondary">Cancel a booking</Button>
            </ButtonGroup>
        </Card>
    );
}
```

##### Orientation

```tsx
import { Card, Flex, H3, Image, Stack, Text } from "@hopper-ui/components";

import planet from "./assets/planet.png";

export default function Example() {
    return (
        <Card UNSAFE_maxWidth="30rem" width="100%" display="grid" gridTemplateAreas={["image aside"]} gridTemplateColumns={["max-content", "auto"]} alignItems="start" overflow="hidden" >
            <Flex height="100%" backgroundColor="primary-weak" alignItems="center" justifyContent="center" padding="inset-md">
                <Image src={planet.src} alt="Planet" />
            </Flex>
            <Stack padding="inset-lg">
                <H3>NASA</H3>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                </Text>
                <em>Please note that we are moving from December 12th to December 23rd.</em>
            </Stack>
        </Card>
    );
}
```

##### Fluid

```tsx
import { Card, Flex, H3, Image, Stack, Text } from "@hopper-ui/components";

import planet from "./assets/planet.png";

export default function Example() {
    return (
        <Card display="grid" gridTemplateAreas={["image aside"]} gridTemplateColumns={["max-content", "auto"]} width="100%" overflow="hidden" >
            <Flex backgroundColor="primary-weak" alignItems="center" justifyContent="center" padding="inset-md">
                <Image src={planet.src} alt="Planet" />
            </Flex>
            <Stack padding="inset-lg">
                <H3>NASA</H3>
                <Text>
                    300 E. Street SW, Suite 5R30
                    <br />
                    Washington, DC 20546
                    <br />
                    (202) 358-0001 (Office)
                    <br />
                    (202) 358-4338 (Fax)
                </Text>
                <em>Please note that we are moving from December 12th to December 23rd.</em>
            </Stack>
        </Card>
    );
}
```

### Best Practices

Cards are used to group related information together. They follow a specific hierarchy to help users scan through content easily. Whatever the level of hierarchy, Cards all share a 8px border radius.

Cards should:

* Display information that prioritizes what the user needs to know most first.
* Use headings that set clear expectations about the card's purpose.
* Avoid too many CTA or links and only one primary CTA per card

### Props

| Prop      | Type                       | Default | Description                                                                                              |
| --------- | -------------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| variant   | `"main" \| "second-level"` | "main"  | The visual style of the card.                                                                            |
| elevation | `"flat" \| "elevated"`     | "flat"  | Whether the card has a shadow or not.                                                                    |
| style     | `CSSProperties`            |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children  | `ReactNode`                |         | The children of the component.                                                                           |
| className | `string`                   |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `outline` variant has been renamed `main`.
* `elevated` variant has been renamed `second-level`. You shouldn't use a `second-level` variant without a parent `main` variant.
* `orientation` has been removed. Refer to this [sample](#orientation) to see an implementation example.
* `fluid` prop has been removed. Refer to this [sample](#fluid) to see an implementation example.
* `size` has been removed. Refer to this [sample](#size) to quickly match old sizes.
* The Hopper Card component does not include predefined layouts; developers are responsible for implementing any required [layouts](#migration-notes-layout-samples) to meet their specific needs..

## Checkbox

Checkboxes are used for multiple choices, not for mutually exclusive choices. Each checkbox works independently from other checkboxes in the list, therefore checking an additional box does not affect any other selections.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/checkbox/src/Checkbox.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/>

```tsx
import { Checkbox } from "@hopper-ui/components";

export default function Example() {
    return (
        <Checkbox>Developer</Checkbox>
    );
}
```

### Anatomy

#### Structure

```tsx
<Checkbox>
    <IconList /> /* (Optional) A list of icons in the checkbox */
    <Icon /> /* (Optional) An icon in the checkbox */
    <Text /> /* (Optional) Text in the checkbox, required if using an Icon or an IconList */
</Checkbox>
```

#### Composed Components

A `Checkbox` uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| IconList  | An IconList encapsulates a collection of icons.                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### No Label

A checkbox can be rendered without a label.

```tsx
import { Checkbox } from "@hopper-ui/components";

export default function Example() {
    return (
        <Checkbox aria-label="Developer" />
    );
}
```

#### Checked

A checkbox can be checked.

```tsx
import { Checkbox } from "@hopper-ui/components";

export default function Example() {
    return (
        <Checkbox defaultSelected>Developer</Checkbox>
    );
}
```

#### Indeterminate

A checkbox can be indeterminate.

```tsx
import { Checkbox } from "@hopper-ui/components";

export default function Example() {
    return (
        <Checkbox isSelected isIndeterminate>Developer</Checkbox>
    );
}
```

#### Disabled

A checkbox can be disabled.

```tsx
import { Checkbox } from "@hopper-ui/components";

export default function Example() {
    return (
        <Checkbox isDisabled>Developer</Checkbox>
    );
}
```

#### Read-only

A checkbox can be read-only.

```tsx
import { Checkbox } from "@hopper-ui/components";

export default function Example() {
    return (
        <Checkbox isReadOnly>Developer</Checkbox>
    );
}
```

#### Invalid

A checkbox can be invalid.

```tsx
import { Checkbox } from "@hopper-ui/components";

export default function Example() {
    return (
        <Checkbox isInvalid>Developer</Checkbox>
    );
}
```

#### Sizes

A checkbox can vary in size.

```tsx
import { Checkbox, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Checkbox size="sm">Developer</Checkbox>
            <Checkbox size="md">Designer</Checkbox>
        </Inline>
    );
}
```

#### Icon

A checkbox can be rendered with an icon or an icon list.

```tsx
import { Checkbox, IconList, Inline, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Checkbox>
                <Text>Developer</Text>
                <SparklesIcon />
            </Checkbox>
            <Checkbox>
                <Text>Designer</Text>
                <IconList>
                    <SparklesIcon />
                    <SparklesIcon />
                </IconList>
            </Checkbox>
        </Inline>
    );
}
```

#### Description

A checkbox can have a description to provide more information to the user.

```tsx
import { Checkbox, CheckboxField } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxField description="Team Manager">
            <Checkbox>Manager</Checkbox>
        </CheckboxField>
    );
}
```

### Best Practices

Checkboxes should:

* Work independently from each other. Selecting one checkbox should not change the selection status of another checkbox in the list. The exception is when a checkbox is used to make a bulk selection of multiple items.
* Be framed positively.
* Always have a label when used to activate or deactivate a setting.
* Be listed according to a logical order, whether it's alphabetically, numerical, time-based, or some other clear system.
* Link to more information or include a helper text as required to provide more explanation. Don't rely on tooltips to explain a checkbox.

You can use checkboxes in many situations, such as:

* Forms: that can be in a full-page layout, in a modal or a panel.
* Filtering and batch action: to filter data either on a page, in a menu, or within a component. Checkboxes can be used in Tables for batch editing purposes.
* Tiles: to perform a selection over a collection of tiles that are related to one another.

#### Alignment

Checkbox labels are positioned to the right of their inputs. If there is a checkbox grouping, they can be laid out vertically. When possible, arrange the checkbox and radio button groups vertically for easier reading.

#### Placement

The checkbox component is often used in forms. Forms can be placed on a full page, in a modal or in a side panel. A checkbox can also be used for agreeing to terms and conditions or to filter information. Checkboxes in a form should be placed at least 24px below of before the next component. There's a space of 8px between each checkbox within a grouping.

#### Overflow content

We recommend checkbox labels being fewer than three words. If you are tight on space, consider rewording the label. Do not truncate checkbox label text with an ellipsis. Long labels may wrap to a second line, and this is preferable than truncation. The text should wrap beneath the checkbox so the control and label are top aligned.

#### Checkbox vs. Switch

Checkbox and Switch components are very similar in term of results when used in a form. However, a few details tell them apart.

* Checkbox component can offer multiple options to the user, while the Switch only offers one.
* Users can select none to any option with checkboxes, while the Switch always have one active selection at all time (either “on” or “off” position)
* Choices offered in checkbox grouping are independant from each other, while the Switch's mutually exclusive.
* The Switch's selection takes effect immediately, while the checkbox only happens once the user applied the change.

#### Behaviors

##### States

The checkbox input allows for a series of states: unselected, selected and indeterminate. The default view of a set of checkboxes is have no option selected. Use the indeterminate state when the checkbox contains a sublist of selections, some of which are selected, and some unselected.

##### Interactions

Users can trigger an item by clicking the checkbox input directly or by clicking the checkbox label. Having both regions interactive create a more accessible click target. The only hover effect when the mouse is placed over the target is a pointer shape change.

### Props

#### Checkbox

| Prop               | Type                                                    | Default  | Description                                                                                                                                                                                                                               |
| ------------------ | ------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| size               | `ResponsiveProp<FieldSize>`                             | "md"     | A checkbox can vary in size.                                                                                                                                                                                                              |
| form               | `string`                                                |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).              |
| style              | `StyleOrFunction<CheckboxRenderProps>`                  |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                         |
| children           | `ChildrenOrFunction<CheckboxRenderProps>`               |          | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                 |
| validationBehavior | `"native" \| "aria"`                                    | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                            |
| isIndeterminate    | `boolean`                                               |          | Indeterminism is presentational only. The indeterminate visual representation remains regardless of user interaction.                                                                                                                     |
| value              | `string`                                                |          | The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).                                                                           |
| defaultSelected    | `boolean`                                               |          | Whether the element should be selected (uncontrolled).                                                                                                                                                                                    |
| isSelected         | `boolean`                                               |          | Whether the element should be selected (controlled).                                                                                                                                                                                      |
| isDisabled         | `boolean`                                               |          | Whether the input is disabled.                                                                                                                                                                                                            |
| isReadOnly         | `boolean`                                               |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                            |
| isRequired         | `boolean`                                               |          | Whether user input is required on the input before form submission.                                                                                                                                                                       |
| isInvalid          | `boolean`                                               |          | Whether the input value is invalid.                                                                                                                                                                                                       |
| validate           | `((value: boolean) => true \| ValidationError \| null)` |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead. |
| autoFocus          | `boolean`                                               |          | Whether the element should receive focus on render.                                                                                                                                                                                       |
| name               | `string`                                                |          | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                             |
| dir                | `string`                                                |          |                                                                                                                                                                                                                                           |
| lang               | `string`                                                |          |                                                                                                                                                                                                                                           |
| inert              | `boolean`                                               |          |                                                                                                                                                                                                                                           |
| translate          | `"yes" \| "no"`                                         |          |                                                                                                                                                                                                                                           |
| inputRef           | `RefObject<HTMLInputElement \| null>`                   |          | A ref for the HTML input element.                                                                                                                                                                                                         |
| className          | `ClassNameOrFunction<CheckboxRenderProps>`              |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                        |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onChange                    | `((isSelected: boolean) => void)`                         |         | Handler that is called when the element's selection state changes.                                                                                                                                        |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLLabelElement>`                        |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLLabelElement>`                        |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type      | Default | Description                                                                                                                                                                                                                                                                                   |
| ------------------- | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-controls       | `string`  |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| excludeFromTabOrder | `boolean` |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                  | `string`  |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-label          | `string`  |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby     | `string`  |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby    | `string`  |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details        | `string`  |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |
| aria-errormessage   | `string`  |         | Identifies the element that provides an error message for the object.                                                                                                                                                                                                                         |

#### CheckboxField

| Prop        | Type                                                                                                        | Default | Description                                                                                                                                                                        |
| ----------- | ----------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| description | `ReactNode`                                                                                                 |         | The description of the checkbox field.                                                                                                                                             |
| isDisabled  | `boolean`                                                                                                   |         | Whether the checkbox field is disabled.                                                                                                                                            |
| size        | `ResponsiveProp<FieldSize>`                                                                                 | "md"    | A checkbox field can vary in size.                                                                                                                                                 |
| children    | `ReactNode \| ((values: CheckboxFieldRenderProps & { defaultChildren: ReactNode; }) => ReactNode)`          |         | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className   | `string \| ((values: CheckboxFieldRenderProps & { defaultClassName: string; }) => string)`                  |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| style       | `CSSProperties \| ((values: CheckboxFieldRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties)` |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `onChange` signature has been changed (no event are passed).
* `onValueChange` has been deleted, use `onChange` instead.
* `checked` has been renamed to `isSelected`.
* `disabled` has been renamed to `isDisabled`.
* `required` has been renamed to `isRequired`.
* `indeterminate` has been renamed to `isIndeterminate`.
* `defaultIndeterminate` prop has been removed.
* The `Counter` component is no longer allowed as a specialized slot.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* `validationState` has been removed. Use `isInvalid` instead. There is no `isValid`.
* Values are not auto-generated when missed.

## CheckboxGroup

A checkbox group handles the spacing and orientation for a grouping of checkboxes, as well as providing a label.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/checkbox/src/CheckboxGroup.tsx>

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup label="Roles">
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

### Anatomy

#### Structure

```tsx
<CheckboxGroup>
    <Checkbox /> /* (Required) A checkbox within the group */
</CheckboxGroup>
```

#### Composed Components

A `CheckboxGroup` uses the following components:

| Component | Description                                                                                                                                                                                                                   |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Checkbox  | Checkboxes are used for multiple choices, not for mutually exclusive choices. Each checkbox works independently from other checkboxes in the list, therefore checking an additional box does not affect any other selections. |

### Usage

#### Read-only

A checkbox group can be read-only.

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup isReadOnly label="Roles">
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

#### Disabled

A checkbox group can be disabled.

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup isDisabled label="Roles">
            <Checkbox value="option1">Developer</Checkbox>
            <Checkbox value="option2">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

#### Invalid

A checkbox group can be invalid.

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup isInvalid label="Roles">
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

#### Sizes

A checkbox group can vary in size.

```tsx
import { Checkbox, CheckboxGroup, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline gap="inline-xl">
            <CheckboxGroup size="sm" label="Roles">
                <Checkbox value="developer">Developer</Checkbox>
                <Checkbox value="designer">Designer</Checkbox>
            </CheckboxGroup>
            <CheckboxGroup size="md" label="Roles">
                <Checkbox value="developer">Designer</Checkbox>
                <Checkbox value="designer">Developer</Checkbox>
            </CheckboxGroup>
        </Inline>
    );
}
```

#### No Label

A checkbox group can be rendered without a label.

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup aria-label="Roles">
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

#### Description

A checkbox group can have a description to provide more information to the user.

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup label="Roles" description="Select one to continue">
            <Checkbox value="option1">Developer</Checkbox>
            <Checkbox value="option2">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

#### Bordered

A checkbox group can be bordered.

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup variant="bordered" label="Roles">
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

#### Orientation

A checkbox group can have a different orientation.

```tsx
import { Checkbox, CheckboxGroup, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline gap="inline-xl">
            <CheckboxGroup orientation="horizontal" label="Roles">
                <Checkbox value="developer">Developer</Checkbox>
                <Checkbox value="designer">Designer</Checkbox>
            </CheckboxGroup>
            <CheckboxGroup orientation="vertical" label="Roles">
                <Checkbox value="developer">Developer</Checkbox>
                <Checkbox value="designer">Designer</Checkbox>
            </CheckboxGroup>
        </Inline>
    );
}
```

#### Fluid

A checkbox group can be expanded to full width to fill its parent container.

```tsx
import { Checkbox, CheckboxField, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup variant="bordered" isFluid label="Roles">
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
            <CheckboxField description="Team Manager">
                <Checkbox value="manager">Manager</Checkbox>
            </CheckboxField>
        </CheckboxGroup>
    );
}
```

#### Controlled

A checkbox group can handle value state in controlled mode.

```tsx
import { Checkbox, CheckboxGroup } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selected, setSelected] = useState<string[]>(["designer"]);

    return (
        <CheckboxGroup
            label="Roles"
            onChange={setSelected}
            value={selected}
        >
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
            <Checkbox value="manager">Manager</Checkbox>
        </CheckboxGroup>
    );
}
```

#### Description on Items

A checkbox can have a description to provide more information to the user.

```tsx
import { Checkbox, CheckboxField, CheckboxGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup label="Roles">
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
            <CheckboxField description="Team Manager">
                <Checkbox value="manager">Manager</Checkbox>
            </CheckboxField>
        </CheckboxGroup>
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a CheckboxGroup.

```tsx
import { Checkbox, CheckboxGroup, ContextualHelp } from "@hopper-ui/components";

export default function Example() {
    return (
        <CheckboxGroup label="Roles" contextualHelp={<ContextualHelp>This is a list of roles in the project</ContextualHelp>}>
            <Checkbox value="developer">Developer</Checkbox>
            <Checkbox value="designer">Designer</Checkbox>
        </CheckboxGroup>
    );
}
```

### Best Practices

Checkboxes should:

* Work independently from each other. Selecting one checkbox should not change the selection status of another checkbox in the list. The exception is when a checkbox is used to make a bulk selection of multiple items.
* Be framed positively.
* Always have a label when used to activate or deactivate a setting.
* Be listed according to a logical order, whether it's alphabetically, numerical, time-based, or some other clear system.
* Link to more information or include a helper text as required to provide more explanation. Don't rely on tooltips to explain a checkbox.

You can use checkboxes in many situations, such as:

* Forms: that can be in a full-page layout, in a modal or a panel.
* Filtering and batch action: to filter data either on a page, in a menu, or within a component. Checkboxes can be used in Tables for batch editing purposes.
* Tiles: to perform a selection over a collection of tiles that are related to one another.

#### Alignment

Checkbox labels are positioned to the right of their inputs. If there is a checkbox grouping, they can be laid out vertically. When possible, arrange the checkbox and radio button groups vertically for easier reading.

#### Placement

The checkbox component is often used in forms. Forms can be placed on a full page, in a modal or in a side panel. A checkbox can also be used for agreeing to terms and conditions or to filter information. Checkboxes in a form should be placed at least 24px below of before the next component. There's a space of 8px between each checkbox within a grouping.

#### Overflow content

We recommend checkbox labels being fewer than three words. If you are tight on space, consider rewording the label. Do not truncate checkbox label text with an ellipsis. Long labels may wrap to a second line, and this is preferable than truncation. The text should wrap beneath the checkbox so the control and label are top aligned.

#### Checkbox vs. Switch

Checkbox and Switch components are very similar in term of results when used in a form. However, a few details tell them apart.

* Checkbox component can offer multiple options to the user, while the Switch only offers one.
* Users can select none to any option with checkboxes, while the Switch always have one active selection at all time (either “on” or “off” position)
* Choices offered in checkbox grouping are independant from each other, while the Switch's mutually exclusive.
* The Switch's selection takes effect immediately, while the checkbox only happens once the user applied the change.

### Props

| Prop               | Type                                                     | Default      | Description                                                                                                                                                                                                                               |
| ------------------ | -------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| listProps          | `CheckboxListProps`                                      |              | The props of the list element that wraps the Checkbox components.                                                                                                                                                                         |
| orientation        | `ResponsiveProp<Orientation>`                            | "vertical"   | A CheckboxGroup can be displayed horizontally or vertically.                                                                                                                                                                              |
| variant            | `InputGroupVariant`                                      | "borderless" | A CheckboxGroup has two variants: borderless and bordered.                                                                                                                                                                                |
| isFluid            | `ResponsiveProp<boolean>`                                | false        | If `true`, the CheckboxGroup will take all available width.                                                                                                                                                                               |
| form               | `string`                                                 |              | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).              |
| style              | `StyleOrFunction<CheckboxGroupRenderProps>`              |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                         |
| children           | `ChildrenOrFunction<CheckboxGroupRenderProps>`           |              | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                 |
| validationBehavior | `"native" \| "aria"`                                     | 'native'     | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                            |
| name               | `string`                                                 |              | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                             |
| value              | `string[]`                                               |              | The current value (controlled).                                                                                                                                                                                                           |
| defaultValue       | `string[]`                                               |              | The default value (uncontrolled).                                                                                                                                                                                                         |
| isDisabled         | `boolean`                                                |              | Whether the input is disabled.                                                                                                                                                                                                            |
| isReadOnly         | `boolean`                                                |              | Whether the input can be selected but not changed by the user.                                                                                                                                                                            |
| isRequired         | `boolean`                                                |              | Whether user input is required on the input before form submission.                                                                                                                                                                       |
| isInvalid          | `boolean`                                                |              | Whether the input value is invalid.                                                                                                                                                                                                       |
| validate           | `((value: string[]) => true \| ValidationError \| null)` |              | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead. |
| className          | `ClassNameOrFunction<CheckboxGroupRenderProps>`          |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                        |
| dir                | `string`                                                 |              |                                                                                                                                                                                                                                           |
| lang               | `string`                                                 |              |                                                                                                                                                                                                                                           |
| inert              | `boolean`                                                |              |                                                                                                                                                                                                                                           |
| translate          | `"yes" \| "no"`                                          |              |                                                                                                                                                                                                                                           |
| description        | `ReactNode`                                              |              | The helper message of the field.                                                                                                                                                                                                          |
| errorMessage       | `ReactNode \| ((v: ValidationResult) => ReactNode)`      |              | The error message of the field.                                                                                                                                                                                                           |
| label              | `ReactNode`                                              |              | The label of the field.                                                                                                                                                                                                                   |
| necessityIndicator | `NecessityIndicator`                                     |              | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                    |
| size               | `ResponsiveProp<FieldSize>`                              | "md"         | A Field can vary in size.                                                                                                                                                                                                                 |
| contextualHelp     | `ReactNode`                                              |              | A ContextualHelp element to place next to the label.                                                                                                                                                                                      |

##### Events

| Prop                        | Type                                          | Default | Description                                                     |
| --------------------------- | --------------------------------------------- | ------- | --------------------------------------------------------------- |
| onChange                    | `((value: string[]) => void)`                 |         | Handler that is called when the value changes.                  |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element receives focus.         |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element loses focus.            |
| onFocusChange               | `((isFocused: boolean) => void)`              |         | Handler that is called when the element's focus status changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onScroll                    | `UIEventHandler<HTMLDivElement>`              |         |                                                                 |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`              |         |                                                                 |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`           |         |                                                                 |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop              | Type     | Default | Description                                                                                                         |
| ----------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id                | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label        | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby   | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby  | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details      | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| aria-errormessage | `string` |         | Identifies the element that provides an error message for the object.                                               |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `onChange` signature has been changed – no events are passed.
* `disabled` has been renamed to `isDisabled`.
* `required` has been renamed to `isRequired`.
* `fluid` has been renamed to `isFluid`.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* `autofocus` is not supported. You must put `autofocus` on the actual Checkbox.
* The default orientation is now vertical instead of horizontal.
* `validationState` is removed. use `isInvalid` instead. There is no `isValid`.
* `wrap` is removed. If horizontal, radios will wrap.
* There is no `align` prop. If needed, the styled system can be used.
* The `inline` prop is not available.

## ComboBox

A combo box allows the user to make a selection from a list of suggested, likely or desired values.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/combobox/src/ComboBox.tsx>

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

### Anatomy

#### Structure

```tsx
<ComboBox>
    <ComboBoxItem> /* (Required) The items of the combo box */
        <Avatar /> /* (Optional) An avatar for the item */
        <Text /> /* (Optional) The text content of the item, required if using another element */
        <Text slot="description" /> /* (Optional) A description for the item */
        <Badge /> /* (Optional) A badge for the item */
        <Icon /> /* (Optional) An icon for the item */
    </ComboBoxItem>
    <ComboBoxSection> /* (Optional) A section of combo box items */
        <Header /> /* (Optional) A header for the section */
        <ComboBoxItem /> /* (Required) An item in the ComboBoxSection */
    </ComboBoxSection>
</ComboBox>
```

#### Composed Components

A `ComboBox` uses the following components:

| Component | Description                                                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Avatar    | Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available. |
| Badge     | A badge is used to bring attention to an element.                                                                                                  |
| Header    | A placeholder for an header section.                                                                                                               |
| Icon      | An icon component is used to render a custom icon.                                                                                                 |
| Text      | A text component is a primitive component matching Hopper's typography type scale.                                                                 |

### Usage

#### Disabled

A combo box in a disabled state shows that it exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox isDisabled label="Roles">
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Disabled Item

A combo box with a disabled item.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem id="designer" isDisabled>Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Error

A combo box can be displayed in an error state to indicate that the selection is invalid.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox isInvalid label="Roles" errorMessage="This field is required">
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Sizes

A combo box has multiple sizes to choose from. The combo box option also changes size based on the size of the combo box.

```tsx
import { ComboBox, ComboBoxItem, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <ComboBox size="sm" label="Roles">
                <ComboBoxItem id="designer">Designer</ComboBoxItem>
                <ComboBoxItem id="developer">Developer</ComboBoxItem>
                <ComboBoxItem id="manager">Manager</ComboBoxItem>
            </ComboBox>
            <ComboBox size="md" label="Roles">
                <ComboBoxItem id="designer">Designer</ComboBoxItem>
                <ComboBoxItem id="developer">Developer</ComboBoxItem>
                <ComboBoxItem id="manager">Manager</ComboBoxItem>
            </ComboBox>
        </Stack>
    );
}
```

#### Labeling

If a visible label isn't specified, an `aria-label` must be provided to the combo box for accessibility. If the field is labeled by a separate element, an `aria-labelledby` prop must be provided using the ID of the labeling element instead.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Icon Prefix

An icon can be displayed at the start of the select trigger.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";
import { OrgChartIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ComboBox prefix={<OrgChartIcon />} label="Roles">
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Text Prefix

A short text can be displayed at the start of the select trigger.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox
            prefix="Operations"
            label="Roles"
        >
            <ComboBoxItem id="project-coordinator">Project Coordinator</ComboBoxItem>
            <ComboBoxItem id="qa-specialist">QA Specialist</ComboBoxItem>
            <ComboBoxItem id="system-administrator">System Administrator</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Fluid

A combo box can take the width of its container.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox isFluid label="Roles">
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Controlled

A combo box can have a controlled selected value. In this example, it shows how it is possible to deselect an option.

```tsx
import { ComboBox, ComboBoxItem, ComboBoxSection, Header, type Key } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selectedKey, setSelectedKey] = useState<Key | null>();

    const handleSelectionChange = (key: Key | null) => {
        if (selectedKey === key) {
            setSelectedKey(null);
        } else {
            setSelectedKey(key);
        }
    };

    return (
        <ComboBox selectedKey={selectedKey} onSelectionChange={handleSelectionChange} label="Roles">
            <ComboBoxSection>
                <Header>Operations</Header>
                <ComboBoxItem id="1">Project Coordinator</ComboBoxItem>
                <ComboBoxItem id="2">QA Specialist</ComboBoxItem>
            </ComboBoxSection>
            <ComboBoxItem id="3">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Custom Filtering

A combo box can overridde the default [useFilter](https://react-spectrum.adobe.com/react-aria/useFilter.html) function from RAC. This can be overridden using the `defaultFilter` prop, or by using the `items` prop to control the filtered list. When `items` is provided rather than `defaultItems`, combo box does no filtering of its own.

```tsx
import { ComboBox, ComboBoxItem, useFilter } from "@hopper-ui/components";
import { useMemo, useState } from "react";

const ROLE_OPTIONS = [
    { id: 1, name: "Designer" },
    { id: 2, name: "Developer" },
    { id: 3, name: "Manager" },
    { id: 4, name: "QA Engineer" },
    { id: 5, name: "Product Owner" },
    { id: 6, name: "Scrum Master" },
    { id: 7, name: "UX Researcher" },
    { id: 8, name: "Business Analyst" },
    { id: 9, name: "DevOps Engineer" },
    { id: 10, name: "Data Scientist" }
];

export default function Example() {
    const filter = useFilter({ sensitivity: "base" });
    const [filterValue, setFilterValue] = useState("");

    const filteredItems = useMemo(() => {
        return ROLE_OPTIONS.filter(item => filter.startsWith(item.name, filterValue));
    }, [filter, filterValue]);

    return (
        <ComboBox
            items={filteredItems}
            inputValue={filterValue}
            onInputChange={setFilterValue}
            label="Roles"
        >
            {item => <ComboBoxItem id={item.id}>{item.name}</ComboBoxItem>}
        </ComboBox>
    );
}
```

#### Allow Empty Collection

A combo box can be rendered with an empty collection. If you want the popover to open with a custom message, you can use the `renderEmptyState` prop within the `listBoxProps` prop.

```tsx
import { ComboBox } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox
            allowsEmptyCollection
            label="Roles"
            listBoxProps={{
                renderEmptyState: () => "No roles found"
            }}
        >
            {[]}
        </ComboBox>
    );
}
```

#### Allow Custom Value

A combo box can allow the user to enter a custom value that does not match the list.

```tsx
import { ComboBox, ComboBoxItem, ComboBoxSection, Header } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox allowsCustomValue label="Roles">
            <ComboBoxSection>
                <Header>Creative Department</Header>
                <ComboBoxItem id="1">Designer</ComboBoxItem>
                <ComboBoxItem id="2">Content creator</ComboBoxItem>
            </ComboBoxSection>
            <ComboBoxItem id="3">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Form

A combo box can be part of a form. To submit the value of a combo box, make sure you specify the `name` property.

```tsx
import { ComboBox, ComboBoxItem, Form } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form>
            <ComboBox name="Roles" label="Roles">
                <ComboBoxItem id="designer">Designer</ComboBoxItem>
                <ComboBoxItem id="developer">Developer</ComboBoxItem>
                <ComboBoxItem id="manager">Manager</ComboBoxItem>
            </ComboBox>
        </Form>
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a ComboBox.

```tsx
import { ComboBox, ComboBoxItem, ContextualHelp } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Roles" contextualHelp={<ContextualHelp>This is a list of roles in the project</ContextualHelp>}>
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Auto Menu Width

A combo box can have a menu that automatically adjusts its width based on the longest item.

```tsx
import { ComboBox, ComboBoxItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox
            aria-label="list of options with a description"
            isAutoMenuWidth
            label="Roles"
        >
            <ComboBoxItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Builds, tests, and maintains software.</Text>
            </ComboBoxItem>
            <ComboBoxItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Creates visually appealing, functional solutions.</Text>
            </ComboBoxItem>
            <ComboBoxItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Responsible for leading and overseeing a team or department to ensure organizational goals are met.</Text>
            </ComboBoxItem>
        </ComboBox>
    );
}
```

#### Menu placement

A combo box's menu can have a customized menu placement using the `direction` and `align` props.

```tsx
import { ComboBox, ComboBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox
            label="Roles"
            align="end"
            direction="top"
        >
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Section

A combo box can have sections and section headers.

```tsx
import { ComboBox, ComboBoxItem, ComboBoxSection, Header } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
            <ComboBoxSection>
                <Header>Operations</Header>
                <ComboBoxItem id="project-coordinator">Project Coordinator</ComboBoxItem>
                <ComboBoxItem id="qa-specialist">QA Specialist</ComboBoxItem>
            </ComboBoxSection>
            <ComboBoxSection>
                <Header>Creative Department</Header>
                <ComboBoxItem id="designer">Designer</ComboBoxItem>
                <ComboBoxItem id="copywriter">Copywriter</ComboBoxItem>
                <ComboBoxItem id="ux-researcher">UX Researcher</ComboBoxItem>
            </ComboBoxSection>
        </ComboBox>
    );
}
```

#### Footer

A combo box can have a footer.

```tsx
import { Button, ComboBox, ComboBoxItem, Text } from "@hopper-ui/components";
import { AddIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ComboBox
            label="Roles"
            footer={(
                <Button variant="ghost-secondary" isFluid>
                    <AddIcon />
                    <Text>Add</Text>
                </Button>
            )}
        >
            <ComboBoxItem id="developer">Developer</ComboBoxItem>
            <ComboBoxItem id="designer">Designer</ComboBoxItem>
            <ComboBoxItem id="manager">Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Avatar

A combo box item can contain an avatar.

```tsx
import { Avatar, ComboBox, ComboBoxItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Username">
            <ComboBoxItem id="fred-smith" textValue="Fred Smith" >
                <Avatar src="https://i.pravatar.cc/96?img=3" name="Fred Smith" />
                <Text>Fred Smith</Text>
            </ComboBoxItem>
            <ComboBoxItem id="karen-smith" textValue="Karen Smith" >
                <Avatar name="Karen Smith" />
                <Text>Karen Smith</Text>
            </ComboBoxItem>
            <ComboBoxItem id="john-doe" textValue="John Doe" >
                <Avatar name="John Doe" />
                <Text>John Doe</Text>
            </ComboBoxItem>
        </ComboBox>
    );
}
```

#### Count

A combo box item can contain a count using a badge.

```tsx
import { Badge, ComboBox, ComboBoxItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem textValue="Designer">
                <Text>Designer</Text>
                <Badge>50</Badge>
            </ComboBoxItem>
            <ComboBoxItem textValue="Developer">
                <Text>Developer</Text>
                <Badge variant="secondary">99+</Badge>
            </ComboBoxItem>
            <ComboBoxItem>Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Dynamic Lists

Options and sections can be populated from a hierarchial data structure. If a section has a header, the `Collection` component can be used to render the child items.

```tsx
import { Collection, ComboBox, ComboBoxItem, ComboBoxSection, Header } from "@hopper-ui/components";

const OPTIONS_WITH_SECTIONS = [
    {
        role: "Operations", children: [
            { id: 2, role: "Project Coordinator" },
            { id: 3, role: "QA Specialist" },
            { id: 4, role: "System Administrator" }
        ]
    },
    {
        role: "Creative Department", children: [
            { id: 6, role: "Designer" },
            { id: 7, role: "Designer" },
            { id: 8, role: "UX Researcher" }
        ]
    }
];

export default function Example() {
    return (
        <ComboBox
            items={OPTIONS_WITH_SECTIONS}
            label="Section"
        >
            {section => {
                const { role: sectionName, children } = section;

                return (
                    <ComboBoxSection id={sectionName}>
                        <Header>{sectionName}</Header>
                        <Collection items={children}>
                            {item => <ComboBoxItem id={item.id}>{item.role}</ComboBoxItem>}
                        </Collection>
                    </ComboBoxSection>
                );
            }}
        </ComboBox>
    );
}
```

#### Icons

A combo box item can contain icons.

```tsx
import { ComboBox, ComboBoxItem, IconList, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem textValue="Developer">
                <Text>Developer</Text>
                <IconList>
                    <SparklesIcon /><SparklesIcon /><SparklesIcon />
                </IconList>
            </ComboBoxItem>
            <ComboBoxItem textValue="Designer">
                <SparklesIcon /><Text>Designer</Text>
            </ComboBoxItem>
            <ComboBoxItem>Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### End Icons

A combo box can contain icons at the end of an option.

```tsx
import { ComboBox, ComboBoxItem, IconList, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem textValue="Designer">
                <Text>Designer</Text>
                <IconList slot="end-icon">
                    <SparklesIcon /><SparklesIcon /><SparklesIcon />
                </IconList>
            </ComboBoxItem>
            <ComboBoxItem textValue="Developer">
                <SparklesIcon slot="end-icon" /><Text>Developer</Text>
            </ComboBoxItem>
            <ComboBoxItem>Manager</ComboBoxItem>
        </ComboBox>
    );
}
```

#### Loading

A combo box can have a loading state.

```tsx
import { ComboBox } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox
            label="Roles"
            isLoading
        >
            {[]}
        </ComboBox>
    );
}
```

#### Load on scroll

A combo box can load more items when scrolling within.

```tsx
import { ComboBox, ComboBoxItem, useAsyncList } from "@hopper-ui/components";

interface Character {
    name: string;
}

export default function Example() {
    const list = useAsyncList<Character>({
        async load({ signal, cursor }) {
            const res = await fetch(cursor || "https://pokeapi.co/api/v2/pokemon", {
                signal
            });
            const json = await res.json();

            return {
                items: json.results,
                cursor: json.next
            };
        }
    });

    return (
        <ComboBox
            label="Roles"
            items={list.items}
            isLoading={list.isLoading}
            onLoadMore={() => list.loadMore()}
            listBoxProps={{
                maxHeight: "core_1280"
            }}
        >
            {item => {
                return <ComboBoxItem id={item.name}>{item.name}</ComboBoxItem>;
            }}
        </ComboBox>
    );
}
```

#### Selection indicator

A combo box can have a different selection indicator.

```tsx
import { ComboBox, ComboBoxItem, Text, type Key } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selectedKey, setSelectedKey] = useState<Key | null>("1");

    return (
        <ComboBox
            aria-label="list of options"
            selectedKey={selectedKey}
            onSelectionChange={setSelectedKey}
            label="Roles"
            selectionIndicator="input"
        >
            <ComboBoxItem textValue="Developer" id="1">
                <Text>Developer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </ComboBoxItem>
            <ComboBoxItem textValue="Designer" id="2">
                <Text>Designer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </ComboBoxItem>
            <ComboBoxItem textValue="Manager" id="3">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </ComboBoxItem>
        </ComboBox>
    );
}
```

#### Description

A combo box item can have a description.

```tsx
import { ComboBox, ComboBoxItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ComboBox label="Roles">
            <ComboBoxItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </ComboBoxItem>
            <ComboBoxItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </ComboBoxItem>
            <ComboBoxItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </ComboBoxItem>
        </ComboBox>
    );
}
```

### Props

#### ComboBox

| Prop               | Type                                          | Default | Description                                                                                                                                                                                         |
| ------------------ | --------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isLoading          | `boolean`                                     |         | Whether the item is loading.                                                                                                                                                                        |
| size               | `ResponsiveProp<ListBoxItemSize>`             | "sm"    | A ListBoxItem can vary in size.                                                                                                                                                                     |
| isInvalid          | `boolean`                                     |         | Whether or not the ListBoxItem is in an invalid state.                                                                                                                                              |
| selectionIndicator | `SelectionIndicator`                          | "check" | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be an either a radio or checkbox based on the selection mode. |
| radioProps         | `DecorativeRadioProps`                        |         | The props for the Radio.                                                                                                                                                                            |
| checkboxProps      | `DecorativeCheckboxProps`                     |         | The props for the Checkbox.                                                                                                                                                                         |
| style              | `StyleOrFunction<ListBoxItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                   |
| dir                | `string`                                      |         |                                                                                                                                                                                                     |
| lang               | `string`                                      |         |                                                                                                                                                                                                     |
| inert              | `boolean`                                     |         |                                                                                                                                                                                                     |
| translate          | `"yes" \| "no"`                               |         |                                                                                                                                                                                                     |
| id                 | `Key`                                         |         | The unique id of the item.                                                                                                                                                                          |
| value              | `object`                                      |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                                              |
| textValue          | `string`                                      |         | A string representation of the item's contents, used for features like typeahead.                                                                                                                   |
| isDisabled         | `boolean`                                     |         | Whether the item is disabled.                                                                                                                                                                       |
| children           | `ChildrenOrFunction<ListBoxItemRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                           |
| className          | `ClassNameOrFunction<ListBoxItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                  |
| href               | `string`                                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                      |
| hrefLang           | `string`                                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                      |
| target             | `HTMLAttributeAnchorTarget`                   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                      |
| rel                | `string`                                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                     |
| download           | `string \| boolean`                           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                    |
| ping               | `string`                                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                      |
| referrerPolicy     | `HTMLAttributeReferrerPolicy`                 |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                    |
| routerOptions      | `undefined`                                   |         | Options for the configured client side router.                                                                                                                                                      |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

#### ComboBoxSection

| Prop         | Type                                                                                  | Default | Description                                                                                               |
| ------------ | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| style        | `CSSProperties`                                                                       |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.   |
| children     | `ReactNode \| ((item: T) => ReactElement<any, string \| JSXElementConstructor<any>>)` |         | Static child items or a function to render children.                                                      |
| items        | `Iterable<T>`                                                                         |         | Item objects in the section.                                                                              |
| id           | `Key`                                                                                 |         | The unique id of the section.                                                                             |
| value        | `object`                                                                              |         | The object value that this section represents. When using dynamic collections, this is set automatically. |
| dependencies | `readonly any[]`                                                                      |         | Values that should invalidate the item cache when using dynamic collections.                              |
| className    | `string`                                                                              |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.  |
| dir          | `string`                                                                              |         |                                                                                                           |
| lang         | `string`                                                                              |         |                                                                                                           |
| inert        | `boolean`                                                                             |         |                                                                                                           |
| translate    | `"yes" \| "no"`                                                                       |         |                                                                                                           |

##### Events

| Prop                        | Type                                  | Default | Description |
| --------------------------- | ------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |             |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                             |
| ---------- | -------- | ------- | --------------------------------------- |
| aria-label | `string` |         | An accessibility label for the section. |

#### ComboBoxItem

| Prop               | Type                                          | Default | Description                                                                                                                                                                                         |
| ------------------ | --------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isLoading          | `boolean`                                     |         | Whether the item is loading.                                                                                                                                                                        |
| size               | `ResponsiveProp<ListBoxItemSize>`             | "sm"    | A ListBoxItem can vary in size.                                                                                                                                                                     |
| isInvalid          | `boolean`                                     |         | Whether or not the ListBoxItem is in an invalid state.                                                                                                                                              |
| selectionIndicator | `SelectionIndicator`                          | "check" | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be an either a radio or checkbox based on the selection mode. |
| radioProps         | `DecorativeRadioProps`                        |         | The props for the Radio.                                                                                                                                                                            |
| checkboxProps      | `DecorativeCheckboxProps`                     |         | The props for the Checkbox.                                                                                                                                                                         |
| style              | `StyleOrFunction<ListBoxItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                   |
| dir                | `string`                                      |         |                                                                                                                                                                                                     |
| lang               | `string`                                      |         |                                                                                                                                                                                                     |
| inert              | `boolean`                                     |         |                                                                                                                                                                                                     |
| translate          | `"yes" \| "no"`                               |         |                                                                                                                                                                                                     |
| id                 | `Key`                                         |         | The unique id of the item.                                                                                                                                                                          |
| value              | `object`                                      |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                                              |
| textValue          | `string`                                      |         | A string representation of the item's contents, used for features like typeahead.                                                                                                                   |
| isDisabled         | `boolean`                                     |         | Whether the item is disabled.                                                                                                                                                                       |
| children           | `ChildrenOrFunction<ListBoxItemRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                           |
| className          | `ClassNameOrFunction<ListBoxItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                  |
| href               | `string`                                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                      |
| hrefLang           | `string`                                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                      |
| target             | `HTMLAttributeAnchorTarget`                   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                      |
| rel                | `string`                                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                     |
| download           | `string \| boolean`                           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                    |
| ping               | `string`                                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                      |
| referrerPolicy     | `HTMLAttributeReferrerPolicy`                 |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                    |
| routerOptions      | `undefined`                                   |         | Options for the configured client side router.                                                                                                                                                      |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

Assuming you will use ComboBox for the `Autocomplete` of Orbiter.

* `allowFlip` has been renamed `shouldFlip`.
* `allowPreventOverflow` has been removed.
* `boundaryElement` has been removed.
* `clearOnSelect` has been removed.
* `defaultOpen` has been removed.
* `defaultValue` has been renamed `defaultInputValue`.
* `fluid` has been renamed `isFluid`.
* `icon` has been removed.
* `loading` has been renamed `isLoading`.
* `noResultsMessage` has been removed. [See new usage](/components/ComboBox.md#usage-allow-empty-collection).
* `onSearch` has been removed.
* `wrapperProps` has been removed. There is now `popoverProps` for the Popover and `listboxProps` for the Listbox.

## CompactCallout

A CompactCallout informs users about important changes or persistent conditions. Use this component to communicate to users in a prominent way. Callouts are placed at the top of the page or section they apply to, and below the page or section header.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/callout/src/Callout.tsx>

```tsx
import { Button, CompactCallout, Content } from "@hopper-ui/components";

export default function Example() {
    return (
        <CompactCallout>
            <Content>You have selected to automatically invite users when they are created.</Content>
            <Button size="sm">Undo</Button>
        </CompactCallout>
    );
}
```

### Anatomy

#### Structure

```tsx
<CompactCallout>
    <Content /> /* (Required) The main content of the compact callout */
    <Button /> /* (Optional) A button for the compact callout */
    <Link /> /* (Optional) A link for the compact callout */
</CompactCallout>
```

#### Composed Components

A `CompactCallout` uses the following components:

| Component | Description                                                |
| --------- | ---------------------------------------------------------- |
| Button    | A button allows a user to initiate an action.              |
| Content   | A placeholder for the main content section of a component. |
| Link      | A link allows a user to navigate to a different location.  |

### Usage

#### Variants

A compact callout can have the same variants.

```tsx
import { Button, CompactCallout, Content, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <CompactCallout>
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button size="sm">Undo</Button>
            </CompactCallout>
            <CompactCallout variant="success">
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button size="sm">Undo</Button>
            </CompactCallout>
            <CompactCallout variant="warning">
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button size="sm">Undo</Button>
            </CompactCallout>
            <CompactCallout>
                <Content>You have selected to automatically invite users when they are created.</Content>
                <Button size="sm">Undo</Button>
            </CompactCallout>
        </Stack>
    );
}
```

#### Link

A compact callout can have either a button or a link as CTA. Here's an example where it's a link.

```tsx
import { CompactCallout, Content, Link } from "@hopper-ui/components";

export default function Example() {
    return (
        <CompactCallout>
            <Content>You have selected to automatically invite users when they are created.</Content>
            <Link size="sm">Learn more</Link>
        </CompactCallout>
    );
}
```

#### Dismissable

Similar to the Callout, the dismiss icon appears only when `onClose` is set.

```tsx
import { Button, CompactCallout, Content } from "@hopper-ui/components";

export default function Example() {
    return (
        <CompactCallout onClose={() => alert("Closed")}>
            <Content>You have selected to automatically invite users when they are created.</Content>
            <Button size="sm">Undo</Button>
        </CompactCallout>
    );
}
```

### Best Practices

Callouts should:

* Be used thoughtfully and sparingly for only the most important information.
* Not be used to call attention to what a user needs to do in the interface instead of making the action clear in the UI itself.
* Not be the primary entry point to information or actions users need to take.
* Remove the icon only in scenarios where it takes up too much space, such as very small breakpoints.

#### Placement

Callouts should be place in the appropriate context:

* Callouts relevant to an entire page should be placed at the top of that page, below the page header. They should occupy the full width of the content area.
* Callouts related to a section of a page should be placed inside that section, below any section heading. These callouts have less spacing and a pared-back design to fit within a content context.
* Banner related to an element more specific than a section should be placed immediately above or below that element.

### Props

#### CompactCallout

| Prop      | Type                       | Default       | Description                                                                                              |
| --------- | -------------------------- | ------------- | -------------------------------------------------------------------------------------------------------- |
| style     | `CSSProperties`            |               | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children  | `ReactNode`                |               | The children of the component.                                                                           |
| className | `string`                   |               | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| variant   | `CalloutVariant`           | "information" | The overall hue of the callout.                                                                          |
| fillStyle | `"border" \| "subtleFill"` | "border"      | The appearance of the callout.                                                                           |

##### Events

| Prop    | Type           | Default | Description                                                   |
| ------- | -------------- | ------- | ------------------------------------------------------------- |
| onClose | `(() => void)` |         | Callback function that happens when the callout is dismissed. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## Content

A placeholder for the main content section of a component.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/layout/src/Content.tsx>

A content placeholder component provides no specific styling by itself, but receives styling from the parent container. In addition, a content placeholder will be automatically placed within the container's layout according to Hopper guidelines.

```tsx
import { Content } from "@hopper-ui/components";

export default function Example() {
    return (
        <Content>Software built for everyone to do their best work.</Content>
    );
}
```

### Props

| Prop      | Type            | Default | Description                                                                                              |
| --------- | --------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| style     | `CSSProperties` |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children  | `ReactNode`     |         | The children of the component.                                                                           |
| className | `string`        |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## ContextualHelp

Contextual help shows a user extra information about the state of an adjacent component. It explains a high-level topic about an experience and can point users to more information elsewhere.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/contextual-help/src/ContextualHelp.tsx>

```tsx
import { ContextualHelp } from "@hopper-ui/components";

export default function Example() {
    return (
        <ContextualHelp>
            Hop along, hero!
        </ContextualHelp>
    );
}
```

### Usage

#### Variants

A contextual help can use different variants.

```tsx
import { ContextualHelp, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <ContextualHelp>
                Hop along, hero!
            </ContextualHelp>
            <ContextualHelp variant="info">
                Hop along, hero!
            </ContextualHelp>
        </Stack>
    );
}
```

#### Sizes

A contextual help can have different sizes.

```tsx
import { ContextualHelp, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <ContextualHelp>
                Hop along, hero!
            </ContextualHelp>
            <ContextualHelp size="md">
                Hop along, hero!
            </ContextualHelp>
        </Stack>
    );
}
```

### Props

| Prop           | Type                                     | Default  | Description                                                                                                                                                                                                                    |
| -------------- | ---------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| children       | `ReactNode`                              |          | The contents of the ContextualHelp.                                                                                                                                                                                            |
| size           | `ResponsiveProp<IconSize>`               | "sm"     | The size of the ContextualHelp button.                                                                                                                                                                                         |
| popoverProps   | `PopoverBaseProps`                       |          | The props for the Popover                                                                                                                                                                                                      |
| variant        | `"help" \| "info"`                       | "help"   | The visual style of the ContextualHelp.                                                                                                                                                                                        |
| form           | `string`                                 |          | The `<form>` element to associate the button with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form). |
| style          | `StyleOrFunction<ButtonRenderProps>`     |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                              |
| isDisabled     | `boolean`                                |          | Whether the button is disabled.                                                                                                                                                                                                |
| autoFocus      | `boolean`                                |          | Whether the element should receive focus on render.                                                                                                                                                                            |
| type           | `"button" \| "submit" \| "reset"`        | 'button' | The behavior of the button when used in an HTML form.                                                                                                                                                                          |
| formAction     | `string`                                 |          | The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner.                                                                                                     |
| formEncType    | `string`                                 |          | Indicates how to encode the form data that is submitted.                                                                                                                                                                       |
| formMethod     | `string`                                 |          | Indicates the HTTP method used to submit the form.                                                                                                                                                                             |
| formNoValidate | `boolean`                                |          | Indicates that the form is not to be validated when it is submitted.                                                                                                                                                           |
| formTarget     | `string`                                 |          | Overrides the target attribute of the button's form owner.                                                                                                                                                                     |
| name           | `string`                                 |          | Submitted as a pair with the button's value as part of the form data.                                                                                                                                                          |
| value          | `string`                                 |          | The value associated with the button's name when it's submitted with the form data.                                                                                                                                            |
| dir            | `string`                                 |          |                                                                                                                                                                                                                                |
| lang           | `string`                                 |          |                                                                                                                                                                                                                                |
| inert          | `boolean`                                |          |                                                                                                                                                                                                                                |
| translate      | `"yes" \| "no"`                          |          |                                                                                                                                                                                                                                |
| isPending      | `boolean`                                |          | Whether the button is in a pending state. This disables press and hover events while retaining focusability, and announces the pending state to screen readers.                                                                |
| className      | `ClassNameOrFunction<ButtonRenderProps>` |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                             |
| isOpen         | `boolean`                                |          | Whether the overlay is open by default (controlled).                                                                                                                                                                           |
| defaultOpen    | `boolean`                                |          | Whether the overlay is open by default (uncontrolled).                                                                                                                                                                         |
| shouldFlip     | `boolean`                                | true     | Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.                                                                             |
| offset         | `number`                                 | 8        | The additional offset applied along the main axis between the element and its anchor element.                                                                                                                                  |
| crossOffset    | `number`                                 | 0        | The additional offset applied along the cross axis between the element and its anchor element.                                                                                                                                 |
| placement      | `ResponsiveProp<Placement>`              | "bottom" | The placement of the popover with respect to its anchor element.                                                                                                                                                               |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLButtonElement>`                  |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLButtonElement>`                       |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLButtonElement>`                       |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLButtonElement>`                    |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLButtonElement>`                |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLButtonElement>`               |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onOpenChange                | `((isOpen: boolean) => void)`                             |         | Handler that is called when the overlay's open state changes.                                                                                                                                             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-disabled       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element is disabled to users of assistive technology.                                                                                                                                                                                                                   |
| aria-expanded       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.                                                                                                                                                                                   |
| aria-haspopup       | `boolean \| "dialog" \| "menu" \| "grid" \| "true" \| "false" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls       | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-pressed        | `boolean \| "true" \| "false" \| "mixed"`                                             |         | Indicates the current "pressed" state of toggle buttons.                                                                                                                                                                                                                                      |
| aria-current        | `boolean \| "time" \| "true" \| "false" \| "page" \| "step" \| "location" \| "date"`  |         | Indicates whether this element represents the current item within a container or set of related elements.                                                                                                                                                                                     |
| preventFocusOnPress | `boolean`                                                                             |         | Whether to prevent focus from moving to the button when pressing it.Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.                  |
| excludeFromTabOrder | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                  | `string`                                                                              |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-label          | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby     | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby    | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details        | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |

## DatePicker

A date picker allows users to select a single date from a calendar.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/date-picker/src/DatePicker.tsx>

```tsx
import { DatePicker } from "@hopper-ui/components";

export default function Example() {
    return (
        <DatePicker label="Appointment date" />
    );
}
```

### Usage

#### Value

A DatePicker displays a placeholder by default. An initial, uncontrolled value can be provided to the DatePicker using the `defaultValue` prop. Alternatively, a controlled value can be provided using the `value` prop.

Date values are provided using objects in the [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/index.html) package. This library handles correct international date manipulation across calendars, time zones, and other localization concerns. DatePicker supports values of the following types:

* `CalendarDate` – a date without any time components. May be parsed from a string representation using the parseDate function. Use this type to represent dates where the time is not important, such as a birthday or an all day calendar event.
* `CalendarDateTime` – a date with a time, but not in any specific time zone. May be parsed from a string representation using the parseDateTime function. Use this type to represent times that occur at the same local time regardless of the time zone, such as the time of New Years Eve fireworks which always occur at midnight. Most times are better stored as a `ZonedDateTime`.
* `ZonedDateTime` – a date with a time in a specific time zone. May be parsed from a string representation using the parseZonedDateTime, parseAbsolute, or parseAbsoluteToLocal functions. Use this type to represent an exact moment in time at a particular location on Earth.

```tsx
import { Stack, type DateValue } from "@hopper-ui/components";
import { parseDate } from "@internationalized/date";
import { useState } from "react";

import { DatePicker } from "../src/index.ts";

export default function Example() {
    const [value, setValue] = useState<DateValue | null>(parseDate("2020-02-03"));

    return (
        <Stack>
            <DatePicker
                label="Date (uncontrolled)"
                defaultValue={parseDate("2020-02-03")}
            />
            <DatePicker
                label="Date (controlled)"
                value={value}
                onChange={setValue}
            />
        </Stack>
    );
}
```

#### Controlled

A DatePicker can handle value state in controlled mode.

```tsx
import { DatePicker, Paragraph, Stack, type DateValue } from "@hopper-ui/components";
import { getLocalTimeZone, parseDate } from "@internationalized/date";
import { useState } from "react";
import { useDateFormatter } from "react-aria";

export default function Example() {
    const [date, setDate] = useState<DateValue | null>(parseDate("1985-07-03"));
    const formatter = useDateFormatter({ dateStyle: "full" });

    return (
        <Stack>
            <DatePicker label="Birth date" value={date} onChange={setDate} />
            <Paragraph>
                Selected date:{" "}
                {date ? formatter.format(date.toDate(getLocalTimeZone())) : "--"}
            </Paragraph>
        </Stack>
    );
}
```

#### Validation

##### Invalid

A DatePicker can be marked as invalid.

```tsx
import { DatePicker } from "@hopper-ui/components";

export default function Example() {
    return (
        <DatePicker
            label="Appointment date"
            isInvalid
            errorMessage="Please select a valid date."
        />
    );
}
```

##### Min and Max

The `minValue` and `maxValue` props can be used to limit the range of dates that a user can select.

```tsx
import { DatePicker, type DateValue } from "@hopper-ui/components";
import { getLocalTimeZone, parseDate, today } from "@internationalized/date";
import { useState } from "react";

export default function Example() {
    const [value, setValue] = useState<DateValue | null>(parseDate("2022-02-03"));

    return (
        <DatePicker
            label="Appointment date"
            minValue={today(getLocalTimeZone())}
            value={value}
            onChange={setValue}
        />
    );
}
```

##### Unavailable Dates

DatePicker supports marking certain dates as unavailable. These dates remain focusable with the keyboard in the calendar so that navigation is consistent, but cannot be selected by the user. When an unavailable date is entered into the date field, it is marked as invalid. The `isDateUnavailable` prop accepts a callback that is called to evaluate whether each visible date is unavailable.

This example includes multiple unavailable date ranges, e.g. dates when no appointments are available. In addition, all weekends are unavailable. The `minValue` prop is also used to prevent selecting dates before today.

```tsx
import { DatePicker, useLocale, type DateValue } from "@hopper-ui/components";
import { getLocalTimeZone, isWeekend, today } from "@internationalized/date";

export default function Example() {
    const now = today(getLocalTimeZone());
    const disabledRanges = [
        [now, now.add({ days: 5 })],
        [now.add({ days: 14 }), now.add({ days: 16 })],
        [now.add({ days: 23 }), now.add({ days: 24 })]
    ];

    const { locale } = useLocale();
    const isDateUnavailable = (date: DateValue) =>
        isWeekend(date, locale) ||
        disabledRanges.some(interval => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0
        );

    return (
        <DatePicker
            label="Appointment date"
            minValue={today(getLocalTimeZone())}
            isDateUnavailable={isDateUnavailable}
        />
    );
}
```

##### Custom Validation

The `validate` function can be used to perform custom validation logic. It receives the current date value, and should return a string or array of strings representing one or more error messages if the value is invalid.

This example validates that the selected date is a weekday and not a weekend according to the current locale.

```tsx
import { DatePicker, useLocale } from "@hopper-ui/components";
import { isWeekend, parseDate } from "@internationalized/date";

export default function Example() {
    const { locale } = useLocale();

    return (
        <DatePicker
            label="Appointment date"
            validate={date => date && isWeekend(date, locale) ? "We are closed on weekends." : null}
            defaultValue={parseDate("2023-10-28")}
        />
    );
}
```

#### Description

The `description` prop can be used to provide additional context about the DatePicker.

```tsx
import { DatePicker } from "@hopper-ui/components";

export default function Example() {
    return (
        <DatePicker
            label="Appointment date"
            description="Please select a date for your appointment."
        />
    );
}
```

### Props

| Prop                    | Type                                                          | Default  | Description                                                                                                                                                                                                                                      |
| ----------------------- | ------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| isFluid                 | `ResponsiveProp<boolean>`                                     | false    | If `true`, the DatePicker will take all available width.                                                                                                                                                                                         |
| inputRef                | `MutableRefObject<HTMLInputElement \| null>`                  |          | A ref for the HTML input element.                                                                                                                                                                                                                |
| inputGroupProps         | `InputGroupProps`                                             |          | The props for the InputGroup.                                                                                                                                                                                                                    |
| maxVisibleMonths        | `number`                                                      | 1        | The maximum number of months to display at once in the calendar popover, if screen space permits.                                                                                                                                                |
| isFixedWeeks            | `boolean`                                                     | true     | Whether the calendar should always display 6 weeks. This ensures that the height of the popover does not change between months, causing layout shifts.                                                                                           |
| popoverProps            | `PopoverBaseProps`                                            |          | The props for the popover.                                                                                                                                                                                                                       |
| calendarProps           | `CalendarProps`                                               |          | The props for the calendar.                                                                                                                                                                                                                      |
| form                    | `string`                                                      |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).                     |
| style                   | `StyleOrFunction<DatePickerRenderProps>`                      |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                |
| validationBehavior      | `"native" \| "aria"`                                          | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                                   |
| autoComplete            | `string`                                                      |          | Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).                                                            |
| pageBehavior            | `PageBehavior`                                                | visible  | Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.                                                                                              |
| firstDayOfWeek          | `"sun" \| "mon" \| "tue" \| "wed" \| "thu" \| "fri" \| "sat"` |          | The day that starts the week.                                                                                                                                                                                                                    |
| minValue                | `DateValue \| null`                                           |          | The minimum allowed date that a user may select.                                                                                                                                                                                                 |
| maxValue                | `DateValue \| null`                                           |          | The maximum allowed date that a user may select.                                                                                                                                                                                                 |
| isDateUnavailable       | `((date: DateValue) => boolean)`                              |          | Callback that is called for each date of the calendar. If it returns true, then the date is unavailable.                                                                                                                                         |
| placeholderValue        | `DateValue \| null`                                           |          | A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today's date at midnight.                                                                                                          |
| hideTimeZone            | `boolean`                                                     | false    | Whether to hide the time zone abbreviation.                                                                                                                                                                                                      |
| shouldForceLeadingZeros | `boolean`                                                     |          | Whether to always show leading zeros in the month, day, and hour fields. By default, this is determined by the user's locale.                                                                                                                    |
| isDisabled              | `boolean`                                                     |          | Whether the input is disabled.                                                                                                                                                                                                                   |
| isReadOnly              | `boolean`                                                     |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                                   |
| isRequired              | `boolean`                                                     |          | Whether user input is required on the input before form submission.                                                                                                                                                                              |
| isInvalid               | `boolean`                                                     |          | Whether the input value is invalid.                                                                                                                                                                                                              |
| validate                | `((value: DateValue) => true \| ValidationError \| null)`     |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead.        |
| autoFocus               | `boolean`                                                     |          | Whether the element should receive focus on render.                                                                                                                                                                                              |
| isOpen                  | `boolean`                                                     |          | Whether the overlay is open by default (controlled).                                                                                                                                                                                             |
| defaultOpen             | `boolean`                                                     |          | Whether the overlay is open by default (uncontrolled).                                                                                                                                                                                           |
| value                   | `DateValue \| null`                                           |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue            | `DateValue \| null`                                           |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| name                    | `string`                                                      |          | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                                    |
| shouldCloseOnSelect     | `boolean \| (() => boolean)`                                  | true     | Determines whether the date picker popover should close automatically when a date is selected.                                                                                                                                                   |
| className               | `ClassNameOrFunction<DatePickerRenderProps>`                  |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                               |
| dir                     | `string`                                                      |          |                                                                                                                                                                                                                                                  |
| lang                    | `string`                                                      |          |                                                                                                                                                                                                                                                  |
| inert                   | `boolean`                                                     |          |                                                                                                                                                                                                                                                  |
| translate               | `"yes" \| "no"`                                               |          |                                                                                                                                                                                                                                                  |
| createCalendar          | `((identifier: CalendarIdentifier) => Calendar)`              |          | A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a given calendar identifier. If not provided, the `createCalendar` function from `@internationalized/date` will be used. |
| description             | `ReactNode`                                                   |          | The helper message of the field.                                                                                                                                                                                                                 |
| errorMessage            | `ReactNode \| ((v: ValidationResult) => ReactNode)`           |          | The error message of the field.                                                                                                                                                                                                                  |
| label                   | `ReactNode`                                                   |          | The label of the field.                                                                                                                                                                                                                          |
| necessityIndicator      | `NecessityIndicator`                                          |          | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                           |
| size                    | `ResponsiveProp<FieldSize>`                                   | "md"     | A Field can vary in size.                                                                                                                                                                                                                        |
| contextualHelp          | `ReactNode`                                                   |          | A ContextualHelp element to place next to the label.                                                                                                                                                                                             |

##### Events

| Prop                        | Type                                          | Default | Description                                                     |
| --------------------------- | --------------------------------------------- | ------- | --------------------------------------------------------------- |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element receives focus.         |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element loses focus.            |
| onFocusChange               | `((isFocused: boolean) => void)`              |         | Handler that is called when the element's focus status changes. |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                |         | Handler that is called when a key is pressed.                   |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                |         | Handler that is called when a key is released.                  |
| onOpenChange                | `((isOpen: boolean) => void)`                 |         | Handler that is called when the overlay's open state changes.   |
| onChange                    | `((value: DateValue \| null) => void)`        |         | Handler that is called when the value changes.                  |
| onClick                     | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onScroll                    | `UIEventHandler<HTMLDivElement>`              |         |                                                                 |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`              |         |                                                                 |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`           |         |                                                                 |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

## DateRangePicker

A date range picker allows users to select a range of dates from a calendar.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/date-picker/src/DateRangePicker.tsx>

```tsx
import { DateRangePicker } from "@hopper-ui/components";

export default function Example() {
    return (
        <DateRangePicker label="Trip dates" />
    );
}
```

### Usage

#### Value

A DateRangePicker displays a placeholder by default. An initial, uncontrolled value can be provided to the DateRangePicker using the `defaultValue` prop. Alternatively, a controlled value can be provided using the `value` prop.

Date ranges are objects with start and end properties containing date values, which are provided using objects in the [@internationalized/date](https://github.com/adobe/react-spectrum/tree/main/packages/@internationalized/date) package. This library handles correct international date manipulation across calendars, time zones, and other localization concerns. DateRangePicker supports values of the following types:

* `CalendarDate` – a date without any time components. May be parsed from a string representation using the parseDate function. Use this type to represent dates where the time is not important, such as a birthday or an all day calendar event.
* `CalendarDateTime` – a date with a time, but not in any specific time zone. May be parsed from a string representation using the parseDateTime function. Use this type to represent times that occur at the same local time regardless of the time zone, such as the time of New Years Eve fireworks which always occur at midnight. Most times are better stored as a ZonedDateTime.
* `ZonedDateTime` – a date with a time in a specific time zone. May be parsed from a string representation using the `parseZonedDateTime`, `parseAbsolute`, or `parseAbsoluteToLocal` functions. Use this type to represent an exact moment in time at a particular location on Earth.

```tsx
import { DateRangePicker, Stack, type DateValue, type RangeValue } from "@hopper-ui/components";
import { parseDate } from "@internationalized/date";
import { useState } from "react";

export default function Example() {
    const [value, setValue] = useState<RangeValue<DateValue> | null>({
        start: parseDate("2020-02-03"),
        end: parseDate("2020-02-08")
    });

    return (
        <Stack>
            <DateRangePicker
                label="Dates (uncontrolled)"
                defaultValue={{
                    start: parseDate("2020-02-03"),
                    end: parseDate("2020-02-08")
                }}
            />
            <DateRangePicker
                label="Dates (controlled)"
                value={value}
                onChange={setValue}
            />
        </Stack>
    );
}
```

#### Controlled

A DateRangePicker can handle value state in controlled mode.

```tsx
import { DateRangePicker, Paragraph, Stack, type DateValue, type RangeValue } from "@hopper-ui/components";
import { getLocalTimeZone, parseDate } from "@internationalized/date";
import { useState } from "react";
import { useDateFormatter } from "react-aria";

export default function Example() {
    const [range, setRange] = useState<RangeValue<DateValue> | null>({
        start: parseDate("2020-07-03"),
        end: parseDate("2020-07-10")
    });
    const formatter = useDateFormatter({ dateStyle: "long" });

    return (
        <Stack>
            <DateRangePicker label="Trip dates" value={range} onChange={setRange} />
            <Paragraph>
                Selected date: {range
                    ? formatter.formatRange(
                        range.start.toDate(getLocalTimeZone()),
                        range.end.toDate(getLocalTimeZone())
                    )
                    : "--"}
            </Paragraph>
        </Stack>
    );
}
```

#### Validation

##### Invalid

A DateRangePicker can be marked as invalid.

```tsx
import { DateRangePicker } from "@hopper-ui/components";

export default function Example() {
    return (
        <DateRangePicker
            label="Trip dates"
            isInvalid
            errorMessage="Please select a valid date."
        />
    );
}
```

##### Min and Max

The `minValue` and `maxValue` props can be used to limit the range of dates that a user can select.

```tsx
import { Button, DateRangePicker, Form } from "@hopper-ui/components";
import { getLocalTimeZone, parseDate, today } from "@internationalized/date";

export default function Example() {
    return (
        <Form>
            <DateRangePicker
                label="Trip dates"
                minValue={today(getLocalTimeZone())}
                defaultValue={{
                    start: parseDate("2022-02-03"),
                    end: parseDate("2022-05-03")
                }}
            />
            <Button type="submit" variant="secondary">
                Submit
            </Button>
        </Form>
    );
}
```

##### Unavailable Dates

DateRangePicker supports marking certain dates as unavailable. These dates remain focusable with the keyboard in the calendar so that navigation is consistent, but cannot be selected by the user. The `isDateUnavailable` prop accepts a callback that is called to evaluate whether each visible date is unavailable.

Note that by default, users may not select non-contiguous ranges, i.e. ranges that contain unavailable dates within them. Once a start date is selected in the calendar, enabled dates will be restricted to subsequent dates until an unavailable date is hit. While this is handled automatically in the calendar, additional validation logic must be provided to ensure an invalid state is displayed in the date field. This can be achieved using the `validate` prop. See below for an example of how to allow non-contiguous ranges.

This example includes multiple unavailable date ranges, e.g. dates when a rental house is not available. The `minValue` prop is also used to prevent selecting dates before today. The `validate` prop is used to mark selected date ranges with unavailable dates in the middle as invalid.

```tsx
import { DateRangePicker } from "@hopper-ui/components";
import { getLocalTimeZone, today } from "@internationalized/date";

export default function Example() {
    const now = today(getLocalTimeZone());
    const disabledRanges = [
        [now, now.add({ days: 5 })],
        [now.add({ days: 14 }), now.add({ days: 16 })],
        [now.add({ days: 23 }), now.add({ days: 24 })]
    ];

    return (
        <DateRangePicker
            label="Trip dates"
            minValue={today(getLocalTimeZone())}
            isDateUnavailable={date =>
                disabledRanges.some(interval =>
                    date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0
                )}
            validate={value =>
                disabledRanges.some(interval => value && value.end.compare(interval[0]) >= 0 && value.start.compare(interval[1]) <= 0)
                    ? "Selected date range may not include unavailable dates."
                    : null}
        />
    );
}
```

##### Non-Contiguous Ranges

The `allowsNonContiguousRanges` prop enables a range to be selected even if there are unavailable dates in the middle. The value emitted in the onChange event will still be a single range with a start and end property, but unavailable dates will not be displayed as selected. It is up to applications to split the full selected range into multiple as needed for business logic.

This example prevents selecting weekends, but allows selecting ranges that span multiple weeks.

```tsx
import { DateRangePicker, useLocale } from "@hopper-ui/components";
import { isWeekend } from "@internationalized/date";

export default function Example() {
    const { locale } = useLocale();

    return (
        <DateRangePicker
            label="Trip dates"
            isDateUnavailable={date => isWeekend(date, locale)}
            allowsNonContiguousRanges
        />
    );
}
```

##### Custom Validation

The `validate` function can be used to perform custom validation logic. It receives the current date range, and should return a string or array of strings representing one or more error messages if the value is invalid.

This example validates that the selected date range is a maximum of 1 week in duration.

```tsx
import { Button, DateRangePicker, Form } from "@hopper-ui/components";
import { getLocalTimeZone, today } from "@internationalized/date";

export default function Example() {
    return (
        <Form>
            <DateRangePicker
                label="Trip dates"
                validate={range =>
                    range?.end.compare(range.start) > 7
                        ? "Maximum stay duration is 1 week."
                        : null}
                defaultValue={{
                    start: today(getLocalTimeZone()),
                    end: today(getLocalTimeZone()).add({ weeks: 1, days: 3 })
                }}
            />
            <Button type="submit" variant="secondary">
                Submit
            </Button>
        </Form>
    );
}
```

#### Description

The `description` prop can be used to provide additional context about the DateRangePicker.

```tsx
import { DateRangePicker } from "@hopper-ui/components";

export default function Example() {
    return (
        <DateRangePicker
            label="Trip dates"
            description="Please select dates for your trip."
        />
    );
}
```

### Props

| Prop                      | Type                                                                  | Default  | Description                                                                                                                                                                                                                                      |
| ------------------------- | --------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| isFluid                   | `ResponsiveProp<boolean>`                                             | false    | If `true`, the DateRangePicker will take all available width.                                                                                                                                                                                    |
| inputStartRef             | `MutableRefObject<HTMLInputElement \| null>`                          |          | A ref for the HTML input element.                                                                                                                                                                                                                |
| inputEndRef               | `MutableRefObject<HTMLInputElement \| null>`                          |          | A ref for the HTML input element.                                                                                                                                                                                                                |
| inputGroupProps           | `InputGroupProps`                                                     |          | The props for the InputGroup.                                                                                                                                                                                                                    |
| maxVisibleMonths          | `number`                                                              | 1        | The maximum number of months to display at once in the calendar popover, if screen space permits.                                                                                                                                                |
| isFixedWeeks              | `boolean`                                                             | true     | Whether the calendar should always display 6 weeks. This ensures that the height of the popover does not change between months, causing layout shifts.                                                                                           |
| popoverProps              | `PopoverBaseProps`                                                    |          | The props for the popover.                                                                                                                                                                                                                       |
| calendarProps             | `RangeCalendarProps`                                                  |          | The props for the calendar.                                                                                                                                                                                                                      |
| form                      | `string`                                                              |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).                     |
| style                     | `StyleOrFunction<DateRangePickerRenderProps>`                         |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                |
| validationBehavior        | `"native" \| "aria"`                                                  | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                                   |
| validate                  | `((value: RangeValue<DateValue>) => true \| ValidationError \| null)` |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead.        |
| pageBehavior              | `PageBehavior`                                                        | visible  | Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.                                                                                              |
| firstDayOfWeek            | `"sun" \| "mon" \| "tue" \| "wed" \| "thu" \| "fri" \| "sat"`         |          | The day that starts the week.                                                                                                                                                                                                                    |
| minValue                  | `DateValue \| null`                                                   |          | The minimum allowed date that a user may select.                                                                                                                                                                                                 |
| maxValue                  | `DateValue \| null`                                                   |          | The maximum allowed date that a user may select.                                                                                                                                                                                                 |
| isDateUnavailable         | `((date: DateValue) => boolean)`                                      |          | Callback that is called for each date of the calendar. If it returns true, then the date is unavailable.                                                                                                                                         |
| placeholderValue          | `DateValue \| null`                                                   |          | A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today's date at midnight.                                                                                                          |
| hideTimeZone              | `boolean`                                                             | false    | Whether to hide the time zone abbreviation.                                                                                                                                                                                                      |
| shouldForceLeadingZeros   | `boolean`                                                             |          | Whether to always show leading zeros in the month, day, and hour fields. By default, this is determined by the user's locale.                                                                                                                    |
| isDisabled                | `boolean`                                                             |          | Whether the input is disabled.                                                                                                                                                                                                                   |
| isReadOnly                | `boolean`                                                             |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                                   |
| isRequired                | `boolean`                                                             |          | Whether user input is required on the input before form submission.                                                                                                                                                                              |
| isInvalid                 | `boolean`                                                             |          | Whether the input value is invalid.                                                                                                                                                                                                              |
| autoFocus                 | `boolean`                                                             |          | Whether the element should receive focus on render.                                                                                                                                                                                              |
| isOpen                    | `boolean`                                                             |          | Whether the overlay is open by default (controlled).                                                                                                                                                                                             |
| defaultOpen               | `boolean`                                                             |          | Whether the overlay is open by default (uncontrolled).                                                                                                                                                                                           |
| allowsNonContiguousRanges | `boolean`                                                             |          | When combined with `isDateUnavailable`, determines whether non-contiguous ranges, i.e. ranges containing unavailable dates, may be selected.                                                                                                     |
| startName                 | `string`                                                              |          | The name of the start date input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                         |
| endName                   | `string`                                                              |          | The name of the end date input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                           |
| value                     | `RangeValue<DateValue> \| null`                                       |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue              | `RangeValue<DateValue> \| null`                                       |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| shouldCloseOnSelect       | `boolean \| (() => boolean)`                                          | true     | Determines whether the date picker popover should close automatically when a date is selected.                                                                                                                                                   |
| className                 | `ClassNameOrFunction<DateRangePickerRenderProps>`                     |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                               |
| dir                       | `string`                                                              |          |                                                                                                                                                                                                                                                  |
| lang                      | `string`                                                              |          |                                                                                                                                                                                                                                                  |
| inert                     | `boolean`                                                             |          |                                                                                                                                                                                                                                                  |
| translate                 | `"yes" \| "no"`                                                       |          |                                                                                                                                                                                                                                                  |
| createCalendar            | `((identifier: CalendarIdentifier) => Calendar)`                      |          | A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a given calendar identifier. If not provided, the `createCalendar` function from `@internationalized/date` will be used. |
| description               | `ReactNode`                                                           |          | The helper message of the field.                                                                                                                                                                                                                 |
| errorMessage              | `ReactNode \| ((v: ValidationResult) => ReactNode)`                   |          | The error message of the field.                                                                                                                                                                                                                  |
| label                     | `ReactNode`                                                           |          | The label of the field.                                                                                                                                                                                                                          |
| necessityIndicator        | `NecessityIndicator`                                                  |          | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                           |
| size                      | `ResponsiveProp<FieldSize>`                                           | "md"     | A Field can vary in size.                                                                                                                                                                                                                        |
| contextualHelp            | `ReactNode`                                                           |          | A ContextualHelp element to place next to the label.                                                                                                                                                                                             |

##### Events

| Prop                        | Type                                               | Default | Description                                                     |
| --------------------------- | -------------------------------------------------- | ------- | --------------------------------------------------------------- |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`      |         | Handler that is called when the element receives focus.         |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`      |         | Handler that is called when the element loses focus.            |
| onFocusChange               | `((isFocused: boolean) => void)`                   |         | Handler that is called when the element's focus status changes. |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                     |         | Handler that is called when a key is pressed.                   |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                     |         | Handler that is called when a key is released.                  |
| onOpenChange                | `((isOpen: boolean) => void)`                      |         | Handler that is called when the overlay's open state changes.   |
| onChange                    | `((value: RangeValue<DateValue> \| null) => void)` |         | Handler that is called when the value changes.                  |
| onClick                     | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                |         |                                                                 |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`              |         |                                                                 |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                   |         |                                                                 |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                   |         |                                                                 |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                |         |                                                                 |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                |         |                                                                 |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`            |         |                                                                 |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`            |         |                                                                 |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`            |         |                                                                 |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`            |         |                                                                 |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`            |         |                                                                 |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`            |         |                                                                 |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`           |         |                                                                 |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

## Disclosure

The disclosure component is used to put long sections of information under a block that users can expand or collapse.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/disclosure/src/Disclosure.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/>

The disclosure component delivers large amounts of content in a small space through progressive disclosure. The header section give the user a high level overview of the content allowing the user to decide which sections to read. Disclosures can make information processing and discovering more effective. However, it does hide content from users and it's important to account for a user not noticing or reading all of the included content. If a user is likely to read all of the content then don't use a disclosure as it adds the burden of an extra click; use instead a full scrolling page with normal headers. Users can open or close a with different interactive element such as a button or the AngleUp and AngleDown icons.

```tsx
import { Disclosure, DisclosureHeader, DisclosurePanel } from "@hopper-ui/components";

export default function Example() {
    return (
        <Disclosure width="100%">
            <DisclosureHeader>
                Help your people work better
            </DisclosureHeader>
            <DisclosurePanel>
                Tackle the challenges of hybrid, remote and distributed work, no matter what.
                The Workleap platform builds solutions tailored to your existing HR and productivity tools to answer these challenges.
            </DisclosurePanel>
        </Disclosure>
    );
}
```

### Anatomy

#### Structure

```tsx
<Disclosure>
    <DisclosureHeader> /* (Required) A header for the Disclosure */
        <Text /> /* (Optional) A text description for the DisclosureHeader */
        <Icon /> /* (Optional) An icon for the DisclosureHeader */
    </DisclosureHeader>
    <DisclosurePanel /> /* (Required) A panel for the Disclosure */
</Disclosure>
```

#### Composed Components

A `Disclosure` uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### Disabled

A disclosure can be disabled.

```tsx
import { Disclosure, DisclosureHeader, DisclosurePanel, Inline, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Disclosure width="100%" isDisabled>
            <DisclosureHeader>
                <SparklesIcon />
                <Inline columnGap="inline-sm" rowGap="core_0" alignY="baseline">
                    <Text>Workleap Officevibe</Text>
                    <Text color="neutral-disabled" size="sm">Engagement and Feedback</Text>
                </Inline>
            </DisclosureHeader>
            <DisclosurePanel>
                Help employees speak up and make sure they feel heard.
                Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.
            </DisclosurePanel>
        </Disclosure>
    );
}
```

#### Variants

A disclosure has multiple variants.

```tsx
import { Disclosure, DisclosureHeader, DisclosurePanel, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack width="100%">
            <Disclosure variant="standalone">
                <DisclosureHeader>
                    Help your people work better
                </DisclosureHeader>
                <DisclosurePanel>
                    Tackle the challenges of hybrid, remote and distributed work, no matter what.
                    The Workleap platform builds solutions tailored to your existing HR and productivity tools to answer these challenges.
                </DisclosurePanel>
            </Disclosure>
            <Disclosure variant="inline">
                <DisclosureHeader>
                    Help your people work better
                </DisclosureHeader>
                <DisclosurePanel>
                    Tackle the challenges of hybrid, remote and distributed work, no matter what.
                    The Workleap platform builds solutions tailored to your existing HR and productivity tools to answer these challenges.
                </DisclosurePanel>
            </Disclosure>
        </Stack>
    );
}
```

**Standalone** - Used when the disclosure is not inside a container.

**Inline** - Used when placing a disclosure inside a container.

#### Icon

A disclosure can contain an icon.

```tsx
import { Disclosure, DisclosureHeader, DisclosurePanel, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Disclosure width="100%">
            <DisclosureHeader>
                <SparklesIcon />
                <Text>Help your people work better</Text>
            </DisclosureHeader>
            <DisclosurePanel>
                Tackle the challenges of hybrid, remote and distributed work, no matter what.
                The Workleap platform builds solutions tailored to your existing HR and productivity tools to answer these challenges.
            </DisclosurePanel>
        </Disclosure>
    );
}
```

#### Description

A disclosure can contain a description.

```tsx
import { Disclosure, DisclosureHeader, DisclosurePanel, Inline, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Disclosure width="100%">
            <DisclosureHeader>
                <Inline columnGap="inline-sm" rowGap="core_0" alignY="baseline">
                    <Text>Workleap Officevibe</Text>
                    <Text color="neutral-weak" size="sm">Engagement and Feedback</Text>
                </Inline>
            </DisclosureHeader>
            <DisclosurePanel>
                Help employees speak up and make sure they feel heard.
                Continuous and real-time surveys offer feedback to celebrate every win, recognize commitment, and uncover challenges.
            </DisclosurePanel>
        </Disclosure>
    );
}
```

#### Controlled

A disclosure can handle its expanded state in controlled mode.

```tsx
import { Disclosure, DisclosureHeader, DisclosurePanel } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [isExpanded, setIsExpanded] = useState(true);

    return (
        <Disclosure
            width="100%"
            isExpanded={isExpanded}
            onExpandedChange={setIsExpanded}
        >
            <DisclosureHeader>
                This disclosure is {isExpanded ? "expanded" : "collapsed"}
            </DisclosureHeader>
            <DisclosurePanel>
                Tackle the challenges of hybrid, remote and distributed work, no matter what.
                The Workleap platform builds solutions tailored to your existing HR and productivity tools to answer these challenges.
            </DisclosurePanel>
        </Disclosure>
    );
}
```

#### Custom Header

A disclosure can have a custom header. To accomplish this, do not use `DisclosureHeader` and use the [Button](./Button.md) component with `slot="trigger"` instead. Using React Aria's [Button](https://react-spectrum.adobe.com/react-aria/Button.html) component will also work.

```tsx
import { Button, Disclosure, DisclosurePanel, Text } from "@hopper-ui/components";

import { ToggleArrow } from "../../toggle-arrow/index.ts";

export default function Example() {
    return (
        <Disclosure width="100%">
            <Button slot="trigger" variant="secondary">
                <Text>Help your people work better</Text>
                <ToggleArrow slot="end-icon" />
            </Button>
            <DisclosurePanel>
                Tackle the challenges of hybrid, remote and distributed work, no matter what.
                The Workleap platform builds solutions tailored to your existing HR and productivity tools to answer these challenges.
            </DisclosurePanel>
        </Disclosure>
    );
}
```

### Progressive Enhancement

Our Disclosure component uses experimental CSS features like:

* **interpolate-size: allow-keywords**: Enables fluid transitions between dynamic sizes.

* **transition-behavior: allow-discrete**: Allows transitions for properties like content-visibility.

These features enhance animations where supported. In browsers without support, the component remains fully usable without animations, maintaining progressive enhancement.

### Best Practices

The disclosure component should:

* Be used for information that is lower priority or that users don't need to see all the time.
* Not be used to hide error messages or other critical information that requires an immediate action.

### Props

#### Disclosure

| Prop            | Type                                         | Default | Description                                                                                                                                                                        |
| --------------- | -------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| variant         | `"standalone" \| "inline"`                   |         |                                                                                                                                                                                    |
| style           | `StyleOrFunction<DisclosureRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| children        | `ChildrenOrFunction<DisclosureRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| isDisabled      | `boolean`                                    |         | Whether the disclosure is disabled.                                                                                                                                                |
| isExpanded      | `boolean`                                    |         | Whether the disclosure is expanded (controlled).                                                                                                                                   |
| defaultExpanded | `boolean`                                    |         | Whether the disclosure is expanded by default (uncontrolled).                                                                                                                      |
| id              | `Key`                                        |         | An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`.                                                                               |
| className       | `ClassNameOrFunction<DisclosureRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| dir             | `string`                                     |         |                                                                                                                                                                                    |
| lang            | `string`                                     |         |                                                                                                                                                                                    |
| inert           | `boolean`                                    |         |                                                                                                                                                                                    |
| translate       | `"yes" \| "no"`                              |         |                                                                                                                                                                                    |

##### Events

| Prop                        | Type                                     | Default | Description                                                          |
| --------------------------- | ---------------------------------------- | ------- | -------------------------------------------------------------------- |
| onExpandedChange            | `((isExpanded: boolean) => void)`        |         | Handler that is called when the disclosure's expanded state changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                                      |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                                      |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                                      |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                                      |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                                      |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                                      |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                      |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                      |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                      |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                      |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                      |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                      |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

#### Disclosure Header

| Prop        | Type                          | Default | Description                                            |
| ----------- | ----------------------------- | ------- | ------------------------------------------------------ |
| buttonProps | `DisclosureHeaderButtonProps` |         | The props for the button that triggers the disclosure. |
| size        | `ResponsiveProp<HeadingSize>` | "md"    | The Typography Type Scale to use.                      |
| style       | `CSSProperties`               |         |                                                        |
| level       | `number`                      |         |                                                        |
| className   | `string`                      |         |                                                        |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

#### Disclosure Panel

| Prop      | Type                                              | Default | Description                                                                                                                                                                        |
| --------- | ------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| style     | `StyleOrFunction<DisclosurePanelRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| children  | `ReactNode`                                       |         | The children of the component.                                                                                                                                                     |
| className | `ClassNameOrFunction<DisclosurePanelRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| dir       | `string`                                          |         |                                                                                                                                                                                    |
| lang      | `string`                                          |         |                                                                                                                                                                                    |
| inert     | `boolean`                                         |         |                                                                                                                                                                                    |
| translate | `"yes" \| "no"`                                   |         |                                                                                                                                                                                    |

##### Events

| Prop                        | Type                                     | Default | Description |
| --------------------------- | ---------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |             |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop | Type                  | Default | Description                                                                                                         |
| ---- | --------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| role | `"group" \| "region"` | 'group' | The accessibility role for the disclosure's panel.                                                                  |
| id   | `string`              |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* Disclosure now has two children components called `DisclosureHeader` and `DisclosurePanel`.
* `DisclosurePanel` is optional and most likely wouldn't be used for Orbiter. A custom header can be used by using a Button component inside Disclosure.
* `defaultOpen` is renamed to `defaultExpanded`.
* `open` is renamed to `isExpanded`.
* `onOpenChange` is renamed to `onExpandedChange`.

## Div

A specialized component to represent an HTML div element.

```tsx
import { Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div color="neutral-weak">
            Apple co-founder Steve Wozniak tweeted on Sunday about a "private space company" he's launching
            that's "unlike the others." Called Privateer Space, its mission is to "keep space safe and
            accessible to all humankind".
        </Div>
    );
}
```

### Usage

A div component accepts all the [div HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div) and [Hopper styled component props](/styled-system/concepts/styling.md).

### Best Practices

`Div` is a low-level primitive that provides styled system props to a standard HTML `div` element. However, **it should not be your first choice** for layouts. Hopper provides specialized layout components (`Flex`, `Inline`, `Stack`, `Grid`) that are more semantic, maintainable, and expressive for common layout patterns.

Div should:

* Be used sparingly, only when layout components don't fit your needs.
* Not be used as a wrapper just to add spacing or styling when you can apply those props directly to the child component.
* Not be used for layouts that can be achieved with `Flex`, `Inline`, `Stack`, or `Grid`.
* Be used for semantic grouping or when you need a generic container with styled system props.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Button, Stack, Text } from "@hopper-ui/components";

  export function Example() {
      return (
          <Stack gap="stack-md">
              <Text>Reviewed Items: 10</Text>
              <Button variant="primary">Submit</Button>
          </Stack>
      );
  }
  ```

  Use Inline, Stack, or Flex for layouts instead of Div

* 🚫 Don't:

  ```tsx
  import { Button, Div, Text } from "@hopper-ui/components";

  export function Example() {
      return (
          <Div display="flex" flexDirection="column" gap="stack-md">
              <Text>Reviewed Items: 10</Text>
              <Button variant="primary">Submit</Button>
          </Div>
      );
  }
  ```

  Use Div with display flex when layout components are more semantic

**Rule 2**

* ✅ Do:

  ```tsx
  import { Button } from "@hopper-ui/components";

  export function Example() {
      return (
          <Button
              variant="primary"
              marginTop="stack-lg"
              padding="inset-md"
          >
              Submit
          </Button>
      );
  }
  ```

  Apply styling props directly to components that support them

* 🚫 Don't:

  ```tsx
  import { Button, Div } from "@hopper-ui/components";

  export function Example() {
      return (
          <Div marginTop="stack-lg" padding="inset-md">
              <Button variant="primary">
                  Submit
              </Button>
          </Div>
      );
  }
  ```

  Wrap components in Div just to add spacing or styling

## Divider

A divider separates sections of content or groups.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/divider/src/Divider.tsx>

```tsx
import { Div, Divider } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="100%">
            <Divider />
        </Div>
    );
}
```

### Usage

#### Orientation

A divider can have two orientations: horizontal or vertical.

```tsx
import { Divider, Inline, Stack, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack width="100%">
            <Stack>
                <Text>Content above</Text>
                <Divider orientation="horizontal" />
                <Text>Content below</Text>
            </Stack>
            <Inline alignY="stretch">
                <Text>Content left</Text>
                <Divider orientation="vertical" />
                <Text>Content right</Text>
            </Inline>
        </Stack>
    );
}
```

### Props

| Prop        | Type            | Default      | Description                                                                                              |
| ----------- | --------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| style       | `CSSProperties` |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| orientation | `Orientation`   | 'horizontal' | The orientation of the separator.                                                                        |
| elementType | `string`        |              | The HTML element type that will be used to render the separator.                                         |
| className   | `string`        |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| dir         | `string`        |              |                                                                                                          |
| lang        | `string`        |              |                                                                                                          |
| inert       | `boolean`       |              |                                                                                                          |
| translate   | `"yes" \| "no"` |              |                                                                                                          |

##### Events

| Prop                        | Type                                  | Default | Description |
| --------------------------- | ------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `Children` is not supported.

## ErrorMessage

An error message displays validation errors for a form field.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/error-message/src/ErrorMessage.tsx>

```tsx
import { ErrorMessage, SlotProvider } from "@hopper-ui/components";
import { FieldErrorContext } from "react-aria-components";

export default function Example() {
    return (
        <SlotProvider values={[
            [FieldErrorContext, {
                isInvalid: true,
                validationErrors: [] as never[],
                validationDetails: {} as never
            }]
        ]}
        >
            <ErrorMessage>This field is required</ErrorMessage>
        </SlotProvider>
    );
}
```

### Usage

#### No icon

An error message can hide its default icon.

```tsx
import { ErrorMessage, SlotProvider } from "@hopper-ui/components";
import { FieldErrorContext } from "react-aria-components";

export default function Example() {
    return (
        <SlotProvider values={[
            [FieldErrorContext, {
                isInvalid: true,
                validationErrors: [] as never[],
                validationDetails: {} as never
            }]
        ]}
        >
            <ErrorMessage hideIcon>This field is required</ErrorMessage>
        </SlotProvider>
    );
}
```

#### Multiple errors

An error message can display multiple validation errors created by a form field.

```tsx
import { ErrorMessage, SlotProvider } from "@hopper-ui/components";
import { FieldErrorContext } from "react-aria-components";

export default function Example() {
    return (
        <SlotProvider values={[
            [FieldErrorContext, {
                isInvalid: true,
                validationErrors: ["This field is required.", "This field is too long."],
                validationDetails: {} as never
            }]
        ]}
        >
            <ErrorMessage />
        </SlotProvider>
    );
}
```

### Props

| Prop        | Type                                         | Default | Description                                                                                                                                                                        |
| ----------- | -------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| hideIcon    | `boolean`                                    |         | Whether or not to hide the error message icon.                                                                                                                                     |
| style       | `StyleOrFunction<FieldErrorRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| children    | `ChildrenOrFunction<FieldErrorRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className   | `ClassNameOrFunction<FieldErrorRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| elementType | `string`                                     |         |                                                                                                                                                                                    |
| size        | `ResponsiveProp<TextSize>`                   | "md"    | The Typography Type Scale to use.                                                                                                                                                  |

##### Accessibility

| Prop | Type     | Default | Description                                                                                                         |
| ---- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id   | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

## Flex

A flex component is used to create a flex container.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/layout/src/Flex.tsx>

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Flex>
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Flex>
        </Div>
    );
}
```

### Usage

#### Vertical Alignment

A flex layout can have vertically aligned items.

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Flex direction="column">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Flex>
        </Div>
    );
}
```

#### Gap

A flex layout can have a gap between his items. `columnGap` and `rowGap` are also available to specify a gap for a single axis.

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Flex gap="stack-sm">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Flex>
        </Div>
    );
}
```

#### Align Items

A flex layout can align its items along the cross-axis. When the direction is "column", this refers to horizontal alignment, and when the direction is "row", it refers to vertical alignment.

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Flex direction="column" alignItems="center">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Flex>
        </Div>
    );
}
```

#### Justify Content

A flex layout can justify its items along the main axis. When the direction is "column", this refers to vertical alignment, and when the direction is "row", it refers to horizontal alignment.

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Flex justifyContent="space-between">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Flex>
        </Div>
    );
}
```

#### Reverse

A flex layout can show its items in reverse order.

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Flex direction="row-reverse">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Flex>
        </Div>
    );
}
```

#### Wrap

Flex layout items can wrap multiple rows.

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Flex wrap>
                <Square backgroundColor="decorative-option1-weak" />
                <Square backgroundColor="decorative-option2-weak" />
                <Square backgroundColor="decorative-option3-weak" />
                <Square backgroundColor="decorative-option4-weak" />
                <Square backgroundColor="decorative-option5-weak" />
                <Square backgroundColor="decorative-option6-weak" />
                <Square backgroundColor="decorative-option7-weak" />
                <Square backgroundColor="decorative-option8-weak" />
                <Square backgroundColor="decorative-option9-weak" />
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option2" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
                <Square backgroundColor="decorative-option5" />
                <Square backgroundColor="decorative-option6" />
                <Square backgroundColor="decorative-option7" />
                <Square backgroundColor="decorative-option8" />
                <Square backgroundColor="decorative-option9" />
                <Square backgroundColor="decorative-option1-strong" />
                <Square backgroundColor="decorative-option2-strong" />
                <Square backgroundColor="decorative-option3-strong" />
                <Square backgroundColor="decorative-option4-strong" />
                <Square backgroundColor="decorative-option5-strong" />
                <Square backgroundColor="decorative-option6-strong" />
                <Square backgroundColor="decorative-option7-strong" />
                <Square backgroundColor="decorative-option8-strong" />
                <Square backgroundColor="decorative-option9-strong" />
            </Flex>
        </Div>
    );
}
```

#### Nesting

Flex layouts can be nested.

```tsx
import { Flex, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Flex gap="stack-md">
                <Flex>
                    <Square backgroundColor="decorative-option1-weak" />
                    <Square backgroundColor="decorative-option3-weak" />
                </Flex>
                <Flex direction="column">
                    <Square backgroundColor="decorative-option1" />
                    <Square backgroundColor="decorative-option3" />
                </Flex>
                <Flex>
                    <Square backgroundColor="decorative-option1-strong" />
                    <Square backgroundColor="decorative-option3-strong" />
                </Flex>
            </Flex>
        </Div>
    );
}
```

### Best Practices

Flex should be used for general-purpose flexible layouts when you need more control than `Inline` or `Stack` provide. For simple horizontal rows with centered items, use `Inline`. For simple vertical stacks, use `Stack`. Use `Flex` when you need to customize multiple layout properties, use responsive direction changes, or apply flex properties to individual children.

Flex should:

* Be used when you need to customize two or more layout properties (e.g., both `alignItems` and `justifyContent`).
* Handle responsive layouts where `direction` changes based on breakpoints.
* Be preferred over `Inline` or `Stack` when children need individual flex properties like `flex`, `order`, or custom alignment.
* Use [Hopper space tokens](/tokens/semantic/space.md) for `gap`, `rowGap`, and `columnGap` to ensure consistency.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Avatar, Inline, Text } from "@hopper-ui/components";

  export function Example() {
      return (
          <Inline alignY="center" gap="inline-sm">
              <Avatar name="Sarah Chen" src="https://i.pravatar.cc/96?img=5" size="sm" />
              <Text>Sarah Chen</Text>
              <Text>Product Designer</Text>
          </Inline>
      );
  }
  ```

  Use Inline for simple horizontal layouts with centered items

* 🚫 Don't:

  ```tsx
  import { Avatar, Flex, Text } from "@hopper-ui/components";

  export function Example() {
      return (
          <Flex direction="row" alignItems="center" gap="inline-sm">
              <Avatar name="Sarah Chen" src="https://i.pravatar.cc/96?img=5" size="sm" />
              <Text>Sarah Chen</Text>
              <Text>Product Designer</Text>
          </Flex>
      );
  }
  ```

  Use Flex with default direction='row' and alignItems='center' when Inline is sufficient

**Rule 2**

* ✅ Do:

  ```tsx
  import { Button, Stack, TextField } from "@hopper-ui/components";

  export function Example() {
      return (
          <Stack gap="stack-md">
              <TextField label="Email" />
              <TextField label="Password" type="password" />
              <Button variant="primary">Sign In</Button>
          </Stack>
      );
  }
  ```

  Use Stack for simple vertical layouts with consistent spacing

* 🚫 Don't:

  ```tsx
  import { Button, Flex, TextField } from "@hopper-ui/components";

  export function Example() {
      return (
          <Flex direction="column" gap="stack-md">
              <TextField label="Email" />
              <TextField label="Password" type="password" />
              <Button variant="primary">Sign In</Button>
          </Flex>
      );
  }
  ```

  Use Flex with direction='column' when Stack is sufficient

### Props

| Prop      | Type                                                  | Default | Description                                                                             |
| --------- | ----------------------------------------------------- | ------- | --------------------------------------------------------------------------------------- |
| direction | `ResponsiveProp<FlexDirection>`                       |         | The flex direction of the container. Can be row, column, row-reverse or column-reverse. |
| wrap      | `ResponsiveProp<FlexWrap> \| ResponsiveProp<boolean>` |         | Whether to wrap the flex items. The value can also be a boolean.                        |
| basis     | `ResponsiveProp<FlexBasis<0 \| (string & {})>>`       |         | An alias for the css flex-basis property.                                               |
| grow      | `ResponsiveProp<FlexGrow>`                            |         | An alias for the css flex-grow property.                                                |
| shrink    | `ResponsiveProp<FlexShrink>`                          |         | An alias for the css flex-shrink property.                                              |
| inline    | `boolean`                                             |         | Whether to display the flex container as an inline element.                             |
| style     | `CSSProperties`                                       |         |                                                                                         |
| className | `string`                                              |         |                                                                                         |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `fluid` has been removed.
* `reverse` is not supported, use `direction` instead. [Here's an example](/components/Flex.md#usage-reverse).

## FloatingBadge

A floating badge allows the user to position a badge relative to another component.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/Badge/src/FloatingBadge.tsx>

```tsx
import { Badge, Div, FloatingBadge } from "@hopper-ui/components";

export default function Example() {
    return (
        <FloatingBadge>
            <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
            <Badge>NEW</Badge>
        </FloatingBadge>
    );
}
```

### Anatomy

#### Structure

```tsx
<FloatingBadge>
    <Component /> /* (Required) The component to which the badge is attached */
    <Badge /> /* (Required) The badge of the floating badge */
</FloatingBadge>
```

#### Composed Components

A `FloatingBadge` uses the following components:

| Component | Description                                       |
| --------- | ------------------------------------------------- |
| Badge     | A badge is used to bring attention to an element. |

### Usage

#### Placement

A floating badge can be positioned relative to another component using the `placement` prop. This allows the badge to be placed in any of the 4 positions around the target component.

```tsx
import { Inline, Badge, Div, FloatingBadge } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline gap="inline-xl">
            <FloatingBadge placement="top left">
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge isIndeterminate></Badge>
            </FloatingBadge>
            <FloatingBadge placement="bottom left">
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge isIndeterminate></Badge>
            </FloatingBadge>
            <FloatingBadge placement="bottom right">
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge isIndeterminate></Badge>
            </FloatingBadge>
            <FloatingBadge placement="top right">
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge isIndeterminate></Badge>
            </FloatingBadge>
        </Inline>
    );
}
```

#### Overlap

Allows you to specify whether the badge overlaps a rectangular or circular component.

```tsx
import { Badge, Div, FloatingBadge, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline gap="inline-xl">
            <FloatingBadge overlap="rectangular">
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge>NEW</Badge>
            </FloatingBadge>
            <FloatingBadge overlap="circular">
                <Div height="core_320" width="core_320" borderRadius="circle" backgroundColor="primary-weak" />
                <Badge>NEW</Badge>
            </FloatingBadge>
            <FloatingBadge overlap="rectangular">
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge isIndeterminate></Badge>
            </FloatingBadge>
            <FloatingBadge overlap="circular">
                <Div height="core_320" width="core_320" borderRadius="circle" backgroundColor="primary-weak" />
                <Badge isIndeterminate></Badge>
            </FloatingBadge>
        </Inline>
    );
}
```

#### Offset

The position of the badge can be adjusted using the `offset` prop. This prop accepts an object with `x` and `y` properties that will be used to adjust the badge's position.

```tsx
import { Badge, Div, FloatingBadge, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline gap="inline-xl">
            <FloatingBadge offset={[10, "-5%"]}>
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge>NEW</Badge>
            </FloatingBadge>
            <FloatingBadge offset={[10, "-5%"]}>
                <Div height="core_320" width="core_320" backgroundColor="primary-weak" />
                <Badge isIndeterminate></Badge>
            </FloatingBadge>
        </Inline>
    );
}
```

### Props

| Prop      | Type                                     | Default       | Description                                                                                              |
| --------- | ---------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------- |
| offset    | `[string \| number, string \| number]`   |               | The offset of the badge from the anchor component. \[horizontal, vertical]                               |
| overlap   | `FloatingBadgeOverlap`                   | "rectangular" | The wrapped shape that the badge should overlap.                                                         |
| placement | `ResponsiveProp<FloatingBadgePlacement>` | "top right"   | The placement of the badge relative to the anchor component.                                             |
| children  | `ReactNode`                              |               | The children of the component.                                                                           |
| className | `string`                                 |               | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| style     | `CSSProperties`                          |               | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `highlight` is not supported.
* `pushed` is not supported.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* `size` is not supported.
* `variant` has different values.
* `icon` variant it not supported.
* `wrapperProps` has been removed.
* Badge is no longer floating. Use the `FloatingBadge` component to add this feature.
* `FloatingBadge` has new props such as `placement` and `offset`.
* `overlap` is used inside `FloatingBadge` and the new values are `circular` and `rectangular`.

## Footer

A placeholder for a footer section.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/layout/src/Footer.tsx>

A footer placeholder component provides no specific styling by itself, but receives styling from the parent container. In addition, a footer placeholder will be automatically placed within the container's layout according to Hopper guidelines.

```tsx
import { Footer } from "@hopper-ui/components";

export default function Example() {
    return (
        <Footer>Software built for everyone to do their best work.</Footer>
    );
}
```

### Props

| Prop      | Type            | Default | Description                                                                                              |
| --------- | --------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| style     | `CSSProperties` |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children  | `ReactNode`     |         | The children of the component.                                                                           |
| className | `string`        |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## Form

Forms are used to gather information from the user.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/form/src/Form.tsx>

```tsx
import { Button, Form, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form>
            <TextField name="email" placeholder="Enter your email" label="Email" />
            <Button type="submit">Sign In</Button>
        </Form>
    );
}
```

### Anatomy

#### Structure

```tsx
<Form>
    <TextField /> /* (Optional) A text field within the form */
    <PasswordField /> /* (Optional) A password field within the form */
    <NumberField /> /* (Optional) A number field within the form */
    <HelperMessage /> /* (Optional) A helper message within the form */
    <ErrorMessage /> /* (Optional) An error message within the form */
    <ButtonGroup /> /* (Optional) A button group within the form */
    <Button /> /* (Optional) A button within the form */
</Form>
```

#### Composed Components

A `Form` uses the following components:

| Component     | Description                                                                          |
| ------------- | ------------------------------------------------------------------------------------ |
| Button        | A button allows a user to initiate an action.                                        |
| ButtonGroup   | A button group handles the spacing and orientation for a grouping of buttons.        |
| ErrorMessage  | An error message displays validation errors for a form field.                        |
| HelperMessage | A helper message component displays auxiliary text to guide users in the interface.  |
| NumberField   | A number field is a specialized input that allows a user to enter a number.          |
| PasswordField | A password field is a specialized text field that allows a user to enter a password. |
| TextField     | A text field allows a user to enter a plain text value.                              |

### Usage

#### Disabled

A disabled form will not allow the user to interact with the form.

```tsx
import { Button, Form, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form isDisabled>
            <TextField name="email" placeholder="Enter your email" label="Email" />
            <Button type="submit">Sign In</Button>
        </Form>
    );
}
```

#### Validation

To provide validation errors, the `validationErrors` prop should be set to an object that maps each field's `name` prop to a string or array of strings representing one or more errors. These are displayed to the user as soon as the `validationErrors` prop is set and cleared after the user modifies each field's value.

```tsx
import { Form, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form validationErrors={{ username: "Sorry, this username is taken." }}>
            <TextField name="username" defaultValue="john_doe" label="Username" />
        </Form>
    );
}
```

##### Native Behavior

Native HTML form validation is used to display errors and block form submission.

```tsx
import { Button, ButtonGroup, Form, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form validationBehavior="native">
            <TextField
                name="email"
                type="email"
                isRequired
                label="Email"
            />
            <ButtonGroup>
                <Button type="submit">Submit</Button>
                <Button type="reset">Reset</Button>
            </ButtonGroup>
        </Form>
    );
}
```

##### Aria Behavior

To use form validation via ARIA, set the `validationBehavior` property to "aria". This will not block form submission and will display validation errors to the user in real time as the value is modified.

```tsx
import { Button, Form, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form validationBehavior="aria">
            <TextField
                name="username"
                defaultValue="admin"
                isRequired
                validate={value => value === "admin" ? "Nice try." : null}
                label="Username"
            />
            <Button type="submit">Submit</Button>
        </Form>
    );
}
```

#### Sizes

A form has multiple sizes to choose from.

```tsx
import { Button, Form, Stack, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack gap="stack-sm" margin="stack-lg">
            <Form>
                <TextField name="email" placeholder="Enter your email" label="Email" />
                <Button type="submit">Sign In</Button>
            </Form>
            <Form size="sm">
                <TextField name="email" placeholder="Enter your email" label="Email" />
                <Button type="submit">Sign In</Button>
            </Form>
        </Stack>
    );
}
```

#### Fluid

Form fields can take the width of their container.

```tsx
import { Button, Form, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form isFluid width="80%">
            <TextField name="email" placeholder="Enter your email" label="Email" />
            <Button type="submit">Sign In</Button>
        </Form>
    );
}
```

### Props

| Prop               | Type                        | Default | Description                                                                                                                            |
| ------------------ | --------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| isDisabled         | `boolean`                   |         | Whether the form elements are disabled.                                                                                                |
| isFluid            | `ResponsiveProp<boolean>`   |         | If `true`, the Form will take all available width.                                                                                     |
| necessityIndicator | `NecessityIndicator`        |         | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels. |
| size               | `ResponsiveProp<FieldSize>` | "md"    | The size of the fields and buttons within the form.                                                                                    |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `disabled` has been renamed `isDisabled`.
* `fluid` has been renamed `isFluid`.

## Grid

The grid component is used to create a grid container.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/layout/src/Grid.tsx>

```tsx
import { Grid, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid autoFlow="column">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Grid>
        </Div>
    );
}
```

### Usage

#### Areas

A grid can define explicit sections with areas.

```tsx
import { Grid, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid areas={["a  a", "b c"]}>
                <Square gridArea="a" backgroundColor="decorative-option1" />
                <Square gridArea="b" backgroundColor="decorative-option3" />
                <Square gridArea="c" backgroundColor="decorative-option4" />
            </Grid>
        </Div>
    );
}
```

#### Template Columns

A grid can define explicit columns and rows. A value can be a grid length value or a Hopper spacing scale value.

```tsx
import { Grid, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid templateColumns={["core_800", "core_1280", "1fr"]}>
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Grid>
        </Div>
    );
}
```

#### Auto Columns

A grid can define the size of implicitly created columns. A value can be a grid length value or a Hopper spacing scale value.

```tsx
import { Grid, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid autoColumns="1fr">
                <Square gridColumn={2} backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Grid>
        </Div>
    );
}
```

#### Gap

A grid layout can have a gap between its columns and rows. `columnGap` and `rowGap` are also available to specify a gap for a single axis.

```tsx
import { Grid, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid templateColumns={["1fr", "1fr"]} gap="stack-sm">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option2" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Grid>
        </Div>
    );
}
```

#### Column Spanning

A grid item can span over multiple columns.

```tsx
import { Grid, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid templateColumns={["1fr", "1fr", "1fr"]} gap="stack-sm">
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option2" />
                <Square backgroundColor="decorative-option3" />
                <Square gridColumnSpan={3} gridRow={2} backgroundColor="decorative-option4" />
            </Grid>
        </Div>
    );
}
```

#### Nesting

Grids can be nested to create complex layouts.

```tsx
import { Grid, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid templateRows={["1fr", "1fr"]} gap="stack-sm">
                <Grid templateColumns={["core_800", "auto"]}>
                    <Square backgroundColor="decorative-option1" />
                    <Square backgroundColor="decorative-option3" />
                </Grid>
                <Grid templateColumns={["auto", "core_960"]}>
                    <Square backgroundColor="decorative-option1-strong" />
                    <Square backgroundColor="decorative-option3-strong" />
                </Grid>
            </Grid>
        </Div>
    );
}
```

#### Repeat

A custom `repeat` function is available to support Hopper spacing scale values. However, if you prefer, you can use the [native CSS repeat function](https://developer.mozilla.org/en-US/docs/Web/CSS/repeat\(\)).

```tsx
import { Div, type DivProps, Grid, repeat } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid
                templateColumns={repeat("auto-fit", "core_640")}
                autoRows="core_640"
                gap="stack-sm"
            >
                <Square backgroundColor="decorative-option1-weak" />
                <Square backgroundColor="decorative-option2-weak" />
                <Square backgroundColor="decorative-option3-weak" />
                <Square backgroundColor="decorative-option4-weak" />
                <Square backgroundColor="decorative-option5-weak" />
                <Square backgroundColor="decorative-option6-weak" />
                <Square backgroundColor="decorative-option7-weak" />
                <Square backgroundColor="decorative-option8-weak" />
                <Square backgroundColor="decorative-option9-weak" />
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option2" />
                <Square backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
                <Square backgroundColor="decorative-option5" />
                <Square backgroundColor="decorative-option6" />
                <Square backgroundColor="decorative-option7" />
                <Square backgroundColor="decorative-option8" />
                <Square backgroundColor="decorative-option9" />
                <Square backgroundColor="decorative-option1-strong" />
                <Square backgroundColor="decorative-option2-strong" />
                <Square backgroundColor="decorative-option3-strong" />
                <Square backgroundColor="decorative-option4-strong" />
                <Square backgroundColor="decorative-option5-strong" />
                <Square backgroundColor="decorative-option6-strong" />
                <Square backgroundColor="decorative-option7-strong" />
                <Square backgroundColor="decorative-option8-strong" />
                <Square backgroundColor="decorative-option9-strong" />
            </Grid>
        </Div>
    );
}
```

#### Minmax

A custom `minmax` function is available to support Hopper spacing scale values. However, if you prefer, you can use the [native CSS minmax function](https://developer.mozilla.org/en-US/docs/Web/CSS/minmax\(\)).

```tsx
import { Div, type DivProps, Grid, minmax } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid
                templateColumns={[minmax("core_800", "1fr"), "core_960", minmax("core_800", "1fr")]}
                gap="stack-sm"
            >
                <Square backgroundColor="decorative-option1" />
                <Square backgroundColor="decorative-option2" />
                <Square backgroundColor="decorative-option3" />
            </Grid>
        </Div>
    );
}
```

#### Fit Content

A custom `fit-content` function is available to support Hopper spacing scale values. However, if you prefer, you can use the [native CSS fit-content function](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content).

```tsx
import { Div, type DivProps, fitContent, Grid } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" minHeight="core_640" minWidth="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_400">
            <Grid
                templateColumns={[fitContent("core_800"), fitContent("core_800"), "1fr"]}
                gap="stack-sm"
                alignItems="center"
            >
                <Square padding="inset-sm" backgroundColor="decorative-option1" />
                <Square padding="inset-sm" backgroundColor="decorative-option2" />
                <Square padding="inset-sm" backgroundColor="decorative-option3" />
            </Grid>
        </Div>
    );
}
```

### Best Practices

Grid is a powerful layout component for creating two-dimensional layouts with rows and columns. It's ideal for complex application layouts, data tables, card grids, and any scenario where precise control over both horizontal and vertical positioning is needed.

Grid should:

* Be used for two-dimensional layouts where items need to align both horizontally and vertically.
* Use Hopper dimension tokens for `templateColumns`, `templateRows`, and spacing properties to ensure consistency.
* Leverage named grid areas for semantic and maintainable layout definitions.
* Use the custom `repeat()`, `minmax()`, and `fitContent()` functions to support Hopper tokens.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Div, Grid } from "@hopper-ui/components";

  export function Example() {
      return (
          <Grid
              areas={[
                  "header header",
                  "sidebar content",
                  "footer footer"
              ]}
              templateColumns={["core_1280", "1fr"]}
              templateRows={["core_640", "auto", "core_640"]}
              gap="core_160"
          >
              <Div backgroundColor="decorative-option1" gridArea="header" padding="inset-md" />
              <Div backgroundColor="decorative-option2" gridArea="sidebar" padding="inset-md" />
              <Div backgroundColor="decorative-option3" gridArea="content" padding="inset-md" />
              <Div backgroundColor="decorative-option4" gridArea="footer" padding="inset-md" />
          </Grid>
      );
  }
  ```

  Use Grid for two-dimensional layouts with named areas for clarity

* 🚫 Don't:

  ```tsx
  import { Div, Flex } from "@hopper-ui/components";

  export function Example() {
      return (
          <Flex direction="column" gap="core_160">
              <Div backgroundColor="decorative-option1" padding="inset-md" />
              <Flex gap="core_160">
                  <Div backgroundColor="decorative-option2" padding="inset-md" width="core_1280" />
                  <Div backgroundColor="decorative-option3" padding="inset-md" flex={1} />
              </Flex>
              <Div backgroundColor="decorative-option4" padding="inset-md" />
          </Flex>
      );
  }
  ```

  Use nested Flex components when a single Grid would be simpler and more semantic

### Props

| Prop                    | Type                                              | Default | Description                                                              |
| ----------------------- | ------------------------------------------------- | ------- | ------------------------------------------------------------------------ |
| inline                  | `boolean`                                         |         | Whether or not the element generate line breaks before or after himself. |
| autoRows                | `ResponsiveProp<GridAutoRowsValue>`               |         | An alias for the css grid-auto-rows property.                            |
| areas                   | `ResponsiveProp<GridTemplateAreasValue>`          |         | An alias for the css grid-template-areas property.                       |
| templateColumns         | `ResponsiveProp<GridTemplateColumnsValue>`        |         | An alias for the css grid-template-columns property.                     |
| templateRows            | `ResponsiveProp<GridTemplateRowsValue>`           |         | An alias for the css grid-template-rows property.                        |
| autoColumns             | `ResponsiveProp<GridAutoColumnsValue>`            |         | An alias for the css grid-auto-columns property.                         |
| autoFlow                | `ResponsiveProp<GridAutoFlow>`                    |         | An alias for the css grid-auto-flow property.                            |
| UNSAFE\_autoRows        | `ResponsiveProp<UNSAFE_GridAutoRowsValue>`        |         | An alias for the css grid-auto-rows property.                            |
| UNSAFE\_templateColumns | `ResponsiveProp<UNSAFE_GridTemplateColumnsValue>` |         | An alias for the css grid-template-columns property.                     |
| UNSAFE\_templateRows    | `ResponsiveProp<UNSAFE_GridTemplateRowsValue>`    |         | An alias for the css grid-template-rows property.                        |
| UNSAFE\_autoColumns     | `ResponsiveProp<UNSAFE_GridAutoColumnsValue>`     |         | An alias for the css grid-auto-columns property.                         |
| style                   | `CSSProperties`                                   |         |                                                                          |
| className               | `string`                                          |         |                                                                          |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

## Header

A placeholder for an header section.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/header/src/Header.tsx>

An header placeholder component provides no specific styling by itself, but receives styling from the parent container. In addition, an header placeholder will be automatically placed within the container's layout according to Hopper guidelines.

```tsx
import { Header } from "@hopper-ui/components";

export default function Example() {
    return (
        <Header>Software built for everyone to do their best work.</Header>
    );
}
```

### Props

| Prop      | Type            | Default | Description                                                                                              |
| --------- | --------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| style     | `CSSProperties` |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children  | `ReactNode`     |         | The children of the component.                                                                           |
| className | `string`        |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## Heading

A heading is a primitive component matching Hopper's typography type scale.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/typography/heading/src/Heading.tsx>

```tsx
import { Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <Heading>Great work!</Heading>
    );
}
```

### Usage

#### Sizes

You can alter the size of the heading by specifying a `size` prop. The available sizes match Hopper Typography Type Scale — a type scale is a set of [font-size and line-height](https://hopper.workleap.design/tokens/semantic/typography#tokens-heading) pairs.

```tsx
import { Heading, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Heading size="xs">Great work!</Heading>
            <Heading size="sm">Great work!</Heading>
            <Heading size="md">Great work!</Heading>
            <Heading size="lg">Great work!</Heading>
            <Heading size="xl">Great work!</Heading>
            <Heading size="2xl">Great work!</Heading>
            <Heading size="3xl">Great work!</Heading>
        </Stack>
    );
}
```

#### Levels

You can alter the level of the heading by specifying a `level` prop. The available levels match HTML heading elements — h1-h6.

```tsx
import { Heading, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Heading level={1}>Great work!</Heading>
            <Heading level={2}>Great work!</Heading>
            <Heading level={3}>Great work!</Heading>
            <Heading level={4}>Great work!</Heading>
            <Heading level={5}>Great work!</Heading>
            <Heading level={6}>Great work!</Heading>
        </Stack>
    );
}
```

#### Inherit

You can alter the size of a heading to match the parent element's type scale by using the `inherit` size.

```tsx
import { Div, Heading } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div fontSize="heading-lg">
            <Heading size="inherit">Great work!</Heading>
        </Div>
    );
}
```

### Props

These props are also available for `H1`, `H2`, `H3`, `H4`, `H5` and `H6` components.

| Prop      | Type                          | Default | Description                       |
| --------- | ----------------------------- | ------- | --------------------------------- |
| size      | `ResponsiveProp<HeadingSize>` | "md"    | The Typography Type Scale to use. |
| style     | `CSSProperties`               |         |                                   |
| level     | `number`                      |         |                                   |
| className | `string`                      |         |                                   |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

### Migration Notes

Coming from Orbiter, you should be aware of the following change:

* Headings no longer come with margin by default; you're now responsible for adding the appropriate margin yourself.

In order to migrate to Hopper Heading seamlessly here's a cheatsheet regarding the applied margin-bottom of each heading sizes:

**xs** `calc(1.125rem * .5) | 9px`\
**sm** `calc(1.375rem * .5) | 11px`\
**md** `calc(1.75rem * .5) | 14px`\
**lg** `calc(2rem * .5) | 16px`\
**xl** `calc(2.5rem * .5) | 20px`\
**2xl** `calc(1rem * .5) | 8px`\
**3xl** `calc(1rem * .5) | 8px`

*Some UI might require different margins, this table is provided as a guidance to kickstart youre migration toward Hopper.*

## HelperMessage

A helper message component displays auxiliary text to guide users in the interface.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/helper-message/src/HelperMessage.tsx>

```tsx
import { HelperMessage } from "@hopper-ui/components";

export default function Example() {
    return (
        <HelperMessage>Software built for everyone to do their best work</HelperMessage>
    );
}
```

### Usage

#### No icon

A helper message can hide its default icon.

```tsx
import { HelperMessage } from "@hopper-ui/components";

export default function Example() {
    return (
        <HelperMessage hideIcon>Software built for everyone to do their best work</HelperMessage>
    );
}
```

### Props

| Prop        | Type            | Default | Description                                     |
| ----------- | --------------- | ------- | ----------------------------------------------- |
| hideIcon    | `boolean`       |         | Whether or not to hide the helper message icon. |
| style       | `CSSProperties` |         |                                                 |
| elementType | `string`        |         |                                                 |
| className   | `string`        |         |                                                 |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

## HopperProvider

HopperProvider is the container for all applications using Hopper. It defines the color scheme, locale, and other application level settings. It is also used to dynamically inject CSS variables and body styles to your application.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/hopper-provider/src/HopperProvider.tsx>

```tsx
import { Button, HopperProvider } from "@hopper-ui/components";

export default function Example() {
    return (
        <HopperProvider colorScheme="light" withBodyStyle>
            <Button variant="primary">
                Hello!
            </Button>
        </HopperProvider>
    );
}
```

### Application provider

A HopperProvider must be the root component of your application. All other Hopper components rely on the Provider to define the color scheme, locale, and other settings that they need in order to render. You can nest multiple HopperProviders to create different themes or locales for different parts of your application if needed.

#### Color scheme

We recommend supporting both light and dark color schemes in your application. If you need to override this with an application specific setting, you can use the colorScheme prop.

```tsx
import { Button, HopperProvider } from "@hopper-ui/components";

export default function Example() {
    return (
        <HopperProvider colorScheme="light">
            <Button>I'm a light button</Button>
        </HopperProvider>
    );
}
```

See the [Styled System documentation](/styled-system/overview/introduction.md) for more information about using Hopper color variables in your application to ensure it adapts to light and dark mode properly.

See the [color schemes documentation](./color-schemes.md) for more information on how to apply a color scheme to your application.

#### Locales

Another important setting for your application is the locale. By default, Hopper chooses the locale matching the user's browser/operating system language. This can be overridden with the locale prop if you have an application specific setting. This prop accepts a [BCP 47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code. Hopper currently supports the following locales: `en-US`, `en-UK`, `fr-CA`, `fr-FR`.

```tsx
import { Div, HopperProvider } from "@hopper-ui/components";

export default function Example() {
    return (
        <HopperProvider colorScheme="light" locale="en-US">
            <Div>{/* Your app here */}</Div>
        </HopperProvider>
    );
}
```

To access the current locale anywhere in your application, see the `useLocale` hook.

#### Client side routing

The HopperProvider component accepts an optional router prop. This enables Hopper components that render links to perform client side navigation using your application or framework's client side router. See the [client side routing](./client-side-routing.md) guide for details on how to set this up.

```tsx
import { Div, HopperProvider } from "@hopper-ui/components";

export default function Example() {
    // @ts-expect-error - This is a fake implementation
    const navigate = useNavigateFromYourRouter();

    return (
        <HopperProvider colorScheme="light" navigate={navigate}>
            <Div>{/* Your app here */}</Div>
        </HopperProvider>
    );
}
```

#### Inject body styles

`withBodyStyle` determines whether you want Hopper to style the body of your application. By default, it is set to false. You should enable it on the Hopper provider at the root of your application.

```tsx
import { Div, HopperProvider } from "@hopper-ui/components";

export default function Example() {
    return (
        <HopperProvider colorScheme="light" withBodyStyle>
            <Div>{/* Your app here */}</Div>
        </HopperProvider>
    );
}
```

`withBodyStyle` includes the following body elements styles:

```css
body {
    -webkit-font-smoothing: antialiased;
    font-family: var(--hop-body-md-font-family);
    line-height: var(--hop-body-md-line-height);
    font-size: var(--hop-body-md-font-size);
    color: var(--hop-neutral-text);
    background-color: var(--hop-neutral-surface);
    margin: 0;
    padding: 0;
}

@media not (prefers-reduced-motion) {
    body {
        scroll-behavior: smooth;
    }
}
```

#### useHopperContext

If you need to access the HopperProvider properties in a component, you can use the `useHopperContext` hook. This hook returns the Hopper context object, which includes the color scheme, locale, and other settings.

### Props

## HtmlButton

A specialized button component for HTML button element.

```tsx
import { HtmlButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <HtmlButton border="core_rock-900" padding="core_10" type="button">
            Launch
        </HtmlButton>
    );
}
```

### Usage

A button component accepts all the [button HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button) and [Hopper styled component props](/styled-system/concepts/styling.md).

## HtmlFooter

A specialized component to represent an HTML footer element.

```tsx
import { Article, H1, HtmlFooter, LI, Paragraph, UL } from "@hopper-ui/components";

export default function Example() {
    return (
        <Article>
            <H1>What does an aerospace engineer do?</H1>
            <UL>
                <LI>Research and development</LI>
                <LI>Testing</LI>
                <LI>Production and maintenance</LI>
            </UL>
            <HtmlFooter color="neutral-weak">
                <Paragraph>© 2021 Orbiter</Paragraph>
            </HtmlFooter>
        </Article>
    );
}
```

### Usage

An footer component accepts all the [footer HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/footer) and [Hopper styled component props](/styled-system/concepts/styling.md).

## HtmlHeader

A specialized component to represent an HTML header element.

```tsx
import { H1, HtmlHeader, Main, Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <>
            <HtmlHeader>
                <H1>Walking On The Moon</H1>
            </HtmlHeader>
            <Main color="neutral-weak">
                <Paragraph>
                    Walking on the Moon is classic Sting moment, with his band The Police turning out one of
                    their most groovy reggae-inspired hits to the background of space exploration.
                </Paragraph>
            </Main>
        </>
    );
}
```

### Usage

An header component accepts all the [header HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/header) and [Hopper styled component props](/styled-system/concepts/styling.md).

## HtmlInput

A specialized component to represent an HTML input element.

```tsx
import { HtmlInput } from "@hopper-ui/components";

export default function Example() {
    return (
        <HtmlInput border="core_rock-900" type="text" />
    );
}
```

### Usage

An input component accepts all the [input HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input) and [Hopper styled component props](/styled-system/concepts/styling.md).

## HtmlSection

A specialized component to represent an HTML section element.

```tsx
import { H2, HtmlSection, Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <HtmlSection color="neutral-weak">
            <H2>Our vision</H2>
            <Paragraph>
                Blue Origin was founded by Jeff Bezos with the vision of enabling a future where
                millions of people are living and working in space to benefit Earth.
            </Paragraph>
        </HtmlSection>
    );
}
```

### Usage

A section component accepts all the [section HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Icon

An icon component is used to render a custom icon.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/icons/src/Icon.tsx>

```tsx
import { createIcon } from "@hopper-ui/icons";

import { Sparkles16, Sparkles24, Sparkles32 } from "../src/index.ts";

const CustomIcon = createIcon(Sparkles16, Sparkles24, Sparkles32, "CustomIcon");

export default function Example() {
    return (
        <CustomIcon />
    );
}
```

Hopper provides multiple ways to use icons in your project:

* Using the [Workleap icon library](/icons/overview/introduction.md)
* [Creating your own icons](#creating-your-custom-icons)

### Creating your custom icons

To use an icon component to create custom icons you must first import your SVG icon as a component by using [`@svgr/webpack`](https://react-svgr.com/docs/getting-started/).

Hopper provides two methods for creating your custom icons:

* Using the `createIcon` function (recommended)
* Using the `Icon` component

Both `Icon` and `createIcon` enable you to style the icon using the styled system.

#### Using the createIcon function

The `createIcon` function is a convenience wrapper around the process of generating icons with `Icon`, allowing you to achieve the same functionality with less effort.

```tsx
import CustomIcon16 from "./path/to/custom-icon-16.svg";
import CustomIcon24 from "./path/to/custom-icon-24.svg";
import CustomIcon32 from "./path/to/custom-icon-32.svg";
import { createIcon } from "@hopper-ui/icons";

const CustomIcon = createIcon(CustomIcon16, CustomIcon24, CustomIcon32, "CustomIcon")
```

#### Using the Icon component

```tsx
import CustomIcon16 from "./path/to/custom-icon-16.svg"
import CustomIcon24 from "./path/to/custom-icon-24.svg"
import CustomIcon32 from "./path/to/custom-icon-32.svg"
import { Icon, type CreatedIconProps } from "@hopper-ui/icons";

function CustomIcon(props: CreatedIconProps) {
  return (
    <Icon
        src16={CustomIcon16}
        src24={CustomIcon24}
        src32={CustomIcon32}
        {...props} />
  )
}
```

### Usage

#### Sizes

An icon can vary in size. When used inside another component, it'll generally be sized automatically. If you use a standalone icon, you can use the size prop to control the sizing.

```tsx
import { Inline } from "@hopper-ui/components";
import { createIcon } from "@hopper-ui/icons";

import { Sparkles16, Sparkles24, Sparkles32 } from "../src/index.ts";

const CustomIcon = createIcon(Sparkles16, Sparkles24, Sparkles32, "CustomIcon");

export default function Example() {
    return (
        <Inline>
            <CustomIcon size="sm" />
            <CustomIcon size="md" />
            <CustomIcon size="lg" />
        </Inline>
    );
}
```

#### Styling

The color of the icon can be changed using the `fill` prop. All the styled system props are also available.

```tsx
import { createIcon } from "@hopper-ui/icons";

import { Sparkles16, Sparkles24, Sparkles32 } from "../src/index.ts";

const CustomIcon = createIcon(Sparkles16, Sparkles24, Sparkles32, "CustomIcon");

export default function Example() {
    return (
        <CustomIcon fill="primary" />
    );
}
```

### Props

| Prop      | Type                                                                               | Default | Description                                 |
| --------- | ---------------------------------------------------------------------------------- | ------- | ------------------------------------------- |
| style     | `CSSProperties`                                                                    |         |                                             |
| className | `string`                                                                           |         |                                             |
| size      | `ResponsiveProp<IconSize>`                                                         | "md"    | The size of the icon.                       |
| src16     | `ElementType<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>` |         | The source of the icon with a size of 16px. |
| src24     | `ElementType<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>` |         | The source of the icon with a size of 24px. |
| src32     | `ElementType<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>` |         | The source of the icon with a size of 32px. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

## IconList

An IconList encapsulates a collection of icons.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/icon-list/src/IconList.tsx>

```tsx
import { IconList } from "@hopper-ui/components";
import { StarIcon, StarSolidIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <IconList>
            <StarSolidIcon />
            <StarSolidIcon />
            <StarSolidIcon />
            <StarSolidIcon />
            <StarIcon />
        </IconList>
    );
}
```

### Anatomy

#### Structure

```tsx
<IconList>
    <Icon /> /* (Required) An icon for the IconList */
</IconList>
```

#### Composed Components

An `IconList` uses the following components:

| Component | Description                                        |
| --------- | -------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon. |

### Usage

#### Sizes

An icon list can vary in size.

```tsx
import { IconList, Stack } from "@hopper-ui/components";
import { StarIcon, StarSolidIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Stack alignX="center">
            <IconList size="sm">
                <StarSolidIcon />
                <StarSolidIcon />
                <StarSolidIcon />
                <StarSolidIcon />
                <StarIcon />
            </IconList>
            <IconList size="md">
                <StarSolidIcon />
                <StarSolidIcon />
                <StarSolidIcon />
                <StarSolidIcon />
                <StarIcon />
            </IconList>
            <IconList size="lg">
                <StarSolidIcon />
                <StarSolidIcon />
                <StarSolidIcon />
                <StarSolidIcon />
                <StarIcon />
            </IconList>
        </Stack>
    );
}
```

### Props

| Prop      | Type                       | Default | Description                                                                                              |
| --------- | -------------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| size      | `ResponsiveProp<IconSize>` |         | The size of the icon.                                                                                    |
| children  | `ReactNode`                |         | The children of the component.                                                                           |
| className | `string`                   |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| style     | `CSSProperties`            |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `disabled` prop is no longer available.

## IllustratedMessage

An illustrated message display an image and a message, usually for an empty state or an error page.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/illustrated-message/src/IllustratedMessage.tsx>

```tsx
import { Content, Heading, IllustratedMessage, SvgImage } from "@hopper-ui/components";

import { NoResults } from "../assets/index.ts";

export default function Example() {
    return (
        <IllustratedMessage>
            <SvgImage stroke="neutral" src={NoResults} aria-label="No Results" />
            <Heading>No results found</Heading>
            <Content>Try searching for something else.</Content>
        </IllustratedMessage>
    );
}
```

### Anatomy

#### Structure

```tsx
<IllustratedMessage>
    <Image /> /* (Required) The image of the illustrated message */
    <Heading /> /* (Optional) The heading of the illustrated message */
    <Content /> /* (Optional) The content of the illustrated message */
    <ButtonGroup> /* (Optional) The button group of the illustrated message */
        <Button />
    </ButtonGroup>
    <Button /> /* (Optional) The button of the illustrated message */
</IllustratedMessage>
```

#### Composed Components

A `IllustratedMessage` uses the following components:

| Component   | Description                                                                   |
| ----------- | ----------------------------------------------------------------------------- |
| Button      | A button allows a user to initiate an action.                                 |
| ButtonGroup | A button group handles the spacing and orientation for a grouping of buttons. |
| Content     | A placeholder for the main content section of a component.                    |
| Heading     | A heading is a primitive component matching Hopper's typography type scale.   |
| Image       | An image component that can be used to display images.                        |

### Usage

#### Sizes

An illustrated message can use different sizes.

```tsx
import { Content, Heading, IllustratedMessage, Image, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack gap="core_480" alignX="center">
            <IllustratedMessage size="sm">
                <Image src="/frog.jpg" alt="Frog" />
                <Heading>No results found</Heading>
                <Content>It seems like there’s nothing here for now. Hop on and add something new.</Content>
            </IllustratedMessage>
            <IllustratedMessage size="md">
                <Image src="/frog.jpg" alt="Frog" />
                <Heading>No results found</Heading>
                <Content>It seems like there’s nothing here for now. Hop on and add something new.</Content>
            </IllustratedMessage>
            <IllustratedMessage size="lg">
                <Image src="/frog.jpg" alt="Frog" />
                <Heading>No results found</Heading>
                <Content>It seems like there’s nothing here for now. Hop on and add something new.</Content>
            </IllustratedMessage>
        </Stack>

    );
}
```

#### Image

An illustrated message can handle images (jpg, png).

```tsx
import { Content, Heading, IllustratedMessage, Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <IllustratedMessage>
            <Image src="/frog.jpg" alt="No Results" />
            <Heading>No results found</Heading>
            <Content>It seems like there’s nothing here for now. Hop on and add something new!</Content>
        </IllustratedMessage>
    );
}
```

#### Buttons

An illustrated message can handle either a button

```tsx
import { Button, Content, Heading, IllustratedMessage, SvgImage } from "@hopper-ui/components";

import { NoResults } from "../assets/index.ts";

export default function Example() {
    return (
        <IllustratedMessage>
            <SvgImage stroke="neutral" src={NoResults} aria-label="No Results" />
            <Heading>No results found</Heading>
            <Content>Try searching for something else.</Content>
            <Button>Try again</Button>
        </IllustratedMessage>
    );
}
```

or a group of buttons

```tsx
import { Button, ButtonGroup, Content, Heading, IllustratedMessage, SvgImage } from "@hopper-ui/components";

import { NoResults } from "../assets/index.ts";

export default function Example() {
    return (
        <IllustratedMessage>
            <SvgImage stroke="neutral" src={NoResults} aria-label="No Results" />
            <Heading>No results found</Heading>
            <Content>Try searching for something else.</Content>
            <ButtonGroup>
                <Button variant="secondary">Back</Button>
                <Button>Try again</Button>
            </ButtonGroup>
        </IllustratedMessage>
    );
}
```

#### SVG

An illustrated message can handle svgs.

```tsx
import { Content, Heading, IllustratedMessage, SvgImage } from "@hopper-ui/components";

import { NoResults } from "../assets/index.ts";

export default function Example() {
    return (
        <IllustratedMessage>
            <SvgImage stroke="neutral" src={NoResults} aria-label="No Results" />
            <Heading>No results found</Heading>
            <Content>Try searching for something else.</Content>
        </IllustratedMessage>
    );
}
```

#### Layout Samples

To facilitate the migration process, we've provided layout samples as reference guides. These examples demonstrate how to recreate features previously supported in [Orbiter](https://wl-orbiter-website.netlify.app/?path=/docs/illustrated-message--docs).

##### Horizontal

```tsx
import { Content, Heading, Inline, Stack, SvgImage } from "@hopper-ui/components";

import { NoResults } from "../../assets/index.ts";

export default function Example() {
    return (
        <Inline alignY="center" gap="stack-lg">
            <SvgImage stroke="neutral" src={NoResults} aria-label="No Results" />
            <Stack gap="stack-sm">
                <Heading>No results found</Heading>
                <Content color="neutral-weak">Please try another search term.</Content>
            </Stack>
        </Inline>
    );
}
```

### Props

| Prop      | Type                     | Default | Description                                                                                              |
| --------- | ------------------------ | ------- | -------------------------------------------------------------------------------------------------------- |
| size      | `IllustratedMessageSize` | "md"    | The size of the IllustratedMessage.                                                                      |
| children  | `ReactNode`              |         | The children of the component.                                                                           |
| className | `string`                 |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| style     | `CSSProperties`          |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `orientation` has been removed. Refer to this [sample](#horizontal) to see an implementation example for a horizontal orientation.
* `width` and `height` prop will now affect the whole wrapper instead of just the image.

## Illustration

An illustration compose an image with a background color. Use an illustration as an hero in a modal.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/illustration/src/Illustration.tsx>

```tsx
import { Illustration, Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <Illustration backgroundColor="primary-weak" UNSAFE_height="12rem" padding="core_160">
            <Image alt="frog" src="/cute-frog.png" />
        </Illustration>
    );
}
```

### Anatomy

#### Structure

```tsx
<Illustration>
    <Image /> /* (Required) The image of the illustration */
</Illustration>
```

#### Composed Components

An `Illustration` uses the following components:

| Component | Description                                            |
| --------- | ------------------------------------------------------ |
| Image     | An image component that can be used to display images. |

### Usage

#### Default

An illustration renders horizontally by default.

```tsx
import { Illustration, Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <Illustration backgroundColor="primary-weak" UNSAFE_height="12rem" padding="core_160">
            <Image alt="frog" src="/cute-frog.png" />
        </Illustration>
    );
}
```

#### Vertical

An illustration can render vertically.

```tsx
import { Div, Illustration, Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_height="30rem">
            <Illustration backgroundColor="primary-weak" orientation="vertical" UNSAFE_width="12rem" padding="core_160">
                <Image alt="frog" src="/cute-frog.png" />
            </Illustration>
        </Div>
    );
}
```

### Shape

An illustration can have a rounded shape.

```tsx
import { Illustration, Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <Illustration backgroundColor="primary-weak" shape="rounded" UNSAFE_height="12rem">
            <Image alt="frog" src="/cute-frog.png" />
        </Illustration>
    );
}
```

### Props

| Prop        | Type                                         | Default      | Description                                                                                              |
| ----------- | -------------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| orientation | `ResponsiveProp<"horizontal" \| "vertical">` | "horizontal" | The orientation of the illustration.                                                                     |
| shape       | `"straight" \| "rounded"`                    | "straight"   | The illustration shape.                                                                                  |
| style       | `CSSProperties`                              |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children    | `ReactNode`                                  |              | The children of the component.                                                                           |
| className   | `string`                                     |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## Image

An image component that can be used to display images.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/image/src/Image.tsx>

```tsx
import { Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <Image src="/frog.jpg" alt="Frog" UNSAFE_width="300px" />
    );
}
```

### Usage

#### Shapes

An image can use a different shape.

```tsx
import { Image, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Image src="/frog.jpg" alt="Frog" UNSAFE_width="300px" shape="rounded" />
            <Image src="/frog.jpg" alt="Frog" UNSAFE_width="300px" shape="circular" />
        </Inline>
    );
}
```

#### Sizes

An image can vary in size.

```tsx
import { Image, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Image src="/frog.jpg" alt="Frog" UNSAFE_width="200px" height="auto" />
            <Image src="/frog.jpg" alt="Frog" UNSAFE_width="300px" height="auto" />
            <Image src="/frog.jpg" alt="Frog" UNSAFE_width="400px" height="auto" />
        </Inline>
    );
}
```

### Object fit

An image can have different object fits

```tsx
import { Div, Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_width="200px" UNSAFE_height="200px">
            <Image objectFit="cover" src="/frog.jpg" alt="Frog" />
        </Div>
    );
}
```

#### Retina

You can let the browser decide which image is best to serve according to the user device screen pixel density.

It is highly recommended to serve a 1x image as well as a 2x image, twice the intended size. This assures the user has the best looking image possible.

Avoid serving images that are unecessary big, images should be resized to the intended final image display size. This assures we don't waste bandwith for the user.

```tsx
import { Image } from "@hopper-ui/components";

export default function Example() {
    return (
        <Image srcSet="/frog.jpg 1x, /frog2x.jpg 2x" alt="Frog" UNSAFE_width="300px" />
    );
}
```

### SvgImage

For some use cases, like dark mode support, an SVG image is a better fit than a standard PNG or JPG image.

```tsx
import { SvgImage } from "@hopper-ui/components";

import { NoResults } from "../assets/index.ts";

export default function Example() {
    return (
        <SvgImage stroke="neutral" src={NoResults} aria-label="No Results" />
    );
}
```

#### Size

An SVG image size can be specified with the `width` and `height` props.

```tsx
import { SvgImage } from "@hopper-ui/components";

import { NoResults } from "../assets/index.ts";

export default function Example() {
    return (
        <SvgImage stroke="neutral" src={NoResults} aria-label="No Results" UNSAFE_width="200px" UNSAFE_height="200px" />
    );
}
```

#### Color

An SVG image `stroke` and `fill` color can vary.

```tsx
import { SvgImage } from "@hopper-ui/components";

import { NoResults } from "../assets/index.ts";

export default function Example() {
    return (
        <SvgImage
            aria-label="No results"
            fill="core_sunken-treasure-100"
            src={NoResults}
            stroke="core_sapphire-600"
        />
    );
}
```

### Props

#### Image

| Prop      | Type                                    | Default | Description                                                                                              |
| --------- | --------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| shape     | `"straight" \| "rounded" \| "circular"` |         | The image shape.                                                                                         |
| src       | `ResponsiveProp<string>`                |         | An image path.                                                                                           |
| className | `string`                                |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| style     | `CSSProperties`                         |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

#### SvgImage

| Prop      | Type                          | Default | Description                                                                                              |
| --------- | ----------------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| src       | `ResponsiveProp<ElementType>` |         | An SVG as a component.                                                                                   |
| className | `string`                      |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| style     | `CSSProperties`               |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

## Img

A specialized component to represent an HTML img element.

```tsx
import { Img } from "@hopper-ui/components";

export default function Example() {
    return (
        <Img border="core_rock-400" src="/frog.jpg" />
    );
}
```

### Usage

An img component accepts all the [img HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Inline

An inline component is a layout primitive used to arrange elements horizontally.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/layout/src/Inline.tsx>

```tsx
import { Inline, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_320">
            <Inline>
                <Square backgroundColor="decorative-option1" />
                <Square height="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Inline>
        </Div>
    );
}
```

### Usage

#### Reverse

The order and direction of inline items can be reversed.

```tsx
import { Inline, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_320">
            <Inline reverse>
                <Square backgroundColor="decorative-option1" />
                <Square height="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Inline>
        </Div>
    );
}
```

#### Align X

Inline items can be aligned on the horizontal axis.

```tsx
import { Inline, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_320">
            <Inline alignX="center">
                <Square backgroundColor="decorative-option1" />
                <Square height="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Inline>
        </Div>
    );
}
```

#### Align Y

Inline items can be aligned on the vertical axis.

```tsx
import { Inline, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Inline alignY="flex-end" UNSAFE_height="10rem">
                <Square backgroundColor="decorative-option1" />
                <Square height="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Inline>
        </Div>
    );
}
```

### Best Practices

Inline is a specialized layout component for arranging items horizontally with consistent spacing and vertical alignment. It's a preset of `Flex` with `direction="row"` and `alignItems="center"`, designed for common horizontal layouts like button groups, icon-label pairs, and navigation items.

Inline should:

* Be used for simple horizontal layouts where items should be vertically centered.
* Use [Hopper space tokens](/tokens/semantic/space.md) for the `gap` property to ensure consistency.
* Be the default choice for horizontal layouts unless you need custom alignment or other flex properties.
* Keep layouts simple and semantic without unnecessary wrapper elements.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Button, Inline, Text } from "@hopper-ui/components";
  import { SparklesIcon } from "@hopper-ui/icons";

  export function Example() {
      return (
          <Inline gap="inline-sm">
              <SparklesIcon />
              <Text>AI Assist</Text>
              <Button variant="primary" size="sm">Try it</Button>
          </Inline>
      );
  }
  ```

  Use Inline for simple horizontal layouts with centered items

* 🚫 Don't:

  ```tsx
  import { Button, Flex, Text } from "@hopper-ui/components";
  import { SparklesIcon } from "@hopper-ui/icons";

  export function Example() {
      return (
          <Flex direction="row" alignItems="center" gap="inline-sm">
              <SparklesIcon />
              <Text>AI Assist</Text>
              <Button variant="primary" size="sm">Try it</Button>
          </Flex>
      );
  }
  ```

  Use Flex with direction='row' and alignItems='center' when Inline is sufficient

**Rule 2**

* ✅ Do:

  Use \`alignY\` to adjust vertical alignment of items

* 🚫 Don't:

  Use \`alignItems\` which is not supported by \`Inline\`

**Rule 3**

* ✅ Do:

  Use \`alignX\` to adjust horizontal alignment of items

* 🚫 Don't:

  Use \`justifyContent\` which is not supported by \`Inline\`

### Props

| Prop      | Type                                                  | Default | Description                                                      |
| --------- | ----------------------------------------------------- | ------- | ---------------------------------------------------------------- |
| reverse   | `boolean`                                             |         | Whether or not to reverse the order of the elements.             |
| alignX    | `ResponsiveProp<JustifyContent>`                      |         | An alias for the css justify-content property.                   |
| alignY    | `ResponsiveProp<AlignItems>`                          |         | An alias for the css align-items property.                       |
| style     | `CSSProperties`                                       |         |                                                                  |
| className | `string`                                              |         |                                                                  |
| wrap      | `ResponsiveProp<FlexWrap> \| ResponsiveProp<boolean>` |         | Whether to wrap the flex items. The value can also be a boolean. |
| basis     | `ResponsiveProp<FlexBasis<0 \| (string & {})>>`       |         | An alias for the css flex-basis property.                        |
| grow      | `ResponsiveProp<FlexGrow>`                            |         | An alias for the css flex-grow property.                         |
| shrink    | `ResponsiveProp<FlexShrink>`                          |         | An alias for the css flex-shrink property.                       |
| inline    | `boolean`                                             |         | Whether to display the flex container as an inline element.      |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

### Migration Notes

Coming from Orbiter, you should be aware of the following change:

* The default `gap` value has been reduced to `1rem` / `var(--hop-space-inline-md)` from `1.25rem`. Use `UNSAFE_gap="1.25rem"` as a temporary measure during the migration to the Hopper design system. This value should eventually be removed to align with the new design standards.

## Label

A label is a primitive component matching Hopper's typography type scale.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/typography/label/src/Label.tsx>

```tsx
import { Label } from "@hopper-ui/components";

export default function Example() {
    return (
        <Label>Software built for everyone to do their best work</Label>
    );
}
```

### Usage

#### Color

The label component has a default color, but it can be easily overridden.

```tsx
import { Label } from "@hopper-ui/components";

export default function Example() {
    return (
        <Label color="decorative-option3">Software built for everyone to do their best work</Label>
    );
}
```

#### Required

The label component can be marked as required. You can customize the necessity indicator by using an asterisk.

```tsx
import { FieldLabel } from "@hopper-ui/components";

export default function Example() {
    return (
        <FieldLabel isRequired necessityIndicator="asterisk">Username</FieldLabel>
    );
}
```

#### Optional

The label component can show the optional necessity indicator as a label.

```tsx
import { FieldLabel } from "@hopper-ui/components";

export default function Example() {
    return (
        <FieldLabel necessityIndicator="label">Username</FieldLabel>
    );
}
```

### Props

| Prop        | Type            | Default | Description |
| ----------- | --------------- | ------- | ----------- |
| style       | `CSSProperties` |         |             |
| elementType | `string`        |         |             |
| className   | `string`        |         |             |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

## Link

A link allows a user to navigate to a different location.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/link/src/Link.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/link/>

Links are used as navigational elements and can be used on their own or inline with text. They provide a lightweight option for navigation but like other interactive elements, too many links will clutter a page and make it difficult for users to identify their next steps. This is especially true for inline links, which should be used sparingly.

```tsx
import { Link } from "@hopper-ui/components";

export default function Example() {
    return (
        <Link href="#">Learn more</Link>
    );
}
```

### Anatomy

#### Structure

```tsx
<Link>
    <Icon /> /* (Optional) An icon in the link */
    <Text /> /* (Optional) The text content of the link */
</Link>
```

#### Composed Components

A `Link` uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### Disabled

Links can be disabled.

```tsx
import { Inline, Link } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Link isDisabled variant="primary" href="#">Learn more</Link>
            <Link isDisabled variant="secondary" href="#">Learn more</Link>
        </Inline>
    );
}
```

#### External

An external text link will render by default with `rel="noopener noreferrer"` and `target="_blank"` attributes.

```tsx
import { Link, Text } from "@hopper-ui/components";
import { NewTabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Link href="#" isExternal alignItems="end">
            <Text>Learn more</Text>
            <NewTabIcon size="sm" />
        </Link>
    );
}
```

#### No Href

When a `<Link>` does not have an href prop, it is rendered as a `<span role="link">` instead of an `<a>`. Events will need to be handled in JavaScript with the `onPress` prop.

Note: this will not behave like a native link. Browser features like context menus and open in a new tab will not apply.

```tsx
import { Link } from "@hopper-ui/components";

export default function Example() {
    return (
        <Link
            onPress={() => {
                window.alert("You clicked the link!");
            }}
        >
            Learn more
        </Link>
    );
}
```

#### Variants

Links can be presented in different variants.

```tsx
import { Inline, Link } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Link variant="primary" href="#">Learn more</Link>
            <Link variant="secondary" href="#">Learn more</Link>
        </Inline>
    );
}
```

#### Sizes

Links can be presented in different sizes.

```tsx
import { Link, Stack, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack padding="inset-xl">
            <Text size="xs">
                Would you like to <Link size="inherit" href="#">learn more</Link> about this role?
            </Text>
            <Link size="xs" href="#">learn more</Link>
            <Link size="sm" href="#">learn more</Link>
            <Link size="md" href="#">learn more</Link>
            <Link size="lg" href="#">learn more</Link>
            <Link size="xl" href="#">learn more</Link>
            <Link size="2xl" href="#">learn more</Link>
        </Stack>
    );
}
```

#### Inherit Size

The size can also be inherited.

```tsx
import { Link, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Text size="lg">
            Would you like to <Link href="#">learn more</Link> about this role?
        </Text>
    );
}
```

#### Icon

Links can contain an icon.

```tsx
import { Inline, Link, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Link variant="primary" href="#">
                <Text>Learn more</Text>
                <SparklesIcon />
            </Link>
            <Link variant="secondary" href="#">
                <Text>Learn more</Text>
                <SparklesIcon />
            </Link>
        </Inline>
    );
}
```

#### Start Icon

**Non standard** start icons can be provided to handle special cases. However, think twice before adding start icons, end icons should be your go to.

```tsx
import { Inline, Link, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Link variant="primary" href="#">
                <SparklesIcon slot="start-icon" />
                <Text>Learn more</Text>
            </Link>
            <Link variant="secondary" href="#">
                <SparklesIcon slot="start-icon" />
                <Text>Learn more</Text>
            </Link>
        </Inline>
    );
}
```

#### Icon Only

A link's content can be a single icon. When using this variant, an accessible name must be provided through the `aria-label` prop. See [WCAG practices](https://www.w3.org/TR/WCAG20-TECHS/ARIA6.html).

```tsx
import { Link, Inline } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Link aria-label="Clean" variant="primary" href="#">
                <SparklesIcon />
            </Link>
            <Link aria-label="Clean" variant="secondary" href="#">
                <SparklesIcon />
            </Link>
        </Inline>
    );
}
```

#### Quiet

All links can have a quiet style, without an underline. This style should only be used when the placement and context of the link is explicit enough that a visible underline isn't necessary.

```tsx
import { Link, Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <Paragraph>
            Would you like to <Link isQuiet href="#">learn more</Link> about this role?
        </Paragraph>
    );
}
```

#### Standalone

All links can have a standalone style, without an underline which is similar to quiet, the difference is this adds block padding to make it more similar to a button.

```tsx
import { Card, Link, Text } from "@hopper-ui/components";
import { Heading } from "react-aria-components";

export default function Example() {
    return (
        <Card padding="core_240" UNSAFE_width="300px">
            <Heading>
                Card component
            </Heading>
            <Text>
                This card component can include a link which is standalone
            </Text>
            <Link isStandalone href="#">Learn more</Link>
        </Card>
    );
}
```

#### React Router Link

A button can be rendered as a react router link when using the `href` property and setting the navigate property on the `HopperProvider`

```tsx
import { Link, HopperProvider } from "@hopper-ui/components";
import { createMemoryRouter, RouterProvider, useNavigate } from "react-router-dom";

export default function App() {
    const router = createMemoryRouter([{
        path: "/123",
        element: <>Navigated Successfully! <Example /></>
    }, {
        path: "*",
        element: <Example />
    }
    ]);

    return (
        <RouterProvider router={router} />
    );
}

function Example() {
    const navigate = useNavigate();

    return (
        <HopperProvider colorScheme="light" navigate={navigate}>
            <Link href="/123">Go to next router page</Link>
        </HopperProvider>

    );
}
```

#### Custom Styles

When the colors from the variant props are not enough, you can use the `color` prop to set the color of the link. This removes the hover and focus colors from the link. Use the color props when a link needs to be placed on top of a colored background or visual. Make sure that the background and the link color meet the minimum color contrast ratio.

```tsx
import { Link, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div width="80%" padding="inset-md" backgroundColor="decorative-option3">
            <Link
                color="decorative-option3"
                colorHover="decorative-option3-weak"
                colorFocus="decorative-option3-weak"
                href="#"
            >
                Learn more
            </Link>
        </Div>
    );
}
```

#### Image

A link's content can be an image element.

```tsx
import { Image, Link } from "@hopper-ui/components";

export default function Example() {
    return (
        <Link href="#" borderRadius="rounded-md" overflow="hidden">
            <Image UNSAFE_width="150px" src="/frog.jpg" alt="Kermit Frog" />
        </Link>
    );
}
```

### Best Practices

Links are used primarily for navigation, and usually appear within or directly following a sentence. Buttons are used primarily for actions. Differentiating between the two both in the design and code result in:

* A more inclusive experience for assistive technology users.
* A more cohesive visual experience for sighted users.
* Products that are easier to maintain at scale.

#### Open new tabs only when necessary

Use links whenever possible to avoid disorienting users and causing accessibility problems by opening a new tab. When using an external link, always use the NewTab icon beside the link's label. External links should be used when users are:

* Performing a task or workflow.
* Navigating to a page outside of the Workleap platform.

Use links when you want users to:

* Navigate to a different page within the application
* Navigation to an entirely different site
* Jump to an element on the same page
* Link to emails or phone numbers

Use a button instead of a link for actions that will change data or manipulate how it is displayed, change a state, or trigger an action. Buttons should never be used for navigational actions.

### Props

| Prop           | Type                                   | Default   | Description                                                                                                                                                                        |
| -------------- | -------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| variant        | `LinkVariant`                          | "primary" | The visual style of the link.                                                                                                                                                      |
| size           | `ResponsiveProp<LinkSize>`             | "inherit" | Size of the link.                                                                                                                                                                  |
| isQuiet        | `boolean`                              |           | Whether the link should be displayed with a quiet style.                                                                                                                           |
| isExternal     | `boolean`                              |           | Whether the link should open in a new tab.                                                                                                                                         |
| isStandalone   | `boolean`                              |           | Wheter the link is standalone                                                                                                                                                      |
| style          | `StyleOrFunction<LinkRenderProps>`     |           | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| isDisabled     | `boolean`                              |           | Whether the link is disabled.                                                                                                                                                      |
| autoFocus      | `boolean`                              |           | Whether the element should receive focus on render.                                                                                                                                |
| href           | `string`                               |           | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                     |
| hrefLang       | `string`                               |           | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                     |
| target         | `HTMLAttributeAnchorTarget`            |           | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                     |
| rel            | `string`                               |           | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                    |
| download       | `string \| boolean`                    |           | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).   |
| ping           | `string`                               |           | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                     |
| referrerPolicy | `HTMLAttributeReferrerPolicy`          |           | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                   |
| routerOptions  | `undefined`                            |           | Options for the configured client side router.                                                                                                                                     |
| dir            | `string`                               |           |                                                                                                                                                                                    |
| lang           | `string`                               |           |                                                                                                                                                                                    |
| inert          | `boolean`                              |           |                                                                                                                                                                                    |
| translate      | `"yes" \| "no"`                        |           |                                                                                                                                                                                    |
| children       | `ChildrenOrFunction<LinkRenderProps>`  |           | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className      | `ClassNameOrFunction<LinkRenderProps>` |           | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `Link`, `IconLink` and `TextLink` have all been merged into one.
* `LinkAsButton` has been removed. It is now possible to use the `Link` component without an `href` attribute.

## LinkButton

A LinkButton looks like a button but behaves like a link.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/buttons/src/LinkButton.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/link/>

```tsx
import { LinkButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <LinkButton href="https://www.google.com">Support</LinkButton>
    );
}
```

### Anatomy

#### Concepts

*LinkButton* makes use of the following concepts:

* [Client Side Routing](./client-side-routing.md)

#### Structure

```tsx
<LinkButton>
    <IconList /> /* (Optional) A list of icons in the LinkButton */
    <Icon /> /* (Optional) An icon in the LinkButton */
    <Text /> /* (Optional) Text in the LinkButton, required if using an Icon or an IconList */
</LinkButton>
```

#### Composed Components

A *LinkButton* uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| IconList  | An IconList encapsulates a collection of icons.                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### Variants

A link button can use different variants.

```tsx
import { Inline, LinkButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <LinkButton href="https://www.google.com" variant="primary">Help</LinkButton>
            <LinkButton href="https://www.google.com" variant="secondary">Help</LinkButton>
            <LinkButton href="https://www.google.com" variant="upsell">Help</LinkButton>
            <LinkButton href="https://www.google.com" variant="danger">Help</LinkButton>
            <LinkButton href="https://www.google.com" variant="ghost-primary">Help</LinkButton>
            <LinkButton href="https://www.google.com" variant="ghost-secondary">Help</LinkButton>
            <LinkButton href="https://www.google.com" variant="ghost-danger">Help</LinkButton>
        </Inline>
    );
}
```

**Primary** - For the principal call to action on the page. Primary buttons should only appear once per screen — not including the application header, modal or side panel.

**Secondary** - For secondary actions on each page. Secondary buttons can be used in conjunction with a primary link button or on its own. Paired with a Primary link button, the secondary link button usually performs the negative action of the set, such as “Cancel.”

**Upsell** - For upsell actions that relate to upgrading an account or a plan. Use the upsell link button to distinguish it from an existing primary link button. In some cases, a primary link button can be used instead when the general context of the page is about upselling.

**Danger** - For actions that could have destructive effects on the user's data.

**Ghost-\[primary|secondary|danger]** - For less prominent, and sometimes independent, actions. Ghost buttons can be used in isolation or paired with a primary link button when there are multiple calls to action. Ghost buttons can also be used for subtasks on a page where a primary link button for the main and final action is present.

#### Sizes

A link button can vary in size.

```tsx
import { Inline, LinkButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <LinkButton href="https://www.google.com" size="md" variant="primary">Help</LinkButton>
            <LinkButton href="https://www.google.com" size="sm" variant="primary">Help</LinkButton>
            <LinkButton href="https://www.google.com" size="xs" variant="primary">Help</LinkButton>
        </Inline>
    );
}
```

#### Disabled

A link button can be disabled.

```tsx
import { Inline, LinkButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <LinkButton href="https://www.google.com" isDisabled variant="primary">Help</LinkButton>
            <LinkButton href="https://www.google.com" isDisabled variant="ghost-primary">Help</LinkButton>
        </Inline>
    );
}
```

#### External

Add isExternal attributes to render an external link button.

```tsx
import { LinkButton, Text } from "@hopper-ui/components";
import { NewTabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <LinkButton href="https://www.google.com" isExternal>
            <Text>Learn more</Text>
            <NewTabIcon />
        </LinkButton>
    );
}
```

#### No Href

When a link button link does not have an href prop, it is rendered as a `<span role="link">` instead of an `<a>`. Events will need to be handled in JavaScript with the `onPress` prop.

Note: this will not behave like a native link. Browser features like context menus and open in a new tab will not apply.

```tsx
import { LinkButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <LinkButton
            onPress={() => {
                window.alert("You clicked the link button!");
            }}
        >
            Learn more
        </LinkButton>
    );
}
```

#### Fluid

A link button can be expanded to full width to fill its parent container.

```tsx
import { Inline, LinkButton, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <LinkButton href="https://www.google.com" isFluid variant="primary">
                Help
            </LinkButton>
            <LinkButton href="https://www.google.com" isFluid variant="primary">
                <SparklesIcon />
                <Text>Help</Text>
            </LinkButton>
            <LinkButton href="https://www.google.com" isFluid>
                <Text>Help</Text>
                <SparklesIcon slot="end-icon" />
            </LinkButton>
        </Inline>
    );
}
```

#### Icon Only

A link button can contain only an icon.

```tsx
import { Inline, LinkButton } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <LinkButton href="https://www.google.com" aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </LinkButton>
            <LinkButton href="https://www.google.com" size="sm" aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </LinkButton>
            <LinkButton href="https://www.google.com" size="xs" aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </LinkButton>
        </Inline>
    );
}
```

#### Router Link

A link button can be used with any Router. For more information, see the [Client Side Routing](./client-side-routing.md) article.

```tsx
import { HopperProvider, LinkButton, Text } from "@hopper-ui/components";
import { createMemoryRouter, RouterProvider, useNavigate } from "react-router-dom";

export default function App() {
    const router = createMemoryRouter([{
        path: "/123",
        element: (
            <Text>
                Navigated Successfully!
            </Text>
        )
    }, {
        path: "*",
        element: <Example />
    }
    ]);

    return (
        <RouterProvider router={router} />
    );
}

function Example() {
    const navigate = useNavigate();

    return (
        // Set up the HopperProvider at the root of your app.
        <HopperProvider colorScheme="light" navigate={navigate}>
            <LinkButton href="/123">Go to next router page</LinkButton>
        </HopperProvider>

    );
}
```

#### Icon

A link button can contain icons.

```tsx
import { Inline, LinkButton, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <LinkButton href="https://www.google.com" variant="secondary">
                <SparklesIcon />
                <Text>Help</Text>
            </LinkButton>
            <LinkButton href="https://www.google.com" size="sm" variant="secondary">
                <SparklesIcon />
                <Text>Help</Text>
            </LinkButton>
            <LinkButton href="https://www.google.com" size="xs" variant="secondary">
                <SparklesIcon />
                <Text>Help</Text>
            </LinkButton>
        </Inline>
    );
}
```

#### End Icon

Nonstandard end icons can be provided to handle special cases. However, think twice before adding end icons, start icons should be your go-to.

```tsx
import { Inline, LinkButton, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <LinkButton href="https://www.google.com" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Help</Text>
            </LinkButton>
            <LinkButton href="https://www.google.com" size="sm" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Help</Text>
            </LinkButton>
            <LinkButton href="https://www.google.com" size="xs" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Help</Text>
            </LinkButton>
        </Inline>
    );
}
```

### Props

| Prop           | Type                                   | Default   | Description                                                                                                                                                                        |
| -------------- | -------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| variant        | `ButtonVariant`                        | "primary" | The visual style of the button.                                                                                                                                                    |
| size           | `ResponsiveProp<ButtonSize>`           | "md"      | A button can vary in size.                                                                                                                                                         |
| isFluid        | `ResponsiveProp<boolean>`              |           | Whether or not the button takes up the width of its container.                                                                                                                     |
| isExternal     | `boolean`                              |           | Whether the button should open in a new tab.                                                                                                                                       |
| style          | `StyleOrFunction<LinkRenderProps>`     |           | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| isDisabled     | `boolean`                              |           | Whether the link is disabled.                                                                                                                                                      |
| autoFocus      | `boolean`                              |           | Whether the element should receive focus on render.                                                                                                                                |
| href           | `string`                               |           | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                     |
| hrefLang       | `string`                               |           | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                     |
| target         | `HTMLAttributeAnchorTarget`            |           | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                     |
| rel            | `string`                               |           | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                    |
| download       | `string \| boolean`                    |           | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).   |
| ping           | `string`                               |           | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                     |
| referrerPolicy | `HTMLAttributeReferrerPolicy`          |           | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                   |
| routerOptions  | `undefined`                            |           | Options for the configured client side router.                                                                                                                                     |
| dir            | `string`                               |           |                                                                                                                                                                                    |
| lang           | `string`                               |           |                                                                                                                                                                                    |
| inert          | `boolean`                              |           |                                                                                                                                                                                    |
| translate      | `"yes" \| "no"`                        |           |                                                                                                                                                                                    |
| children       | `ChildrenOrFunction<LinkRenderProps>`  |           | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className      | `ClassNameOrFunction<LinkRenderProps>` |           | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `onClick` has been renamed to `onPress` to be closer to the [React Aria API](https://react-spectrum.adobe.com/react-aria/Button.html#events).
* `Counter` is no longer allowed as a specialized slot.
* `ButtonAsLink` is renamed to `LinkButton`.

## ListBox

A listbox is a list of interactive options that appears when users interact with an element or perform a specific action.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/list-box/src/ListBox.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/listbox/>

A listbox is a disclosure component that appear with a set of actions relevant to a specific control, interface area, data element or application view. Typically, this context is determined by the user's current selection prior to invoking the menu. Listbox can be opened from components such as Selects or Buttons.

```tsx
import { ListBox, ListBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox aria-label="list of options">
            <ListBoxItem>Developer</ListBoxItem>
            <ListBoxItem>Designer</ListBoxItem>
            <ListBoxItem>Manager</ListBoxItem>
        </ListBox>
    );
}
```

### Props

#### ListBox

| Prop                    | Type                                         | Default          | Description                                                                                                                                                                                                                                                                                                     |
| ----------------------- | -------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isFluid                 | `ResponsiveProp<boolean>`                    |                  | Whether or not the ListBox is 100% of its container's width.                                                                                                                                                                                                                                                    |
| isInvalid               | `boolean`                                    |                  | Whether or not the ListBox is in an invalid state.                                                                                                                                                                                                                                                              |
| isLoading               | `boolean`                                    |                  | Whether data is currently being loaded.                                                                                                                                                                                                                                                                         |
| selectionIndicator      | `SelectionIndicator`                         | "check"          | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be either a radio or checkbox based on the selection mode.                                                                                                                |
| size                    | `ResponsiveProp<ListBoxItemSize>`            | "sm"             | A ListBox can vary in size.                                                                                                                                                                                                                                                                                     |
| loadingListBoxItemProps | `ListBoxItemProps<T>`                        |                  | The props of the ListBoxItem.                                                                                                                                                                                                                                                                                   |
| style                   | `StyleOrFunction<ListBoxRenderProps>`        |                  | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                                                                               |
| children                | `ReactNode \| ((item: T) => ReactNode)`      |                  | The contents of the collection.                                                                                                                                                                                                                                                                                 |
| selectionBehavior       | `SelectionBehavior`                          | "toggle"         | How multiple selection should behave in the collection.                                                                                                                                                                                                                                                         |
| shouldSelectOnPressUp   | `boolean`                                    |                  | Whether selection should occur on press up instead of press down.                                                                                                                                                                                                                                               |
| shouldFocusOnHover      | `boolean`                                    |                  | Whether options should be focused when the user hovers over them.                                                                                                                                                                                                                                               |
| escapeKeyBehavior       | `"clearSelection" \| "none"`                 | 'clearSelection' | Whether pressing the escape key should clear selection in the listbox or not.Most experiences should not modify this option as it eliminates a keyboard user's ability to easily clear selection. Only use if the escape key is being handled externally or should not trigger selection clearing contextually. |
| autoFocus               | `boolean \| FocusStrategy`                   |                  | Whether to auto focus the listbox or an option.                                                                                                                                                                                                                                                                 |
| shouldFocusWrap         | `boolean`                                    |                  | Whether focus should wrap around when the end/start is reached.                                                                                                                                                                                                                                                 |
| items                   | `Iterable<T>`                                |                  | Item objects in the collection.                                                                                                                                                                                                                                                                                 |
| disabledKeys            | `Iterable<Key>`                              |                  | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.                                                                                                                                                                                                         |
| selectionMode           | `SelectionMode`                              |                  | The type of selection that is allowed in the collection.                                                                                                                                                                                                                                                        |
| disallowEmptySelection  | `boolean`                                    |                  | Whether the collection allows empty selection.                                                                                                                                                                                                                                                                  |
| selectedKeys            | `Iterable<Key> \| "all"`                     |                  | The currently selected keys in the collection (controlled).                                                                                                                                                                                                                                                     |
| defaultSelectedKeys     | `Iterable<Key> \| "all"`                     |                  | The initial selected keys in the collection (uncontrolled).                                                                                                                                                                                                                                                     |
| dragAndDropHooks        | `DragAndDropHooks<NoInfer<T>>`               |                  | The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox.                                                                                                                                                                                                     |
| renderEmptyState        | `((props: ListBoxRenderProps) => ReactNode)` |                  | Provides content to display when there are no items in the list.                                                                                                                                                                                                                                                |
| layout                  | `"grid" \| "stack"`                          | 'stack'          | Whether the items are arranged in a stack or grid.                                                                                                                                                                                                                                                              |
| orientation             | `Orientation`                                | 'vertical'       | The primary orientation of the items. Usually this is the direction that the collection scrolls.                                                                                                                                                                                                                |
| dependencies            | `readonly any[]`                             |                  | Values that should invalidate the item cache when using dynamic collections.                                                                                                                                                                                                                                    |
| className               | `ClassNameOrFunction<ListBoxRenderProps>`    |                  | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                                                                                              |
| dir                     | `string`                                     |                  |                                                                                                                                                                                                                                                                                                                 |
| lang                    | `string`                                     |                  |                                                                                                                                                                                                                                                                                                                 |
| inert                   | `boolean`                                    |                  |                                                                                                                                                                                                                                                                                                                 |
| translate               | `"yes" \| "no"`                              |                  |                                                                                                                                                                                                                                                                                                                 |

##### Events

| Prop                        | Type                                          | Default | Description                                                                                                                                                               |
| --------------------------- | --------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onLoadMore                  | `(() => void)`                                |         | Handler that is called when more items should be loaded, e.g. while scrolling near the bottom.                                                                            |
| onAction                    | `((key: Key) => void)`                        |         | Handler that is called when a user performs an action on an item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality. |
| onSelectionChange           | `((keys: Selection) => void)`                 |         | Handler that is called when the selection changes.                                                                                                                        |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element receives focus.                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element loses focus.                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`              |         | Handler that is called when the element's focus status changes.                                                                                                           |
| onClick                     | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`              |         |                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`              |         |                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                           |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

#### ListBoxSection

| Prop         | Type                                                                                  | Default | Description                                                                                               |
| ------------ | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| style        | `CSSProperties`                                                                       |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.   |
| children     | `ReactNode \| ((item: T) => ReactElement<any, string \| JSXElementConstructor<any>>)` |         | Static child items or a function to render children.                                                      |
| items        | `Iterable<T>`                                                                         |         | Item objects in the section.                                                                              |
| id           | `Key`                                                                                 |         | The unique id of the section.                                                                             |
| value        | `object`                                                                              |         | The object value that this section represents. When using dynamic collections, this is set automatically. |
| dependencies | `readonly any[]`                                                                      |         | Values that should invalidate the item cache when using dynamic collections.                              |
| className    | `string`                                                                              |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.  |
| dir          | `string`                                                                              |         |                                                                                                           |
| lang         | `string`                                                                              |         |                                                                                                           |
| inert        | `boolean`                                                                             |         |                                                                                                           |
| translate    | `"yes" \| "no"`                                                                       |         |                                                                                                           |

##### Events

| Prop                        | Type                                  | Default | Description |
| --------------------------- | ------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |             |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                             |
| ---------- | -------- | ------- | --------------------------------------- |
| aria-label | `string` |         | An accessibility label for the section. |

#### ListBoxItem

| Prop               | Type                                          | Default | Description                                                                                                                                                                                         |
| ------------------ | --------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isLoading          | `boolean`                                     |         | Whether the item is loading.                                                                                                                                                                        |
| size               | `ResponsiveProp<ListBoxItemSize>`             | "sm"    | A ListBoxItem can vary in size.                                                                                                                                                                     |
| isInvalid          | `boolean`                                     |         | Whether or not the ListBoxItem is in an invalid state.                                                                                                                                              |
| selectionIndicator | `SelectionIndicator`                          | "check" | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be an either a radio or checkbox based on the selection mode. |
| radioProps         | `DecorativeRadioProps`                        |         | The props for the Radio.                                                                                                                                                                            |
| checkboxProps      | `DecorativeCheckboxProps`                     |         | The props for the Checkbox.                                                                                                                                                                         |
| style              | `StyleOrFunction<ListBoxItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                   |
| dir                | `string`                                      |         |                                                                                                                                                                                                     |
| lang               | `string`                                      |         |                                                                                                                                                                                                     |
| inert              | `boolean`                                     |         |                                                                                                                                                                                                     |
| translate          | `"yes" \| "no"`                               |         |                                                                                                                                                                                                     |
| id                 | `Key`                                         |         | The unique id of the item.                                                                                                                                                                          |
| value              | `object`                                      |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                                              |
| textValue          | `string`                                      |         | A string representation of the item's contents, used for features like typeahead.                                                                                                                   |
| isDisabled         | `boolean`                                     |         | Whether the item is disabled.                                                                                                                                                                       |
| children           | `ChildrenOrFunction<ListBoxItemRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                           |
| className          | `ClassNameOrFunction<ListBoxItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                  |
| href               | `string`                                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                      |
| hrefLang           | `string`                                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                      |
| target             | `HTMLAttributeAnchorTarget`                   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                      |
| rel                | `string`                                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                     |
| download           | `string \| boolean`                           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                    |
| ping               | `string`                                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                      |
| referrerPolicy     | `HTMLAttributeReferrerPolicy`                 |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                    |
| routerOptions      | `undefined`                                   |         | Options for the configured client side router.                                                                                                                                                      |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

### Anatomy

#### Structure

```tsx
<ListBox>
    <Divider /> /* (Optional) A divider in the ListBox */
    <ListBoxItem> /* (Optional) An item in the ListBox */
        <Avatar /> /* (Optional) An avatar in the ListBoxItem */
        <Text /> /* (Optional) Text is optional, but becomes required if any other elements are present */
        <Text slot="description" /> /* (Optional) A description in the ListBoxItem */
        <Icon /> /* (Optional) An icon in the ListBoxItem */
        <IconList /> /* (Optional) A list of icons in the ListBoxItem */
        <Badge /> /* (Optional) A badge in the ListBoxItem */
    </ListBoxItem>
    <ListBoxSection> /* (Optional) A section in the ListBox */
        <Header /> /* (Optional) A header in the ListBoxSection */
        <ListBoxItem /> /* (Optional) An item in the ListBoxSection */
    </ListBoxSection>
</ListBox>
```

#### Composed Components

A `ListBox` uses the following components:

| Component | Description                                                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Avatar    | Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available. |
| Badge     | A badge is used to bring attention to an element.                                                                                                  |
| Divider   | A divider separates sections of content or groups.                                                                                                 |
| Header    | A placeholder for an header section.                                                                                                               |
| Icon      | An icon component is used to render a custom icon.                                                                                                 |
| Text      | A text component is a primitive component matching Hopper's typography type scale.                                                                 |

### Usage

#### Empty state

A list box can have an empty state.

```tsx
import { ListBox } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox aria-label="list of options" renderEmptyState={() => "No results found."}>
            {[]}
        </ListBox>
    );
}
```

#### Disabled

A list box with a disabled item.

```tsx
import { ListBox, ListBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox
            selectionMode="single"
            disabledKeys={["2"]}
            aria-label="list of options"
        >
            <ListBoxItem id="1">Developer</ListBoxItem>
            <ListBoxItem id="2">Designer</ListBoxItem>
            <ListBoxItem id="3">Manager</ListBoxItem>
        </ListBox>
    );
}
```

#### Invalid

A list box that is invalid.

```tsx
import { ListBox, ListBoxItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox
            isInvalid
            selectionMode="multiple"
            disabledKeys={["2"]}
            aria-label="list of options with a description"
        >
            <ListBoxItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Builds, tests, and maintains software.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Creates visually appealing, functional solutions.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Responsible for leading and overseeing a team or department to ensure organizational goals are met.</Text>
            </ListBoxItem>
        </ListBox>
    );
}
```

#### Fluid

A fluid list box will take up the full width of its container.

```tsx
import { ListBox, ListBoxItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox isFluid aria-label="list of options with a description">
            <ListBoxItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Builds, tests, and maintains software.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Creates visually appealing, functional solutions.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Responsible for leading and overseeing a team or department to ensure organizational goals are met.</Text>
            </ListBoxItem>
        </ListBox>
    );
}
```

#### Section

A list box can have sections and section headers.

```tsx
import { Header, ListBox, ListBoxItem, ListBoxSection } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox selectionMode="single" aria-label="list of options">
            <ListBoxItem>Developer</ListBoxItem>
            <ListBoxItem>Manager</ListBoxItem>
            <ListBoxSection>
                <Header>Creative Department</Header>
                <ListBoxItem>Designer</ListBoxItem>
                <ListBoxItem>Copywriter</ListBoxItem>
                <ListBoxItem>UX Researcher</ListBoxItem>
            </ListBoxSection>
            <ListBoxSection>
                <Header>Operations</Header>
                <ListBoxItem>Project Coordinator</ListBoxItem>
                <ListBoxItem>QA Specialist</ListBoxItem>
            </ListBoxSection>
            <ListBoxItem>Product Owner</ListBoxItem>
        </ListBox>
    );
}
```

#### Dividers

A list box can have dividers.

```tsx
import { Divider, ListBox, ListBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox selectionMode="single" aria-label="list of options">
            <ListBoxItem>Item 1</ListBoxItem>
            <ListBoxItem>Item 2</ListBoxItem>
            <ListBoxItem>Item 3</ListBoxItem>
            <Divider />
            <ListBoxItem>Item 4</ListBoxItem>
            <ListBoxItem>Item 5</ListBoxItem>
        </ListBox>
    );
}
```

#### Avatar

A ListBox can contain an avatar.

```tsx
import { Avatar, ListBox, ListBoxItem, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ListBox selectionMode="single" aria-label="Team">
            <ListBoxItem textValue="Fred Smith">
                <Avatar src="https://i.pravatar.cc/96?img=3" name="Fred Smith" />
                <Text>Fred Smith</Text>
                <SparklesIcon slot="end-icon" />
            </ListBoxItem>
            <ListBoxItem textValue="Karen Smith">
                <Avatar name="Karen Smith" />
                <Text>Karen Smith</Text>
            </ListBoxItem>
            <ListBoxItem textValue="John Doe">
                <Avatar name="John Doe" />
                <Text>John Doe</Text>
            </ListBoxItem>
        </ListBox>
    );
}
```

#### Count

A list box can contain a count using a badge.

```tsx
import { Badge, ListBox, ListBoxItem, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ListBox selectionMode="single" aria-label="list of options">
            <ListBoxItem textValue="Manager">
                <Text>Manager</Text>
                <SparklesIcon slot="end-icon" />
                <Badge>50</Badge>
            </ListBoxItem>
            <ListBoxItem textValue="Developer">
                <Badge variant="subdued">99+</Badge>
                <Text>Developer</Text>
            </ListBoxItem>
            <ListBoxItem>Designer</ListBoxItem>
        </ListBox>
    );
}
```

#### Dynamic Lists

Items and sections can be populated from a hierarchial data structure. If a section has a header, the `Collection` component can be used to render the child items.

```tsx
import { Collection, Header, ListBox, ListBoxItem, ListBoxSection } from "@hopper-ui/components";

const OPTIONS_WITH_SECTIONS = [
    {
        name: "Boy Names", children: [
            { id: 2, name: "Fred" },
            { id: 3, name: "Bob" },
            { id: 4, name: "Gabriel" }
        ]
    },
    {
        name: "Girl Names", children: [
            { id: 6, name: "Sarah" },
            { id: 7, name: "Louise" },
            { id: 8, name: "Karen2" }
        ]
    }
];

export default function Example() {
    return (
        <ListBox
            selectionMode="single"
            aria-label="Names"
            items={OPTIONS_WITH_SECTIONS}
        >
            {section => {
                return (
                    <ListBoxSection id={section.name}>
                        <Header>{section.name}</Header>
                        <Collection items={section.children}>
                            {item => <ListBoxItem id={item.name}>{item.name}</ListBoxItem>}
                        </Collection>
                    </ListBoxSection>
                );
            }}
        </ListBox>
    );
}
```

#### Icons

A list box can contain icons.

```tsx
import { IconList, ListBox, ListBoxItem, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ListBox selectionMode="single" aria-label="list of options">
            <ListBoxItem textValue="Developer">
                <Text>Developer</Text>
                <IconList>
                    <SparklesIcon />
                    <SparklesIcon />
                    <SparklesIcon />
                </IconList>
            </ListBoxItem>
            <ListBoxItem textValue="Designer">
                <SparklesIcon />
                <Text>Designer</Text>
            </ListBoxItem>
            <ListBoxItem>Manager</ListBoxItem>
        </ListBox>
    );
}
```

#### End Icons

A list box can contain icons at the end of a list item.

```tsx
import { IconList, ListBox, ListBoxItem, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <ListBox selectionMode="single" aria-label="list of options">
            <ListBoxItem textValue="Developer">
                <Text>Developer</Text>
                <IconList slot="end-icon">
                    <SparklesIcon /><SparklesIcon /><SparklesIcon />
                </IconList>
            </ListBoxItem>
            <ListBoxItem textValue="Designer">
                <Text>Designer</Text>
                <SparklesIcon slot="end-icon" />
            </ListBoxItem>
            <ListBoxItem>Manager</ListBoxItem>
        </ListBox>
    );
}
```

#### Loading

A list box can have a loading state.

```tsx
import { ListBox } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox
            selectionMode="single"
            aria-label="list of options"
            isLoading
        >
            {[]}
        </ListBox>
    );
}
```

#### Load on scroll

A list box can load more items when scrolling within.

```tsx
import { ListBox, ListBoxItem, useAsyncList } from "@hopper-ui/components";

interface Character {
    name: string;
}

export default function Example() {
    const list = useAsyncList<Character>({
        async load({ signal, cursor }) {
            const res = await fetch(cursor || "https://pokeapi.co/api/v2/pokemon", {
                signal
            });
            const json = await res.json();

            return {
                items: json.results,
                cursor: json.next
            };
        }
    });

    return (
        <ListBox
            selectionMode="single"
            aria-label="list of options"
            items={list.items}
            isLoading={list.isLoading}
            onLoadMore={() => list.loadMore()}
            maxHeight="core_1280"
        >
            {item => (
                <ListBoxItem id={item.name}>{item.name}</ListBoxItem>
            )}
        </ListBox>
    );
}
```

#### Single selection

A list box can have a single selected item.

```tsx
import { ListBox, ListBoxItem, Text, type Selection } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selectedKeys, setSelectedKeys] = useState<Selection>(new Set(["1"]));

    return (
        <ListBox
            selectionMode="single"
            aria-label="list of options"
            selectedKeys={selectedKeys}
            onSelectionChange={setSelectedKeys}
        >
            <ListBoxItem textValue="Developer" id="1">
                <Text>Developer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Designer" id="2">
                <Text>Designer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Manager" id="3">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </ListBoxItem>
        </ListBox>
    );
}
```

#### Single selection indicator

A list box can have a different selection indicator for single select. By default, `disallowEmptySelection` is set to true when the selection indicator is a radio button.

```tsx
import { ListBox, ListBoxItem, Text, type Selection } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selectedKeys, setSelectedKeys] = useState<Selection>(new Set(["1"]));

    return (
        <ListBox
            selectionMode="single"
            selectionIndicator="input"
            aria-label="list of options"
            selectedKeys={selectedKeys}
            onSelectionChange={setSelectedKeys}
        >
            <ListBoxItem textValue="Developer" id="1">
                <Text>Developer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Designer" id="2">
                <Text>Designer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Manager" id="3">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </ListBoxItem>
        </ListBox>
    );
}
```

#### Multiple selection

A list box can have multiple selected items.

```tsx
import { Header, ListBox, ListBoxItem, ListBoxSection, type Selection } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selectedKeys, setSelectedKeys] = useState<Selection>(new Set(["1"]));

    return (
        <ListBox
            selectionMode="multiple"
            aria-label="list of options"
            selectedKeys={selectedKeys}
            onSelectionChange={setSelectedKeys}
        >
            <ListBoxSection aria-label="section">
                <Header>Self review</Header>
                <ListBoxItem id="1">Overdue</ListBoxItem>
                <ListBoxItem id="2">In progress</ListBoxItem>
                <ListBoxItem id="3">Submitted</ListBoxItem>
            </ListBoxSection>
            <ListBoxSection aria-label="section">
                <Header>Manager review</Header>
                <ListBoxItem id="4">Overdue</ListBoxItem>
                <ListBoxItem id="5">In progress</ListBoxItem>
                <ListBoxItem id="6">Submitted</ListBoxItem>
            </ListBoxSection>
        </ListBox>
    );
}
```

#### Sizes

List boxes can vary in size.

By default, the listbox maintains a minimum width of 218px to prevent a narrow appearance. If the menu labels become longer, the listbox component can expand up to a maximum of 288px when triggered by a button, or to the total width of the Select field.

```tsx
import { Inline, ListBox, ListBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline alignY="flex-start">
            <ListBox size="lg" selectionMode="single" aria-label="list of options">
                <ListBoxItem>Developer</ListBoxItem>
                <ListBoxItem>Designer</ListBoxItem>
                <ListBoxItem>Manager</ListBoxItem>
            </ListBox>
            <ListBox size="md" selectionMode="single" aria-label="list of options">
                <ListBoxItem>Developer</ListBoxItem>
                <ListBoxItem>Designer</ListBoxItem>
                <ListBoxItem>Manager</ListBoxItem>
            </ListBox>
            <ListBox size="sm" selectionMode="single" aria-label="list of options">
                <ListBoxItem>Developer</ListBoxItem>
                <ListBoxItem>Designer</ListBoxItem>
                <ListBoxItem>Manager</ListBoxItem>
            </ListBox>
            <ListBox size="xs" selectionMode="single" aria-label="list of options">
                <ListBoxItem>Developer</ListBoxItem>
                <ListBoxItem>Designer</ListBoxItem>
                <ListBoxItem>Manager</ListBoxItem>
            </ListBox>
        </Inline>
    );
}
```

#### Description

A list box item can have a description.

```tsx
import { ListBox, ListBoxItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox aria-label="list of options with a description">
            <ListBoxItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Builds, tests, and maintains software.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Creates visually appealing, functional solutions.</Text>
            </ListBoxItem>
            <ListBoxItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Responsible for leading and overseeing a team or department to ensure organizational goals are met.</Text>
            </ListBoxItem>
        </ListBox>
    );
}
```

#### Item size

List box items can vary in sizes.

```tsx
import { ListBox, ListBoxItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <ListBox selectionMode="single" aria-label="list of options">
            <ListBoxItem size="xs">Developer</ListBoxItem>
            <ListBoxItem size="sm">Designer</ListBoxItem>
            <ListBoxItem size="md">Manager</ListBoxItem>
            <ListBoxItem size="lg">Copywriter</ListBoxItem>
        </ListBox>
    );
}
```

### Best Practices

A listbox can be composed of:

* Options: the individual options inside the Listbox that users can select or deselect.
* Dividers: placed between items and are useful in complex lists when there's a lot of information for the user to parse.
* Section headers: used at the beginning of a section when it's necessary to call out the content being displayed. In most cases, the surrounding context should be enough for the user to understand the information in the list.
* Section footers: used to put important action that should be treated differently from the rest of the options or to put a small piece of information related to the options above.

Listboxes should:

* Be clearly labeled so it's noticeable to the user what type of options will be available.
* Limit the number of options displayed at once.
* Indicate a loading state to the user while option data is being populated.

Use Listbox to hide less frequently used or advanced options until users specifically need them. This keeps the interface clean and focused on essential elements.

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `disabled` has been renamed to `isDisabled`.
* `validationState` has been removed. `isInvalid` should be used instead.
* `tabbable` has been removed.
* `useVirtualFocus` doesn't exist.
* `Listbox` has been renamed to `ListBox` to follow [React Aria Components](https://react-spectrum.adobe.com/react-aria/ListBox.html).

## Main

A specialized component to represent an HTML main element.

```tsx
import { Main, Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <Main color="neutral-weak">
            <Paragraph>
                Walking on the Moon is classic Sting moment, with his band The Police turning out one of
                their most groovy reggae-inspired hits to the background of space exploration.
            </Paragraph>
        </Main>
    );
}
```

### Usage

A main component accepts all the [main HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/main) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Menu

A menu offers a list of choices to the user, such as a set of actions or functions.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/menu/src/Menu.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/>

```tsx
import { Button, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>Favorite</MenuItem>
                <MenuItem>Edit</MenuItem>
                <MenuItem>Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

### Anatomy

#### Structure

```tsx
<Menu>
    <MenuItem> /* (Optional) An item in the Menu */
        <Avatar /> /* (Optional) An avatar in the MenuItem */
        <Icon /> /* (Optional) An icon in the MenuItem */
        <IconList /> /* (Optional) A list of icons in the MenuItem */
        <Text /> /* (Optional) Text is optional, but becomes required if any other elements are present */
        <Text slot="description" /> /* (Optional) A description in the MenuItem */
    </MenuItem>
    <MenuSection> /* (Optional) A section in the Menu */
        <Header /> /* (Optional) A header in the MenuSection */
        <MenuItem /> /* (Optional) An item in the MenuSection */
    </MenuSection>
    <Divider /> /* (Optional) A divider in the Menu */
</Menu>
```

#### Composed Components

A `ListBox` uses the following components:

| Component | Description                                                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Avatar    | Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available. |
| Divider   | A divider separates sections of content or groups.                                                                                                 |
| Header    | A placeholder for an header section.                                                                                                               |
| Icon      | An icon component is used to render a custom icon.                                                                                                 |
| IconList  | An IconList encapsulates a collection of icons.                                                                                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale.                                                                 |

### Usage

#### Empty state

A menu can have an empty state.

```tsx
import { Button, Div, Menu, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu renderEmptyState={() => <Div paddingX="inset-md" paddingY="inset-sm">No results found.</Div>}>
                {[]}
            </Menu>
        </MenuTrigger>
    );
}
```

#### Align and direction

The align prop aligns the Menu relative to the trigger and the direction prop controls the direction the Menu will render.

```tsx
import { Button, Inline, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <MenuTrigger align="start">
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu>
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
            <MenuTrigger align="end" direction="top">
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu>
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
            <MenuTrigger align="start" direction="top">
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu>
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
            <MenuTrigger align="end" direction="bottom">
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu>
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
        </Inline>
    );
}
```

#### Sizes

A menu can have different sizes.

```tsx
import { Button, Inline, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <MenuTrigger>
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu size="xs">
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
            <MenuTrigger>
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu size="sm">
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
            <MenuTrigger>
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu size="md">
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
            <MenuTrigger>
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu size="lg">
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
        </Inline>
    );
}
```

#### Sections

A menu's items can be grouped by sections.

```tsx
import { Button, Header, Menu, MenuItem, MenuSection, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuSection>
                    <Header>Actions</Header>
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </MenuSection>
                <MenuSection>
                    <Header>Others</Header>
                    <MenuItem>Help</MenuItem>
                    <MenuItem>Exit</MenuItem>
                </MenuSection>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Dividers

A menu's items can be separated by dividers.

```tsx
import { Button, Divider, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>Favorite</MenuItem>
                <MenuItem>Edit</MenuItem>
                <Divider />
                <MenuItem>Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Item icons

A menu item can have icons.

```tsx
import { Button, Menu, MenuItem, MenuTrigger, Text } from "@hopper-ui/components";
import { DeleteIcon, EditIcon, KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>
                    <EditIcon />
                    <Text>Edit</Text>
                </MenuItem>
                <MenuItem>
                    <DeleteIcon />
                    <Text>Delete</Text>
                </MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Item end icon

A menu item can have end icons. However, think twice before adding end icons, start icons should be your go-to.

```tsx
import { Button, Menu, MenuItem, MenuTrigger, Text } from "@hopper-ui/components";
import { DeleteIcon, EditIcon, KebabIcon, SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>
                    <EditIcon slot="end-icon" />
                    <Text>Edit</Text>
                </MenuItem>
                <MenuItem>
                    <DeleteIcon slot="end-icon" />
                    <Text>Delete</Text>
                </MenuItem>
                <MenuItem>
                    <SparklesIcon slot="end-icon" />
                    <Text>Miscellaneous</Text>
                </MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Item description

A menu item can have a description.

```tsx
import { Button, Menu, MenuItem, MenuTrigger, Text } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>
                    <Text>Favorite</Text>
                    <Text slot="description">You can favorite your item</Text>
                </MenuItem>
                <MenuItem>
                    <Text>Delete</Text>
                    <Text slot="description">Your item will be forever gone</Text>
                </MenuItem>
                <MenuItem>
                    <Text>Edit</Text>
                    <Text slot="description">Edit your item at your own risk</Text>
                </MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

A description can be paired with an icon.

```tsx
import { Button, Menu, MenuItem, MenuTrigger, Text } from "@hopper-ui/components";
import { DeleteIcon, EditIcon, KebabIcon, SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>
                    <SparklesIcon />
                    <Text>Favorite</Text>
                    <Text slot="description">You can favorite your item</Text>
                </MenuItem>
                <MenuItem>
                    <DeleteIcon />
                    <Text>Delete</Text>
                    <Text slot="description">Your item will be forever gone</Text>
                </MenuItem>
                <MenuItem>
                    <EditIcon />
                    <Text>Edit</Text>
                    <Text slot="description">Edit your item at your own risk</Text>
                </MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

A description can also be paired with an avatar.

```tsx
import { Avatar, Button, Menu, MenuItem, MenuTrigger, Text } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>
                    <Avatar name="Red-Eyed Tree Frog" />
                    <Text>Red-Eyed Tree Frog</Text>
                    <Text slot="description">The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber</Text>
                </MenuItem>
                <MenuItem>
                    <Avatar name="Poison Dart Frog" />
                    <Text>Poison Dart Frog</Text>
                    <Text slot="description">
                        The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian
                    </Text>
                </MenuItem>
                <MenuItem>
                    <Avatar name="Goliath Frog" />
                    <Text>Goliath Frog</Text>
                    <Text slot="description">
                        The Goliath Frog (Conraua goliath) is the largest frog in the world
                    </Text>
                </MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Disabled item

A menu item can be disabled.

```tsx
import { Button, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>Favorite</MenuItem>
                <MenuItem>Edit</MenuItem>
                <MenuItem isDisabled>Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

They can also be disabled using the `disabledKeys` prop on the `Menu` component.

```tsx
import { Button, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu disabledKeys={["edit", "delete"]}>
                <MenuItem id="favorite">Favorite</MenuItem>
                <MenuItem id="edit">Edit</MenuItem>
                <MenuItem id="delete">Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Validation

A menu item can be set as invalid using the `isInvalid` prop.

```tsx
import { Button, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu
                selectionMode="single"
                selectedKeys={["edit"]}
            >
                <MenuItem id="favorite">Favorite</MenuItem>
                <MenuItem id="edit" isInvalid>Edit</MenuItem>
                <MenuItem id="delete">Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Selection

A menu supports multiple selection modes. By default, selection is disabled, however this can be changed by settings the selectionMode property to "single" or "multiple".

> **information**
>
> When using selection with a `<Menu>` component wraped inside a `<MenuTrigger>`, you must handled the selected keys in controlled mode with the selectedKeys property otherwise the selected keys won't be persisted through openings.

```tsx
import { Button, Menu, MenuItem, MenuTrigger, type Selection } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";
import { useCallback, useState } from "react";

export default function Example() {
    const [selectedKeys, setSelectedKeys] = useState<Selection>(new Set(["edit"]));
    const handleSelectionChange = useCallback((newKeys: Selection) => {
        setSelectedKeys(newKeys);
    }, [setSelectedKeys]);

    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu
                selectionMode="multiple"
                selectedKeys={selectedKeys}
                onSelectionChange={handleSelectionChange}
            >
                <MenuItem id="favorite">Favorite</MenuItem>
                <MenuItem id="edit">Edit</MenuItem>
                <MenuItem id="delete">Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Section-level selection

Each section in a menu may have independent selection states. This works the same way as [described above](/components/Menu.md#usage-selection) for the entire menu, but operates at the section level instead.

```tsx
import { Button, Header, Menu, MenuItem, MenuSection, MenuTrigger, type Selection } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";
import { useState } from "react";

export default function Example() {
    const [style, setStyle] = useState<Selection>(new Set(["bold"]));
    const [align, setAlign] = useState<Selection>(new Set(["left"]));

    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuSection>
                    <Header>Actions</Header>
                    <MenuItem>Cut</MenuItem>
                    <MenuItem>Copy</MenuItem>
                    <MenuItem>Paste</MenuItem>
                </MenuSection>
                <MenuSection
                    selectionMode="multiple"
                    selectedKeys={style}
                    onSelectionChange={setStyle}
                >
                    <Header>Text style</Header>
                    <MenuItem id="bold">Bold</MenuItem>
                    <MenuItem id="italic">Italic</MenuItem>
                    <MenuItem id="underline">Underline</MenuItem>
                </MenuSection>
                <MenuSection
                    selectionMode="single"
                    selectedKeys={align}
                    onSelectionChange={setAlign}
                >
                    <Header>Text alignment</Header>
                    <MenuItem id="left">Left</MenuItem>
                    <MenuItem id="center">Center</MenuItem>
                    <MenuItem id="right">Right</MenuItem>
                </MenuSection>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Custom Trigger

MenuTrigger works out of the box with any pressable component (e.g. Button, Link, etc.).

Custom trigger elements such as third party components and other DOM elements are also supported by wrapping them with the `<Pressable>` component.

```tsx
import { Menu, MenuItem, MenuTrigger, Pressable } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [isOpen, setIsOpen] = useState(false);
    const handleOpenChange = useCallback((newOpen: boolean) => {
        setIsOpen(newOpen);
    }, [setIsOpen]);

    return (
        <MenuTrigger onOpenChange={handleOpenChange} isOpen={isOpen}>
            <Pressable>
                <span role="button">Custom trigger</span>
            </Pressable>
            <Menu>
                <MenuItem>Favorite</MenuItem>
                <MenuItem>Edit</MenuItem>
                <MenuItem>Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Dynamic items

A menu items can be rendered dynamically.

```tsx
import { Button, Menu, MenuItem, MenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                {["Favorite", "Edit", "Delete"].map(x => (
                    <MenuItem key={x.toLowerCase()}>{x}</MenuItem>
                ))}
            </Menu>
        </MenuTrigger>
    );
}
```

#### Controlled

The `selectedKey` and `open` state can be handled in controlled mode.

```tsx
import { Button, Menu, MenuItem, MenuTrigger, type Selection } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";
import { useCallback, useState } from "react";

export default function Example() {
    const [selectedKey, setSelectedKey] = useState<Selection>(new Set([]));
    const [isOpen, setIsOpen] = useState(false);
    const handleOpenChange = useCallback((newOpen: boolean) => {
        setIsOpen(newOpen);
    }, [setIsOpen]);
    const handleSelectionChange = useCallback((newKeys: Selection) => {
        setSelectedKey(newKeys);
    }, []);

    return (
        <MenuTrigger onOpenChange={handleOpenChange} isOpen={isOpen}>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu
                onSelectionChange={handleSelectionChange}
                selectedKeys={selectedKey}
                selectionMode="single"
            >
                <MenuItem>Favorite</MenuItem>
                <MenuItem>Edit</MenuItem>
                <MenuItem>Delete</MenuItem>
            </Menu>
        </MenuTrigger>
    );
}
```

#### Opening a modal

A ModalTrigger component won't work with a menu item. Still, it can be done with a custom modal trigger.

```tsx
import { Button, Content, Heading, Menu, MenuItem, MenuTrigger, Modal } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";
import { useCallback, useState } from "react";

export default function Example() {
    const [isOpen, setIsOpen] = useState(false);
    const handleSelectionChange = useCallback(() => {
        setIsOpen(true);
    }, [setIsOpen]);
    const handleModalClose = useCallback((open: boolean) => {
        if (open) {
            return;
        }

        setIsOpen(false);
    }, [setIsOpen]);

    return (
        <>
            <MenuTrigger>
                <Button variant="secondary" aria-label="Actions for selected resource">
                    <KebabIcon />
                </Button>
                <Menu onSelectionChange={handleSelectionChange} selectionMode="single">
                    <MenuItem>Favorite</MenuItem>
                    <MenuItem>Edit</MenuItem>
                    <MenuItem>Delete</MenuItem>
                </Menu>
            </MenuTrigger>
            <Modal onOpenChange={handleModalClose} isOpen={isOpen}>
                <Heading>Frogs</Heading>
                <Content>
                    Hoppity hops
                </Content>
            </Modal>
        </>
    );
}
```

#### Submenu

A menu can have submenus, which are menus that open when hovering or clicking on a menu item.

```tsx
import { Button, Menu, MenuItem, MenuTrigger, SubmenuTrigger } from "@hopper-ui/components";
import { KebabIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <MenuTrigger>
            <Button variant="secondary" aria-label="Actions for selected resource">
                <KebabIcon />
            </Button>
            <Menu>
                <MenuItem>Favorite</MenuItem>
                <MenuItem>Edit</MenuItem>
                <SubmenuTrigger>
                    <MenuItem>Share</MenuItem>
                    <Menu>
                        <MenuItem>SMS</MenuItem>
                        <MenuItem>Email</MenuItem>
                    </Menu>
                </SubmenuTrigger>
            </Menu>
        </MenuTrigger>
    );
}
```

### Props

#### MenuTrigger

| Prop                | Type                | Default | Description                                                                 |
| ------------------- | ------------------- | ------- | --------------------------------------------------------------------------- |
| align               | `"start" \| "end"`  | 'start' | The horizontal alignment of the popup relative to the trigger.              |
| direction           | `"bottom" \| "top"` |         | The direction the open will open relative to the trigger.                   |
| allowFlip           | `boolean`           |         | Whether or not the popup can flip when it will overflow it's boundary area. |
| shouldCloseOnSelect | `boolean`           |         | Whether the menu should close when the menu item is selected.               |
| trigger             | `MenuTriggerType`   | 'press' | How the menu is triggered.                                                  |
| isOpen              | `boolean`           |         | Whether the overlay is open by default (controlled).                        |
| defaultOpen         | `boolean`           |         | Whether the overlay is open by default (uncontrolled).                      |

##### Events

| Prop         | Type                          | Default | Description                                                   |
| ------------ | ----------------------------- | ------- | ------------------------------------------------------------- |
| onOpenChange | `((isOpen: boolean) => void)` |         | Handler that is called when the overlay's open state changes. |

#### Menu

| Prop                   | Type                                    | Default          | Description                                                                                                                                                                                                                                                                                                  |
| ---------------------- | --------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| size                   | `ResponsiveProp<MenuItemSize>`          | "sm"             | The size of the menu.                                                                                                                                                                                                                                                                                        |
| popoverProps           | `PopoverBaseProps`                      |                  | The props for the popover.                                                                                                                                                                                                                                                                                   |
| style                  | `StyleOrFunction<MenuRenderProps>`      |                  | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                                                                            |
| children               | `ReactNode \| ((item: T) => ReactNode)` |                  | The contents of the collection.                                                                                                                                                                                                                                                                              |
| escapeKeyBehavior      | `"clearSelection" \| "none"`            | 'clearSelection' | Whether pressing the escape key should clear selection in the menu or not.Most experiences should not modify this option as it eliminates a keyboard user's ability to easily clear selection. Only use if the escape key is being handled externally or should not trigger selection clearing contextually. |
| autoFocus              | `boolean \| FocusStrategy`              |                  | Where the focus should be set.                                                                                                                                                                                                                                                                               |
| shouldFocusWrap        | `boolean`                               |                  | Whether keyboard navigation is circular.                                                                                                                                                                                                                                                                     |
| items                  | `Iterable<T>`                           |                  | Item objects in the collection.                                                                                                                                                                                                                                                                              |
| disabledKeys           | `Iterable<Key>`                         |                  | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.                                                                                                                                                                                                      |
| selectionMode          | `SelectionMode`                         |                  | The type of selection that is allowed in the collection.                                                                                                                                                                                                                                                     |
| disallowEmptySelection | `boolean`                               |                  | Whether the collection allows empty selection.                                                                                                                                                                                                                                                               |
| selectedKeys           | `Iterable<Key> \| "all"`                |                  | The currently selected keys in the collection (controlled).                                                                                                                                                                                                                                                  |
| defaultSelectedKeys    | `Iterable<Key> \| "all"`                |                  | The initial selected keys in the collection (uncontrolled).                                                                                                                                                                                                                                                  |
| renderEmptyState       | `(() => ReactNode)`                     |                  | Provides content to display when there are no items in the list.                                                                                                                                                                                                                                             |
| dependencies           | `readonly any[]`                        |                  | Values that should invalidate the item cache when using dynamic collections.                                                                                                                                                                                                                                 |
| className              | `ClassNameOrFunction<MenuRenderProps>`  |                  | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                                                                                           |
| dir                    | `string`                                |                  |                                                                                                                                                                                                                                                                                                              |
| lang                   | `string`                                |                  |                                                                                                                                                                                                                                                                                                              |
| inert                  | `boolean`                               |                  |                                                                                                                                                                                                                                                                                                              |
| translate              | `"yes" \| "no"`                         |                  |                                                                                                                                                                                                                                                                                                              |

##### Events

| Prop                        | Type                                     | Default | Description                                                                |
| --------------------------- | ---------------------------------------- | ------- | -------------------------------------------------------------------------- |
| onAction                    | `((key: Key) => void)`                   |         | Handler that is called when an item is selected.                           |
| onClose                     | `(() => void)`                           |         | Handler that is called when the menu should close after selecting an item. |
| onSelectionChange           | `((keys: Selection) => void)`            |         | Handler that is called when the selection changes.                         |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                                            |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                                            |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                                            |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                                            |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                                            |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                                            |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                            |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                            |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                            |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                            |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                            |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                                            |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                                            |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

#### MenuItem

| Prop                | Type                                       | Default | Description                                                                                                                                                                        |
| ------------------- | ------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| children            | `ReactNode`                                |         | The contents of the item.                                                                                                                                                          |
| isInvalid           | `boolean`                                  |         | Whether or not the item is invalid                                                                                                                                                 |
| size                | `ResponsiveProp<MenuItemSize>`             | "sm"    | The size of the MenuItem.                                                                                                                                                          |
| shouldCloseOnSelect | `boolean`                                  |         | Whether the menu should close when the menu item is selected.                                                                                                                      |
| style               | `StyleOrFunction<MenuItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| dir                 | `string`                                   |         |                                                                                                                                                                                    |
| lang                | `string`                                   |         |                                                                                                                                                                                    |
| inert               | `boolean`                                  |         |                                                                                                                                                                                    |
| translate           | `"yes" \| "no"`                            |         |                                                                                                                                                                                    |
| id                  | `Key`                                      |         | The unique id of the item.                                                                                                                                                         |
| value               | `object`                                   |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                             |
| textValue           | `string`                                   |         | A string representation of the item's contents, used for features like typeahead.                                                                                                  |
| isDisabled          | `boolean`                                  |         | Whether the item is disabled.                                                                                                                                                      |
| className           | `ClassNameOrFunction<MenuItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| href                | `string`                                   |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                     |
| hrefLang            | `string`                                   |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                     |
| target              | `HTMLAttributeAnchorTarget`                |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                     |
| rel                 | `string`                                   |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                    |
| download            | `string \| boolean`                        |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).   |
| ping                | `string`                                   |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                     |
| referrerPolicy      | `HTMLAttributeReferrerPolicy`              |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                   |
| routerOptions       | `undefined`                                |         | Options for the configured client side router.                                                                                                                                     |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when the item is selected.                                                                                                                                                         |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

#### MenuSection

| Prop                   | Type                                                                                  | Default | Description                                                                                               |
| ---------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| style                  | `CSSProperties`                                                                       |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.   |
| children               | `ReactNode \| ((item: T) => ReactElement<any, string \| JSXElementConstructor<any>>)` |         | Static child items or a function to render children.                                                      |
| items                  | `Iterable<T>`                                                                         |         | Item objects in the section.                                                                              |
| id                     | `Key`                                                                                 |         | The unique id of the section.                                                                             |
| value                  | `object`                                                                              |         | The object value that this section represents. When using dynamic collections, this is set automatically. |
| dependencies           | `readonly any[]`                                                                      |         | Values that should invalidate the item cache when using dynamic collections.                              |
| className              | `string`                                                                              |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.  |
| dir                    | `string`                                                                              |         |                                                                                                           |
| lang                   | `string`                                                                              |         |                                                                                                           |
| inert                  | `boolean`                                                                             |         |                                                                                                           |
| translate              | `"yes" \| "no"`                                                                       |         |                                                                                                           |
| selectionMode          | `SelectionMode`                                                                       |         | The type of selection that is allowed in the collection.                                                  |
| disallowEmptySelection | `boolean`                                                                             |         | Whether the collection allows empty selection.                                                            |
| selectedKeys           | `"all" \| Iterable<Key>`                                                              |         | The currently selected keys in the collection (controlled).                                               |
| defaultSelectedKeys    | `"all" \| Iterable<Key>`                                                              |         | The initial selected keys in the collection (uncontrolled).                                               |
| disabledKeys           | `Iterable<Key>`                                                                       |         | The currently disabled keys in the collection (controlled).                                               |

##### Events

| Prop                        | Type                                  | Default | Description                                        |
| --------------------------- | ------------------------------------- | ------- | -------------------------------------------------- |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |                                                    |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |                                                    |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |                                                    |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |                                                    |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |                                                    |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |                                                    |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |                                                    |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |                                                    |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |                                                    |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |                                                    |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |                                                    |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |                                                    |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |                                                    |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |                                                    |
| onSelectionChange           | `((keys: Selection) => void)`         |         | Handler that is called when the selection changes. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                             |
| ---------- | -------- | ------- | --------------------------------------- |
| aria-label | `string` |         | An accessibility label for the section. |

#### Divider

| Prop        | Type            | Default      | Description                                                                                              |
| ----------- | --------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| style       | `CSSProperties` |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| orientation | `Orientation`   | 'horizontal' | The orientation of the separator.                                                                        |
| elementType | `string`        |              | The HTML element type that will be used to render the separator.                                         |
| className   | `string`        |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| dir         | `string`        |              |                                                                                                          |
| lang        | `string`        |              |                                                                                                          |
| inert       | `boolean`       |              |                                                                                                          |
| translate   | `"yes" \| "no"` |              |                                                                                                          |

##### Events

| Prop                        | Type                                  | Default | Description |
| --------------------------- | ------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

#### SubmenuTrigger

| Prop     | Type                                                        | Default | Description                                                                                                                                       |
| -------- | ----------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| children | `ReactElement<any, string \| JSXElementConstructor<any>>[]` |         | The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu). |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

#### MenuTrigger

* `allowPreventOverflow` has been removed.
* `closeOnSelect` has been removed.
* `open` has been renamed to `isOpen`.

#### Menu

* `autoFocusTarget` has been removed.
* `disabled` has been removed, set the disabled items as `disabledKeys` instead.
* `fluid` has been removed.
* `nodes` has been removed.
* `validationState` has been removed. `isInvalid` should be used instead on the `MenuItem`.

#### MenuItem

* `disabled` has been renamed to `isDisabled`

#### MenuSection

* `title` has been removed from `MenuSection`, use `Header` as a children instead

#### Miscellaneous

* `Item` has been renamed `MenuItem`
* `Section` has been renamed `MenuSection`
* We cannot add a tooltip on a MenuItem anymore

## Modal

Modals focus the user's attention exclusively on one task or piece of information via a window that sits on top of the page content.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/modal/src/Modal.tsx>

Modals are a variant of Alert used to present critical information or request user input needed to complete a user's workflow. Modals interrupt a user's workflow by design. When active, a user is blocked from the on-page content and cannot return to their previous workflow until the modal task is completed or the user dismisses the modal. While effective when used correctly, modals should be used sparingly to limit disruption to the user. Modals are commonly used for short and non-frequent tasks, such as editing or management tasks. If a user needs to repeatable perform a task, consider making the task do-able from the main page.

```tsx
import { Button, Content, Heading, Modal, ModalTrigger, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    <Text size="sm">
                        Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                    </Text>
                    <Text size="sm">
                        Frogs don’t drink water with their mouths! Instead, they absorb moisture through their specialized skin patch on their belly and thighs.
                    </Text>
                </Content>
            </Modal>
        </ModalTrigger>
    );
}
```

### Anatomy

#### Structure

```tsx
<Modal>
    <Image /> /* (Optional) Decorative image in the modal */
    <Heading /> /** (Required) The title of the modal */
    <Header /> /** (Optional) Section to the right of the Heading  */
    <Content /> /** (Required) the content of the modal */
    <Footer /> /** (Optional) Section under the content, to the left of the buttons
    <ButtonGroup /> /** (Optional) If there is multiple buttons */
    <Button /> /** (Optional) If there is only 1 button */
</Modal>
```

#### Composed Components

A `Modal` uses the following components:

| Component   | Description                                                                   |
| ----------- | ----------------------------------------------------------------------------- |
| Button      | A button allows a user to initiate an action.                                 |
| ButtonGroup | A button group handles the spacing and orientation for a grouping of buttons. |
| Content     | A placeholder for the main content section of a component.                    |
| Footer      | A placeholder for a footer section.                                           |
| Header      | A placeholder for an header section.                                          |
| Heading     | A heading is a primitive component matching Hopper's typography type scale.   |
| Image       | An image component that can be used to display images.                        |

### Usage

#### Default

A modal must have an heading and a content.

```tsx
import { Button, Content, Heading, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                </Content>
            </Modal>
        </ModalTrigger>
    );
}
```

#### Image

A modal can have a side banner image. Make sure the image has no essential information as it could be cropped in mobile view. Images should not prevent a user from seeing the close button, be conscious of this.

```tsx
import { Button, Content, Heading, Image, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                <Image src="/frog.jpg" alt="Frog" />
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                </Content>
            </Modal>
        </ModalTrigger>
    );
}
```

#### Choice

A modal can offer a choice between 2 options. Keep the copy not too long in order to help the user quickly make his choice.

```tsx
import { Button, Card, Content, Flex, Heading, Image, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    <Flex gap="stack-lg">
                        <Card flex={1}>
                            <Image objectFit="cover" alt="Frog" src="/frog.jpg" />
                            <Flex direction="column" gap="stack-sm" padding="inset-md" height="100%" justifyContent="space-between">
                                <Flex direction="column" gap="stack-sm">
                                    <Heading>Frog</Heading>
                                    <Content>
                                        Common frogs are found in ponds, marshes, and forests across the world. Unlike some of their flashier cousins, they rely on stealth and speed rather than bright colors to survive.
                                    </Content>
                                    <Button variant="secondary">Choose</Button>
                                </Flex>
                            </Flex>
                        </Card>
                        <Card flex={1}>
                            <Image objectFit="cover" alt="Mossy Frog" src="/mossy-frog.jpg" />
                            <Flex direction="column" gap="stack-sm" padding="inset-md" height="100%" justifyContent="space-between">
                                <Flex direction="column" gap="stack-sm">
                                    <Heading>Mossy Frog</Heading>
                                    <Content>
                                        A mossy tree frog with rough, bark-like skin, blending perfectly into its surroundings for camouflage and protection.
                                    </Content>
                                </Flex>
                                <Button variant="secondary">Choose</Button>
                            </Flex>
                        </Card>
                    </Flex>
                </Content>
            </Modal>
        </ModalTrigger>
    );
}
```

#### Header

Use an header to provide additional information usually in the form of a link or a tooltip that provides more context to the task at hand. Links should open in a new window.

```tsx
import { Button, Content, Header, Heading, Link, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                <Heading>Fascinating Frog Facts!</Heading>
                <Header>
                    <Link
                        isExternal
                        href="https://en.wikipedia.org/wiki/Frog"
                        size="sm"
                    >
                        Wikipedia
                    </Link>
                </Header>
                <Content>
                    Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                </Content>
            </Modal>
        </ModalTrigger>
    );
}
```

#### Footer

Use a footer to provide trivial information about content present in the modal, like a step : 1/3.

```tsx
import { Button, Content, Footer, Heading, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                </Content>
                <Footer>
                    Copyright 2025
                </Footer>
            </Modal>
        </ModalTrigger>
    );
}
```

#### Buttons

A modal can have a single button. Use a primary button to provide the main action.

```tsx
import { Button, Content, Heading, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                {({ close }) => (
                    <>
                        <Heading>Fascinating Frog Facts!</Heading>
                        <Content>
                            Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                        </Content>
                        <Button onPress={close}>
                            Save
                        </Button>
                    </>
                )}
            </Modal>
        </ModalTrigger>
    );
}
```

Or a group of button. A maximum of 3 buttons are allowed in a modal, when necessary. The secondary and tertiary actions should be using a secondary variant.

```tsx
import { Button, ButtonGroup, Content, Heading, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                {({ close }) => (
                    <>
                        <Heading>Fascinating Frog Facts!</Heading>
                        <Content>
                            Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                        </Content>
                        <ButtonGroup>
                            <Button variant="secondary" onPress={close}>Cancel</Button>
                            <Button onPress={close}>Save</Button>
                        </ButtonGroup>
                    </>
                )}
            </Modal>
        </ModalTrigger>
    );
}
```

#### Dismissable

By default, a modal will dismiss on outside interactions and esc keydown. However, in some cases, you might want to force the user to explicitly dismiss the modal with a targeted call to action. This is what the `isDismissable` and the `isKeyboardDismissDisabled` prop is for.

You can set the isDismissable prop to false and isKeyboardDismissDisabled to true and render a call to action which will manually dismiss the popover by calling a close function.

```tsx
import { Button, Content, Heading, Modal, ModalTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <Modal isDismissable={false} isKeyboardDismissDisabled>
                {({ close }) => (
                    <>
                        <Heading>Fascinating Frog Facts!</Heading>
                        <Content>
                            Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                        </Content>
                        <Button onPress={close}>
                            Save
                        </Button>
                    </>
                )}
            </Modal>
        </ModalTrigger>
    );
}
```

#### Controlled

The open state can be handled in controlled mode.

```tsx
import { Button, Content, Heading, Modal, ModalTrigger } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [isOpen, setIsOpen] = useState(false);

    return (
        <ModalTrigger isOpen={isOpen} onOpenChange={setIsOpen}>
            <Button variant="secondary">Open modal</Button>
            <Modal>
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                </Content>
            </Modal>
        </ModalTrigger>
    );
}
```

#### Custom trigger

You don't have to use a ModalTrigger component if it doesn't fit your needs. A modal component can be used on it's own with any custom trigger.

```tsx
import { Button, Content, Heading, Modal } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [isOpen, setIsOpen] = useState(false);

    return (
        <>
            <Button variant="secondary" onPress={() => setIsOpen(true)}>Open modal</Button>
            <Modal isOpen={isOpen} onOpenChange={setIsOpen}>
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                </Content>
            </Modal>
        </>
    );
}
```

#### Sizes

A modal can be small, medium, large, extra-large, fullscreen or fullscreenTakeover. The default size is medium.

Choose a size that works best for the amount of modal content you have. Modals with short messages should use a small or medium modal to avoid long single lines; for complex components, like a data table the large or extra large modal will be more accommodating.

```tsx
import { Button, Content, Heading, Modal, type ModalProps, ModalTrigger, Stack } from "@hopper-ui/components";

export default function Example() {
    const modal = (size: ModalProps["size"]) => (
        <ModalTrigger>
            <Button variant="secondary">Open {size?.toString()} modal</Button>
            <Modal size={size}>
                <Heading>Fascinating Frog Facts!</Heading>
                <Content>
                    Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                </Content>
            </Modal>
        </ModalTrigger>
    );

    return (
        <Stack gap="stack-md">
            {modal("sm")}
            {modal("md")}
            {modal("lg")}
            {modal("xl")}
            {modal("fullscreen")}
            {modal("fullscreenTakeover")}
        </Stack>
    );
}
```

#### Responsive sizes

A modal can have different size in mobile and desktop view.

```tsx
import { Button, Content, Heading, Modal, ModalTrigger, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack gap="stack-md">
            <ModalTrigger>
                <Button variant="secondary">Open responsive modal</Button>
                <Modal
                    size={{
                        base: "fullscreenTakeover",
                        md: "md"
                    }}
                >
                    <Heading>Fascinating Frog Facts!</Heading>
                    <Content>
                        Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                    </Content>
                </Modal>
            </ModalTrigger>
        </Stack>
    );
}
```

#### Custom

A CustomModal is a Modal with a custom layout. A CustomModal must contain a `<Heading slot="title">` or have an aria-label or aria-labelledby attribute for accessibility.

```tsx
import { Button, Content, CustomModal, Heading, Image, ModalTrigger, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <ModalTrigger>
            <Button variant="secondary">Open modal</Button>
            <CustomModal padding="inset-lg">
                {({ close }) => (
                    <Stack>
                        <Button variant="secondary" onPress={close}>Close</Button>
                        <Heading>Fascinating Frog Facts!</Heading>
                        <Content>
                            Frogs are amphibians, meaning they can live both in water and on land! With their powerful legs, some species can jump over 20 times their body length—that’s like a human leaping over a school bus!
                        </Content>
                        <Image src="/frog.jpg" alt="Frog" />
                    </Stack>
                )}
            </CustomModal>
        </ModalTrigger>
    );
}
```

### Best Practices

be thought of as temporary and not be used for information or actions that need to live on in the interface in a persistent way. Don't use modals to display complex forms or large amounts of information. Modals should:

* Require that users take an action.
* Close when users press the Dismiss button, the Cancel button, the ESC key, or when users click the area outside the modal.
* Not have more than two buttons (primary and secondary) in the footer. This prevents unclear action hierarchy and crowding on mobile screens. Since modals are for focused tasks, they should have focused actions.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Content, Modal } from "@hopper-ui/components";

  <Modal>
      <Content>
          Modal content goes here.
      </Content>
  </Modal>;
  ```

  Include a Content section in every modal implementation

* 🚫 Don't:

  ```tsx
  import { Modal } from "@hopper-ui/components";

  <Modal>
      Modal content should be in a Content component
  </Modal>;
  ```

  Create a modal without the required Content section

**Rule 2**

* ✅ Do:

  ```tsx
  import { Content, Modal } from "@hopper-ui/components";

  <Modal>
      <Content>
          Modal content goes here.
      </Content>
  </Modal>;
  ```

  Make the Content component a direct child of the Modal

* 🚫 Don't:

  ```tsx
  import { Content, Modal, Stack } from "@hopper-ui/components";

  <Modal>
      <Stack>
          <Content>
              Modal content goes here.
          </Content>
      </Stack>
  </Modal>;
  ```

  Place the Content component inside additional wrapper elements

### Props

#### Modal

| Prop                      | Type                                                                                   | Default | Description                                                                                                                                      |
| ------------------------- | -------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| isDismissible             | `boolean`                                                                              | true    | Whether the Modal is dismissable. @deprecated Use `isDismissable` instead. This prop will be removed in a future version (September 30th, 2025). |
| isDismissable             | `boolean`                                                                              | true    | Whether the Modal is dismissable.                                                                                                                |
| isKeyboardDismissDisabled | `boolean`                                                                              |         | Whether pressing the escape key to close the dialog should be disabled.                                                                          |
| size                      | `ResponsiveProp<"sm" \| "md" \| "lg" \| "xl" \| "fullscreen" \| "fullscreenTakeover">` | "md"    | The size of the modal.                                                                                                                           |
| overlayProps              | `Partial<BaseModalProps>`                                                              |         | The props of the overlay                                                                                                                         |
| style                     | `CSSProperties`                                                                        |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.                                          |
| children                  | `ReactNode \| ((opts: DialogRenderProps) => ReactNode)`                                |         | Children of the dialog. A function may be provided to access a function to close the dialog.                                                     |
| className                 | `string`                                                                               |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.                                         |
| dir                       | `string`                                                                               |         |                                                                                                                                                  |
| lang                      | `string`                                                                               |         |                                                                                                                                                  |
| inert                     | `boolean`                                                                              |         |                                                                                                                                                  |
| translate                 | `"yes" \| "no"`                                                                        |         |                                                                                                                                                  |
| isOpen                    | `boolean`                                                                              |         | Whether the overlay is open by default (controlled).                                                                                             |
| defaultOpen               | `boolean`                                                                              |         | Whether the overlay is open by default (uncontrolled).                                                                                           |

##### Events

| Prop                        | Type                                  | Default | Description                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onOpenChange                | `((isOpen: boolean) => void)`         |         | Handler that is called when the modal's open state changes. This handler is only called when the modal is not used inside a `ModalTrigger`. Use the `onOpenChange` prop of `ModalTrigger` instead if it's part of a trigger |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |                                                                                                                                                                                                                             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |                                                                                                                                                                                                                             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type                        | Default  | Description                                                                                                         |
| ---------------- | --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| role             | `"dialog" \| "alertdialog"` | 'dialog' | The accessibility role for the dialog.                                                                              |
| id               | `string`                    |          | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string`                    |          | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string`                    |          | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string`                    |          | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string`                    |          | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

#### ModalTrigger

| Prop        | Type      | Default | Description                                            |
| ----------- | --------- | ------- | ------------------------------------------------------ |
| isOpen      | `boolean` |         | Whether the overlay is open by default (controlled).   |
| defaultOpen | `boolean` |         | Whether the overlay is open by default (uncontrolled). |

##### Events

| Prop         | Type                          | Default | Description                                                   |
| ------------ | ----------------------------- | ------- | ------------------------------------------------------------- |
| onOpenChange | `((isOpen: boolean) => void)` |         | Handler that is called when the overlay's open state changes. |

#### CustomModal

| Prop                      | Type                                                                                   | Default | Description                                                                                                                                      |
| ------------------------- | -------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| isDismissible             | `boolean`                                                                              | true    | Whether the Modal is dismissable. @deprecated Use `isDismissable` instead. This prop will be removed in a future version (September 30th, 2025). |
| isDismissable             | `boolean`                                                                              | true    | Whether the CustomModal is dismissable.                                                                                                          |
| isKeyboardDismissDisabled | `boolean`                                                                              |         | Whether pressing the escape key to close the dialog should be disabled.                                                                          |
| size                      | `ResponsiveProp<"sm" \| "md" \| "lg" \| "xl" \| "fullscreen" \| "fullscreenTakeover">` | "md"    | The size of the CustomModal.                                                                                                                     |
| overlayProps              | `Partial<BaseModalProps>`                                                              |         | The props of the overlay                                                                                                                         |
| style                     | `CSSProperties`                                                                        |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.                                          |
| children                  | `ReactNode \| ((opts: DialogRenderProps) => ReactNode)`                                |         | Children of the dialog. A function may be provided to access a function to close the dialog.                                                     |
| className                 | `string`                                                                               |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.                                         |
| dir                       | `string`                                                                               |         |                                                                                                                                                  |
| lang                      | `string`                                                                               |         |                                                                                                                                                  |
| inert                     | `boolean`                                                                              |         |                                                                                                                                                  |
| translate                 | `"yes" \| "no"`                                                                        |         |                                                                                                                                                  |
| isOpen                    | `boolean`                                                                              |         | Whether the overlay is open by default (controlled).                                                                                             |
| defaultOpen               | `boolean`                                                                              |         | Whether the overlay is open by default (uncontrolled).                                                                                           |

##### Events

| Prop                        | Type                                  | Default | Description                                                                                                                                                                                                                        |
| --------------------------- | ------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onOpenChange                | `((isOpen: boolean) => void)`         |         | Handler that is called when the custom modal's open state changes. This handler is only called when the modal is not used inside a `ModalTrigger`. Use the `onOpenChange` prop of `ModalTrigger` instead if it's part of a trigger |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |                                                                                                                                                                                                                                    |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |                                                                                                                                                                                                                                    |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |                                                                                                                                                                                                                                    |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |                                                                                                                                                                                                                                    |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                                    |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                                    |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                                    |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                                    |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                                    |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |                                                                                                                                                                                                                                    |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |                                                                                                                                                                                                                                    |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type                        | Default  | Description                                                                                                         |
| ---------------- | --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| role             | `"dialog" \| "alertdialog"` | 'dialog' | The accessibility role for the dialog.                                                                              |
| id               | `string`                    |          | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string`                    |          | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string`                    |          | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string`                    |          | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string`                    |          | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `dismissable` has been renamed `isDismissable`.
* `onClose` has been removed, use `onOpenChange` on the ModalTrigger instead.
* `wrapperProps` has been renamed `overlayProps`.

## Nav

A specialized component to represent an HTML nav element.

```tsx
import { LI, Link, Nav, UL } from "@hopper-ui/components";

export default function Example() {
    return (
        <Nav color="neutral-weak">
            <UL>
                <LI>
                    <Link href="#">Missions</Link>
                </LI>
                <LI>
                    <Link href="#">Launches</Link>
                </LI>
                <LI>
                    <Link href="#">Careers</Link>
                </LI>
            </UL>
        </Nav>
    );
}
```

### Usage

A nav component accepts all the [nav HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/nav) and [Hopper styled component props](/styled-system/concepts/styling.md).

## NumberField

A number field is a specialized input that allows a user to enter a number.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/inputs/src/NumberField.tsx>

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField label="Training hours completed" />
    );
}
```

### Usage

#### Disabled

A number field in a disabled state shows that an input field exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField isDisabled label="Training hours completed" />
    );
}
```

#### ReadOnly

The `isReadOnly` prop makes the number field's content immutable. Unlike `isDisabled`, the number field remains focusable and the contents can still be copied. See [the MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) for more information.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField value={42} isReadOnly label="Training hours completed" />
    );
}
```

#### Sizes

Number fields have multiple sizes to choose from.

```tsx
import { NumberField, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <NumberField label="Training hours completed" size="sm" />
            <NumberField label="Training hours completed" />
        </Stack>
    );
}
```

#### Labeling

If a visible label isn't specified, an `aria-label` must be provided to the number field for accessibility. If the field is labeled by a separate element, an `aria-labelledby` prop must be provided using the ID of the labeling element instead.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField aria-label="Training hours completed" />
    );
}
```

#### Description

A number field with a helper message.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField label="Training hours completed" description="In person training hours only." />
    );
}
```

#### Icon Prefix

An icon can be displayed at the start of the input.

```tsx
import { NumberField } from "@hopper-ui/components";
import { UserIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <NumberField prefix={<UserIcon />} label="Training hours completed" />
    );
}
```

#### Text Prefix

A short text can be displayed at the start of the input.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField prefix="Kg" label="Training hours completed" />
    );
}
```

#### Error

A number field can be displayed in an error state to indicate that the user input is invalid.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField value={42} isInvalid label="Training hours completed" errorMessage="You cannot enter more than 40 training hours for this period." />
    );
}
```

#### Min Max

A number field can have a minimum and maximum value.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField minValue={42} maxValue={50} label="Training hours completed" description="Please enter a value between 10 and 40." />
    );
}
```

#### Formatting

A number field can be formatted using this [format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat).

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField
            formatOptions={{
                style: "currency",
                currency: "USD"
            }}
            label="Training Budget Allocated"
        />
    );
}
```

#### Fluid

A number field can take the width of its container.

```tsx
import { NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField isFluid label="Training hours completed" />
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a NumberField.

```tsx
import { ContextualHelp, NumberField } from "@hopper-ui/components";

export default function Example() {
    return (
        <NumberField
            label="Training hours completed"
            contextualHelp={<ContextualHelp>This input only takes in numbers</ContextualHelp>}
        />
    );
}
```

### Best Practices

* Be clearly labeled so it's obvious to users what they should enter into the field.
* Be labeled as “Optional” when you need to request input that's not required. View the Form pattern for more details on this.
* Only ask for information that's really needed.
* Validate input as soon as users have finished interacting with a field, but not before.

### Props

| Prop               | Type                                                   | Default  | Description                                                                                                                                                                                                                               |
| ------------------ | ------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| prefix             | `ReactNode`                                            |          | An icon or text to display at the start of the input.                                                                                                                                                                                     |
| isFluid            | `ResponsiveProp<boolean>`                              | false    | If `true`, the NumberField will take all available width.                                                                                                                                                                                 |
| inputRef           | `MutableRefObject<HTMLInputElement \| null>`           |          | A ref for the HTML input element.                                                                                                                                                                                                         |
| inputProps         | `Partial<InputProps>`                                  |          | The props for the Input.                                                                                                                                                                                                                  |
| inputGroupProps    | `InputGroupProps`                                      |          | The props for the InputGroup.                                                                                                                                                                                                             |
| form               | `string`                                               |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).              |
| style              | `StyleOrFunction<NumberFieldRenderProps>`              |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                         |
| validationBehavior | `"native" \| "aria"`                                   | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                            |
| decrementAriaLabel | `string`                                               |          | A custom aria-label for the decrement button. If not provided, the localized string "Decrement" is used.                                                                                                                                  |
| incrementAriaLabel | `string`                                               |          | A custom aria-label for the increment button. If not provided, the localized string "Increment" is used.                                                                                                                                  |
| isWheelDisabled    | `boolean`                                              |          | Enables or disables changing the value with scroll.                                                                                                                                                                                       |
| formatOptions      | `NumberFormatOptions`                                  |          | Formatting options for the value displayed in the number field. This also affects what characters are allowed to be typed by the user.                                                                                                    |
| isDisabled         | `boolean`                                              |          | Whether the input is disabled.                                                                                                                                                                                                            |
| isReadOnly         | `boolean`                                              |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                            |
| isRequired         | `boolean`                                              |          | Whether user input is required on the input before form submission.                                                                                                                                                                       |
| isInvalid          | `boolean`                                              |          | Whether the input value is invalid.                                                                                                                                                                                                       |
| validate           | `((value: number) => true \| ValidationError \| null)` |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead. |
| autoFocus          | `boolean`                                              |          | Whether the element should receive focus on render.                                                                                                                                                                                       |
| value              | `number`                                               |          | The current value (controlled).                                                                                                                                                                                                           |
| defaultValue       | `number`                                               |          | The default value (uncontrolled).                                                                                                                                                                                                         |
| minValue           | `number`                                               |          | The smallest value allowed for the input.                                                                                                                                                                                                 |
| maxValue           | `number`                                               |          | The largest value allowed for the input.                                                                                                                                                                                                  |
| step               | `number`                                               |          | The amount that the input value changes with each increment or decrement "tick".                                                                                                                                                          |
| className          | `ClassNameOrFunction<NumberFieldRenderProps>`          |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                        |
| dir                | `string`                                               |          |                                                                                                                                                                                                                                           |
| lang               | `string`                                               |          |                                                                                                                                                                                                                                           |
| inert              | `boolean`                                              |          |                                                                                                                                                                                                                                           |
| translate          | `"yes" \| "no"`                                        |          |                                                                                                                                                                                                                                           |
| name               | `string`                                               |          | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                             |
| description        | `ReactNode`                                            |          | The helper message of the field.                                                                                                                                                                                                          |
| errorMessage       | `ReactNode \| ((v: ValidationResult) => ReactNode)`    |          | The error message of the field.                                                                                                                                                                                                           |
| label              | `ReactNode`                                            |          | The label of the field.                                                                                                                                                                                                                   |
| necessityIndicator | `NecessityIndicator`                                   |          | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                    |
| size               | `ResponsiveProp<FieldSize>`                            | "md"     | A Field can vary in size.                                                                                                                                                                                                                 |
| contextualHelp     | `ReactNode`                                            |          | A ContextualHelp element to place next to the label.                                                                                                                                                                                      |

##### Events

| Prop                        | Type                                          | Default | Description                                                                                                                                                                                                |
| --------------------------- | --------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element receives focus.                                                                                                                                                    |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element loses focus.                                                                                                                                                       |
| onFocusChange               | `((isFocused: boolean) => void)`              |         | Handler that is called when the element's focus status changes.                                                                                                                                            |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                |         | Handler that is called when a key is pressed.                                                                                                                                                              |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                |         | Handler that is called when a key is released.                                                                                                                                                             |
| onChange                    | `((value: number) => void)`                   |         | Handler that is called when the value changes.                                                                                                                                                             |
| onCopy                      | `ClipboardEventHandler<HTMLInputElement>`     |         | Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).                                                                          |
| onCut                       | `ClipboardEventHandler<HTMLInputElement>`     |         | Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).                                                                             |
| onPaste                     | `ClipboardEventHandler<HTMLInputElement>`     |         | Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).                                                                         |
| onCompositionStart          | `CompositionEventHandler<HTMLInputElement>`   |         | Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).                   |
| onCompositionEnd            | `CompositionEventHandler<HTMLInputElement>`   |         | Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event). |
| onCompositionUpdate         | `CompositionEventHandler<HTMLInputElement>`   |         | Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).              |
| onSelect                    | `ReactEventHandler<HTMLInputElement>`         |         | Handler that is called when text in the input is selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).                                                               |
| onBeforeInput               | `FormEventHandler<HTMLInputElement>`          |         | Handler that is called when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).                                            |
| onInput                     | `FormEventHandler<HTMLInputElement>`          |         | Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).                                                              |
| onClick                     | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`         |         |                                                                                                                                                                                                            |
| onScroll                    | `UIEventHandler<HTMLDivElement>`              |         |                                                                                                                                                                                                            |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`              |         |                                                                                                                                                                                                            |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`           |         |                                                                                                                                                                                                            |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                                                            |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                                                            |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                                                            |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                                                            |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                                                            |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                                                                                                                                                            |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                                                                                                                                                            |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

* Boolean props are now prefixed by `is`.
* There is no longer a loading state.
* `icon` prop has been renamed to `prefix`.
* `wrapperProps` is not supported.
* `validationState` was renamed to `isInvalid`.
* `min` and `max` props have been renamed to `minValue` and `maxValue`.

## Paragraph

A paragraph is used to render blocks of text.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/typography/paragraph/src/Paragraph.tsx>

```tsx
import { Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <Paragraph>One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
    );
}
```

### Usage

#### Sizes

You can alter the size of the paragraph by specifying a `size` prop. The available sizes match the Hopper Typography Type Scale — a type scale is a set of [font-size and line-height](https://hopper.workleap.design/tokens/semantic/typography#tokens-body) pairs.

```tsx
import { Paragraph, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Paragraph size="xs">One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
            <Paragraph size="sm">One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
            <Paragraph size="md">One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
            <Paragraph size="lg">One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
            <Paragraph size="xl">One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
            <Paragraph size="2xl">One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
        </Stack>
    );
}
```

#### Inherit

You can also alter the size to match the parent element's type scale by using the `inherit` size.

```tsx
import { Div, Paragraph } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div fontSize="body-xs">
            <Paragraph size="inherit">One simple employee experience platform to boost engagement, drive performance, and develop your people. One simple employee experience platform to boost engagement, drive performance, and develop your people.</Paragraph>
        </Div>
    );
}
```

### Props

| Prop      | Type                       | Default | Description                       |
| --------- | -------------------------- | ------- | --------------------------------- |
| style     | `CSSProperties`            |         |                                   |
| className | `string`                   |         |                                   |
| size      | `ResponsiveProp<TextSize>` | "md"    | The Typography Type Scale to use. |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

## PasswordField

A password field is a specialized text field that allows a user to enter a password.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/inputs/src/PasswordField.tsx>

```tsx
import { PasswordField } from "@hopper-ui/components";

export default function Example() {
    return (
        <PasswordField label="Password" />
    );
}
```

### Usage

#### Disabled

A password field in a disabled state shows that an input field exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.

```tsx
import { PasswordField } from "@hopper-ui/components";

export default function Example() {
    return (
        <PasswordField isDisabled label="Password" />
    );
}
```

#### ReadOnly

The `isReadOnly` prop makes the PasswordField's text content immutable. Unlike `isDisabled`, the password field remains focusable and its content can still be copied. See [the MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) for more information.

```tsx
import { PasswordField } from "@hopper-ui/components";

export default function Example() {
    return (
        <PasswordField isReadOnly label="Password" />
    );
}
```

#### Error

A password field can be displayed in an error state to indicate that the user input is invalid.

```tsx
import { PasswordField } from "@hopper-ui/components";

export default function Example() {
    return (
        <PasswordField isInvalid label="Password" errorMessage="Password can't be empty." />
    );
}
```

#### Sizes

Password fields can vary in size.

```tsx
import { PasswordField, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <PasswordField label="Password" size="sm" />
            <PasswordField label="Password" />
        </Stack>
    );
}
```

#### Labeling

If a visible label isn't specified, an aria-label must be provided to the password field for accessibility. If the field is labeled by a separate element, an `aria-labelledby` prop must be provided using the ID of the labeling element instead.

```tsx
import { PasswordField } from "@hopper-ui/components";

export default function Example() {
    return (
        <PasswordField aria-label="Label" />
    );
}
```

#### Description

A password field with a helper message.

```tsx
import { PasswordField } from "@hopper-ui/components";

export default function Example() {
    return (
        <PasswordField label="Password" description="Should contain more than 10 characters" />
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a PasswordField.

```tsx
import { ContextualHelp, PasswordField } from "@hopper-ui/components";

export default function Example() {
    return (
        <PasswordField
            label="Password"
            contextualHelp={<ContextualHelp>Choose a strong password with at least 8 characters, including a mix of letters, numbers, and symbols.</ContextualHelp>}
        />
    );
}
```

### Best Practices

* Be clearly labeled so it's obvious to users what they should enter into the field.
* Be labeled as “Optional” when you need to request input that's not required. View the Form pattern for more details on this.
* Only ask for information that's really needed.
* Validate input as soon as users have finished interacting with a field, but not before.

### Props

| Prop                | Type                                                                                  | Default  | Description                                                                                                                                                                                                                                      |
| ------------------- | ------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| placeholder         | `string`                                                                              |          | The placeholder text when the PasswordField is empty.                                                                                                                                                                                            |
| size                | `ResponsiveProp<FieldSize>`                                                           | "md"     | The size of the PasswordField.                                                                                                                                                                                                                   |
| isFluid             | `ResponsiveProp<boolean>`                                                             | false    | If `true`, the PasswordField will take all available width.                                                                                                                                                                                      |
| inputRef            | `MutableRefObject<HTMLInputElement \| null>`                                          |          | A ref for the HTML input element.                                                                                                                                                                                                                |
| inputGroupProps     | `Partial<InputGroupProps>`                                                            |          | The props for the InputGroup.                                                                                                                                                                                                                    |
| inputProps          | `Partial<InputProps>`                                                                 |          | The props for the Input.                                                                                                                                                                                                                         |
| embeddedButtonProps | `Partial<EmbeddedButtonProps>`                                                        |          | The props for the EmbeddedButton.                                                                                                                                                                                                                |
| form                | `string`                                                                              |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).                     |
| style               | `StyleOrFunction<TextFieldRenderProps>`                                               |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                |
| pattern             | `string`                                                                              |          | Regex pattern that the value of the input must match to be valid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern).                                                                                 |
| validationBehavior  | `"native" \| "aria"`                                                                  | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                                   |
| enterKeyHint        | `"search" \| "enter" \| "done" \| "go" \| "next" \| "previous" \| "send"`             |          | An enumerated attribute that defines what action label or icon to preset for the enter key on virtual keyboards. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint).                                    |
| isDisabled          | `boolean`                                                                             |          | Whether the input is disabled.                                                                                                                                                                                                                   |
| isReadOnly          | `boolean`                                                                             |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                                   |
| isRequired          | `boolean`                                                                             |          | Whether user input is required on the input before form submission.                                                                                                                                                                              |
| isInvalid           | `boolean`                                                                             |          | Whether the value is invalid.                                                                                                                                                                                                                    |
| validate            | `((value: string) => true \| ValidationError \| null)`                                |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead.        |
| autoFocus           | `boolean`                                                                             |          | Whether the element should receive focus on render.                                                                                                                                                                                              |
| value               | `string`                                                                              |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue        | `string`                                                                              |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| autoComplete        | `string`                                                                              |          | Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).                                                            |
| maxLength           | `number`                                                                              |          | The maximum number of characters supported by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength).                                                                                        |
| minLength           | `number`                                                                              |          | The minimum number of characters required by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength).                                                                                         |
| inputMode           | `"search" \| "text" \| "none" \| "tel" \| "url" \| "email" \| "numeric" \| "decimal"` |          | Hints at the type of data that might be entered by the user while editing the element or its contents. See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute).                             |
| autoCorrect         | `string`                                                                              |          | An attribute that takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#autocomplete). |
| spellCheck          | `string`                                                                              |          | An enumerated attribute that defines whether the element may be checked for spelling errors. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).                                                          |
| name                | `string`                                                                              |          | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                                    |
| className           | `ClassNameOrFunction<TextFieldRenderProps>`                                           |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                               |
| dir                 | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| lang                | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| inert               | `boolean`                                                                             |          |                                                                                                                                                                                                                                                  |
| translate           | `"yes" \| "no"`                                                                       |          |                                                                                                                                                                                                                                                  |
| description         | `ReactNode`                                                                           |          | The helper message of the field.                                                                                                                                                                                                                 |
| errorMessage        | `ReactNode \| ((v: ValidationResult) => ReactNode)`                                   |          | The error message of the field.                                                                                                                                                                                                                  |
| label               | `ReactNode`                                                                           |          | The label of the field.                                                                                                                                                                                                                          |
| necessityIndicator  | `NecessityIndicator`                                                                  |          | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                           |
| contextualHelp      | `ReactNode`                                                                           |          | A ContextualHelp element to place next to the label.                                                                                                                                                                                             |

##### Events

| Prop                        | Type                                                   | Default | Description                                                                                                                                                                                                |
| --------------------------- | ------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onFocus                     | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element receives focus.                                                                                                                                                    |
| onBlur                      | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element loses focus.                                                                                                                                                       |
| onFocusChange               | `((isFocused: boolean) => void)`                       |         | Handler that is called when the element's focus status changes.                                                                                                                                            |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is pressed.                                                                                                                                                              |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is released.                                                                                                                                                             |
| onChange                    | `((value: string) => void)`                            |         | Handler that is called when the value changes.                                                                                                                                                             |
| onCopy                      | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).                                                                          |
| onCut                       | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).                                                                             |
| onPaste                     | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).                                                                         |
| onCompositionStart          | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).                   |
| onCompositionEnd            | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event). |
| onCompositionUpdate         | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).              |
| onSelect                    | `ReactEventHandler<HTMLInputElement>`                  |         | Handler that is called when text in the input is selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).                                                               |
| onBeforeInput               | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).                                            |
| onInput                     | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).                                                              |
| onClick                     | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                  | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-activedescendant | `string`                                                                              |         | Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.                                                                                                                                                                              |
| aria-autocomplete     | `"none" \| "inline" \| "list" \| "both"`                                              |         | 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-haspopup         | `boolean \| "dialog" \| "menu" \| "grid" \| "false" \| "true" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls         | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-label            | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby       | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby      | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details          | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |
| excludeFromTabOrder   | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                    | `string`                                                                              |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-errormessage     | `string`                                                                              |         | Identifies the element that provides an error message for the object.                                                                                                                                                                                                                         |

### Migration Notes

* Boolean props are now prefixed by `is`.
* There is no longer a loading state.
* `icon` prop has been renamed to `prefix`.
* Button props have been removed. To add a clear button, use the `isClearable` prop. For a more complex use case, create your own input using InputGroup.
* `wrapperProps` no longer exists.
* `validationState` has been changed to `isInvalid`.

## Popover

A popover displays additional content when a user interacts with a trigger element.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/overlays/popover/src/Popover.tsx>

A popover is a layer that appears above all other content on the page. Only one popover can appear at a time and can contain varying text and interactive elements.

```tsx
import { Button, Content, Footer, Heading, Link, Popover, PopoverTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <PopoverTrigger>
            <Button aria-label="information" variant="secondary">Company Profile</Button>
            <Popover>
                <Heading>ACME</Heading>
                <Content>
                    A tech company focusing on the development of software and hardware solutions.
                </Content>
                <Footer>
                    <Link href="#">Website</Link>
                </Footer>
            </Popover>
        </PopoverTrigger>
    );
}
```

### Anatomy

#### Structure

```tsx
<Popover>
    <Heading /> /* (Optional) Title of the popover */
    <Content /> /* (Required) The content of the popover */
    <Footer /> /* (Optional) Footer content of the popover */
    <Button /> /* (Optional) Action button for the popover */
    <ButtonGroup /> /* (Optional) Group of action buttons for the popover */
</Popover>
```

#### Composed Components

A `Popover` uses the following components:

| Component   | Description                                                                   |
| ----------- | ----------------------------------------------------------------------------- |
| Button      | A button allows a user to initiate an action.                                 |
| ButtonGroup | A button group handles the spacing and orientation for a grouping of buttons. |
| Content     | A placeholder for the main content section of a component.                    |
| Footer      | A placeholder for a footer section.                                           |
| Heading     | A heading is a primitive component matching Hopper's typography type scale.   |

### Usage

#### Disabled

A popover will not open when its trigger is disabled.

```tsx
import { Button, Content, Heading, Popover, PopoverTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <PopoverTrigger>
            <Button isDisabled>Company Profile</Button>
            <Popover>
                <Heading>ACME</Heading>
                <Content>
                    A tech company focusing on the development of software and hardware solutions.
                </Content>
            </Popover>
        </PopoverTrigger>
    );
}
```

#### Single button

A popover can have a single button.

```tsx
import { Button, Content, Heading, Popover, PopoverTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <PopoverTrigger>
            <Button variant="secondary">Company Profile</Button>
            <Popover>
                <Heading>ACME</Heading>
                <Content>
                    A tech company focusing on the development of software and hardware solutions.
                </Content>
                <Button>Apply</Button>
            </Popover>
        </PopoverTrigger>
    );
}
```

#### Multiple buttons

A popover can have a group of buttons.

```tsx
import { Button, ButtonGroup, Content, Heading, Popover, PopoverTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <PopoverTrigger>
            <Button>Company Profile</Button>
            <Popover>
                <Heading>ACME</Heading>
                <Content>
                    A tech company focusing on the development of software and hardware solutions.
                </Content>
                <ButtonGroup>
                    <Button variant="secondary">Follow</Button>
                    <Button>Apply</Button>
                </ButtonGroup>
            </Popover>
        </PopoverTrigger>
    );
}
```

#### Footer text

A popover can have footer text.

```tsx
import { Button, Content, Footer, Heading, Popover, PopoverTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <PopoverTrigger>
            <Button variant="secondary">Company Profile</Button>
            <Popover>
                <Heading>ACME</Heading>
                <Content>
                    A tech company focusing on the development of software and hardware solutions.
                </Content>
                <Footer>
                    1 of 5
                </Footer>
                <Button>Next</Button>
            </Popover>
        </PopoverTrigger>
    );
}
```

#### Placement

A popover can be positioned in different ways `top`, `right`, `bottom`, `left`.

```tsx
import { Button, PopoverTrigger, Popover, Heading, Content, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <PopoverTrigger>
                <Button aria-label="top popover" variant="secondary">Top</Button>
                <Popover placement="top">
                    <Heading>Popover top</Heading>
                    <Content>
                        And here's some amazing content. It's very engaging. Right?
                    </Content>
                </Popover>
            </PopoverTrigger>
            <PopoverTrigger>
                <Button aria-label="right popover" variant="secondary">Right</Button>
                <Popover placement="right">
                    <Heading>Popover right</Heading>
                    <Content>
                        And here's some amazing content. It's very engaging. Right?
                    </Content>
                </Popover>
            </PopoverTrigger>
            <PopoverTrigger>
                <Button aria-label="bottom popover" variant="secondary">Bottom</Button>
                <Popover placement="bottom">
                    <Heading>Popover bottom</Heading>
                    <Content>
                        And here's some amazing content. It's very engaging. Right?
                    </Content>
                </Popover>
            </PopoverTrigger>
            <PopoverTrigger>
                <Button aria-label="left popover" variant="secondary">Left</Button>
                <Popover placement="left">
                    <Heading>Popover left</Heading>
                    <Content>
                        And here's some amazing content. It's very engaging. Right?
                    </Content>
                </Popover>
            </PopoverTrigger>
        </Inline>
    );
}
```

#### Context

A Popover's `isOpen` state or close function can be retrieved from `PopoverContext` and `ButtonContext`.

```tsx
import {
    Button,
    ButtonContext,
    Content,
    Heading,
    Popover,
    PopoverContext,
    PopoverTrigger,
    SlotProvider
} from "@hopper-ui/components";
import { type ReactNode, useRef, useState } from "react";

const HighlightedTrigger = ({ children }: { children: ReactNode }) => {
    const triggerRef = useRef(null);
    const [isOpen, setOpen] = useState(false);

    return (
        <SlotProvider values={[
            [PopoverContext, { isOpen, onOpenChange: setOpen }],
            [ButtonContext, {
                onPress: () => setOpen(!isOpen),
                ref: triggerRef,
                variant: isOpen ? "primary" : "secondary"
            }]
        ]}
        >
            {children}
        </SlotProvider>
    );
};

export default function Example() {
    return (
        <HighlightedTrigger>
            <PopoverTrigger>
                <Button>Company Profile</Button>
                <Popover>
                    <Heading>ACME</Heading>
                    <Content>
                        A tech company focusing on the development of software and hardware solutions.
                    </Content>
                </Popover>
            </PopoverTrigger>
        </HighlightedTrigger>
    );
}
```

#### Controlled

A Popover's open state can be handled in controlled mode.

```tsx
import { Button, Content, Heading, Popover, Stack } from "@hopper-ui/components";
import { useRef, useState } from "react";

export default function Example() {
    const triggerRef = useRef(null);
    const [isOpen, setOpen] = useState(false);

    return (
        <>
            <Stack alignX="center">
                <Button
                    onPress={() => setOpen(!isOpen)}
                    variant="secondary"
                >
                    Company Profile
                </Button>
                <span ref={triggerRef}>Popover will be positioned relative to me</span>
            </Stack>
            <Popover triggerRef={triggerRef} isOpen={isOpen} onOpenChange={setOpen}>
                <Heading>ACME</Heading>
                <Content>
                    A tech company focusing on the development of software and hardware solutions.
                </Content>
            </Popover>
        </>
    );
}
```

#### Styled React Aria Component Popover

If you want to create a custom component using a Popover, and you just need the Popover styles, you can use the `PopoverBase` component instead.

### Best Practices

Popovers should:

* Always be positioned next to the button or other interface element that triggers them. A space of 4px between the element and the popover is required.
* Be used for secondary or less important information and actions since they're hidden until users hit the trigger.
* Contain navigational or actions that share a relationship to each other.

### Props

#### Popover

| Prop                         | Type                                      | Default       | Description                                                                                                                                                                                                                                                                                                               |
| ---------------------------- | ----------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isAutoWidth                  | `boolean`                                 |               | Whether the popover should have an auto width. Only available in non-dialog popovers.                                                                                                                                                                                                                                     |
| boundaryOffset               | `number`                                  |               | The minimum distance the trigger edge should be from the edge of the overlay element.                                                                                                                                                                                                                                     |
| isNonDialog                  | `boolean`                                 |               | Whether the popover is a non-dialog. This is set to true in components such as selects.                                                                                                                                                                                                                                   |
| containerProps               | `PopoverContainerProps`                   |               | The props of the popover's inner container.                                                                                                                                                                                                                                                                               |
| placement                    | `ResponsiveProp<Placement>`               | "bottom"      | The placement of the popover with respect to its anchor element.                                                                                                                                                                                                                                                          |
| style                        | `StyleOrFunction<PopoverRenderProps>`     |               | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                                                                                         |
| isOpen                       | `boolean`                                 |               | Whether the overlay is open by default (controlled).                                                                                                                                                                                                                                                                      |
| containerPadding             | `number`                                  | 12            | The placement padding that should be applied between the element and its surrounding container.                                                                                                                                                                                                                           |
| offset                       | `number`                                  | 8             | The additional offset applied along the main axis between the element and its anchor element.                                                                                                                                                                                                                             |
| crossOffset                  | `number`                                  | 0             | The additional offset applied along the cross axis between the element and its anchor element.                                                                                                                                                                                                                            |
| shouldFlip                   | `boolean`                                 | true          | Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.                                                                                                                                                                        |
| triggerRef                   | `RefObject<Element \| null>`              |               | The ref for the element which the popover positions itself with respect to.When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc., this is set automatically. It is only required when used standalone.                                                                                    |
| boundaryElement              | `Element`                                 | document.body | Element that that serves as the positioning boundary.                                                                                                                                                                                                                                                                     |
| arrowRef                     | `RefObject<Element \| null>`              |               | A ref for the popover arrow element.                                                                                                                                                                                                                                                                                      |
| scrollRef                    | `RefObject<Element \| null>`              | overlayRef    | A ref for the scrollable region within the overlay.                                                                                                                                                                                                                                                                       |
| shouldUpdatePosition         | `boolean`                                 | true          | Whether the overlay should update its position automatically.                                                                                                                                                                                                                                                             |
| arrowBoundaryOffset          | `number`                                  | 0             | The minimum distance the arrow's edge should be from the edge of the overlay element.                                                                                                                                                                                                                                     |
| isNonModal                   | `boolean`                                 |               | Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.Most popovers should not use this option as it may negatively impact the screen reader experience. Only use with components such as combobox, which are designed to handle this situation carefully. |
| isKeyboardDismissDisabled    | `boolean`                                 | false         | Whether pressing the escape key to close the popover should be disabled.Most popovers should not use this option. When set to true, an alternative way to close the popover with a keyboard must be provided.                                                                                                             |
| shouldCloseOnInteractOutside | `((element: Element) => boolean)`         |               | When user interacts with the argument element outside of the popover ref, return true if onClose should be called. This gives you a chance to filter out interaction with elements that should not dismiss the popover. By default, onClose will always be called on interaction outside the popover ref.                 |
| trigger                      | `string`                                  |               | The name of the component that triggered the popover. This is reflected on the element as the `data-trigger` attribute, and can be used to provide specific styles for the popover depending on which element triggered it.                                                                                               |
| isEntering                   | `boolean`                                 |               | Whether the popover is currently performing an entry animation.                                                                                                                                                                                                                                                           |
| isExiting                    | `boolean`                                 |               | Whether the popover is currently performing an exit animation.                                                                                                                                                                                                                                                            |
| UNSTABLE\_portalContainer    | `Element`                                 | document.body | The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to. @deprecated - Use a parent UNSAFE\_PortalProvider to set your portal container instead.                                                                                           |
| defaultOpen                  | `boolean`                                 |               | Whether the overlay is open by default (uncontrolled).                                                                                                                                                                                                                                                                    |
| children                     | `ChildrenOrFunction<PopoverRenderProps>`  |               | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                                                                                                 |
| className                    | `ClassNameOrFunction<PopoverRenderProps>` |               | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                                                                                                        |
| dir                          | `string`                                  |               |                                                                                                                                                                                                                                                                                                                           |
| lang                         | `string`                                  |               |                                                                                                                                                                                                                                                                                                                           |
| inert                        | `boolean`                                 |               |                                                                                                                                                                                                                                                                                                                           |
| translate                    | `"yes" \| "no"`                           |               |                                                                                                                                                                                                                                                                                                                           |

##### Events

| Prop                        | Type                                     | Default | Description                                                   |
| --------------------------- | ---------------------------------------- | ------- | ------------------------------------------------------------- |
| onOpenChange                | `((isOpen: boolean) => void)`            |         | Handler that is called when the overlay's open state changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                               |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                               |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                               |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                               |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

#### PopoverTrigger

| Prop        | Type      | Default | Description                                            |
| ----------- | --------- | ------- | ------------------------------------------------------ |
| isOpen      | `boolean` |         | Whether the overlay is open by default (controlled).   |
| defaultOpen | `boolean` |         | Whether the overlay is open by default (uncontrolled). |

##### Events

| Prop         | Type                          | Default | Description                                                   |
| ------------ | ----------------------------- | ------- | ------------------------------------------------------------- |
| onOpenChange | `((isOpen: boolean) => void)` |         | Handler that is called when the overlay's open state changes. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* The `position` property has been renamed `placement`.

## PopoverBase

A simple React Aria Popover with hopper's styling

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/overlays/popover/src/PopoverBase.tsx>

PopoverBase is a low-level building block that wraps React Aria's Popover to provide core popover functionality with Hopper's design system styling and enhancements. It doesn't impose layout or padding, making it ideal for building custom popover structures from scratch.

### Usage

PopoverBase should be used with `PopoverTrigger` to handle the opening and closing of the popover:

```tsx
import { Button, PopoverBase, PopoverTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <PopoverTrigger>
            <Button aria-label="trigger" variant="secondary">Trigger</Button>
            <PopoverBase>
                Frogs can breathe through their skin
            </PopoverBase>
        </PopoverTrigger>
    );
}
```

### Props

| Prop                         | Type                                      | Default       | Description                                                                                                                                                                                                                                                                                                               |
| ---------------------------- | ----------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| placement                    | `ResponsiveProp<Placement>`               | "bottom"      | The placement of the popover with respect to its anchor element.                                                                                                                                                                                                                                                          |
| style                        | `StyleOrFunction<PopoverRenderProps>`     |               | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                                                                                         |
| isOpen                       | `boolean`                                 |               | Whether the overlay is open by default (controlled).                                                                                                                                                                                                                                                                      |
| containerPadding             | `number`                                  | 12            | The placement padding that should be applied between the element and its surrounding container.                                                                                                                                                                                                                           |
| offset                       | `number`                                  | 8             | The additional offset applied along the main axis between the element and its anchor element.                                                                                                                                                                                                                             |
| crossOffset                  | `number`                                  | 0             | The additional offset applied along the cross axis between the element and its anchor element.                                                                                                                                                                                                                            |
| shouldFlip                   | `boolean`                                 | true          | Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.                                                                                                                                                                        |
| triggerRef                   | `RefObject<Element \| null>`              |               | The ref for the element which the popover positions itself with respect to.When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc., this is set automatically. It is only required when used standalone.                                                                                    |
| boundaryElement              | `Element`                                 | document.body | Element that that serves as the positioning boundary.                                                                                                                                                                                                                                                                     |
| arrowRef                     | `RefObject<Element \| null>`              |               | A ref for the popover arrow element.                                                                                                                                                                                                                                                                                      |
| scrollRef                    | `RefObject<Element \| null>`              | overlayRef    | A ref for the scrollable region within the overlay.                                                                                                                                                                                                                                                                       |
| shouldUpdatePosition         | `boolean`                                 | true          | Whether the overlay should update its position automatically.                                                                                                                                                                                                                                                             |
| arrowBoundaryOffset          | `number`                                  | 0             | The minimum distance the arrow's edge should be from the edge of the overlay element.                                                                                                                                                                                                                                     |
| isNonModal                   | `boolean`                                 |               | Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies.Most popovers should not use this option as it may negatively impact the screen reader experience. Only use with components such as combobox, which are designed to handle this situation carefully. |
| isKeyboardDismissDisabled    | `boolean`                                 | false         | Whether pressing the escape key to close the popover should be disabled.Most popovers should not use this option. When set to true, an alternative way to close the popover with a keyboard must be provided.                                                                                                             |
| shouldCloseOnInteractOutside | `((element: Element) => boolean)`         |               | When user interacts with the argument element outside of the popover ref, return true if onClose should be called. This gives you a chance to filter out interaction with elements that should not dismiss the popover. By default, onClose will always be called on interaction outside the popover ref.                 |
| trigger                      | `string`                                  |               | The name of the component that triggered the popover. This is reflected on the element as the `data-trigger` attribute, and can be used to provide specific styles for the popover depending on which element triggered it.                                                                                               |
| isEntering                   | `boolean`                                 |               | Whether the popover is currently performing an entry animation.                                                                                                                                                                                                                                                           |
| isExiting                    | `boolean`                                 |               | Whether the popover is currently performing an exit animation.                                                                                                                                                                                                                                                            |
| UNSTABLE\_portalContainer    | `Element`                                 | document.body | The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to. @deprecated - Use a parent UNSAFE\_PortalProvider to set your portal container instead.                                                                                           |
| defaultOpen                  | `boolean`                                 |               | Whether the overlay is open by default (uncontrolled).                                                                                                                                                                                                                                                                    |
| children                     | `ChildrenOrFunction<PopoverRenderProps>`  |               | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                                                                                                 |
| className                    | `ClassNameOrFunction<PopoverRenderProps>` |               | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                                                                                                        |
| dir                          | `string`                                  |               |                                                                                                                                                                                                                                                                                                                           |
| lang                         | `string`                                  |               |                                                                                                                                                                                                                                                                                                                           |
| inert                        | `boolean`                                 |               |                                                                                                                                                                                                                                                                                                                           |
| translate                    | `"yes" \| "no"`                           |               |                                                                                                                                                                                                                                                                                                                           |

##### Events

| Prop                        | Type                                     | Default | Description                                                   |
| --------------------------- | ---------------------------------------- | ------- | ------------------------------------------------------------- |
| onOpenChange                | `((isOpen: boolean) => void)`            |         | Handler that is called when the overlay's open state changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                               |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                               |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                               |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                               |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                               |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                               |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                               |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                               |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

## RadioGroup

A radio group is used to group related options together.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/radio/src/RadioGroup.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/radio/>

Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selection at a time. When a user chooses a new item, the previous choice is automatically deselected. They can be used in tiles, data tables, modals, side panels, and in forms on full-page layouts. Radio button can be used to change from one setting to another in a Listbox, page or component. It can often act as a filtering mechanism.

```tsx
import { Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup aria-label="roles">
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
        </RadioGroup>
    );
}
```

### Anatomy

#### Structure

```tsx
<RadioGroup>
    <Radio> /* (Required) A radio button for the RadioGroup */
        <IconList /> /* (Optional) A list of icons in the radio */
        <Icon /> /* (Optional) An icon in the radio */
        <Text /> /* (Optional) Text in the radio, required if using an Icon or an IconList */
    </Radio>
</RadioGroup>
```

#### Composed Components

A `RadioGroup` uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| IconList  | An IconList encapsulates a collection of icons.                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### Label

A radio group can have a label to provide more context to the user.

```tsx
import { Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup label="Roles">
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
            <Radio value="manager">Manager</Radio>
        </RadioGroup>
    );
}
```

#### Disabled

A radio group can be disabled.

```tsx
import { Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup isDisabled aria-label="roles">
            <Radio value="manager">Manager</Radio>
            <Radio value="designer">Designer</Radio>
        </RadioGroup>
    );
}
```

#### Sizes

A radio group can vary in size.

```tsx
import { Inline, Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <RadioGroup size="sm" aria-label="roles">
                <Radio value="manager">Manager</Radio>
                <Radio value="designer">Designer</Radio>
            </RadioGroup>
            <RadioGroup size="md" aria-label="roles">
                <Radio value="manager">Manager</Radio>
                <Radio value="designer">Designer</Radio>
            </RadioGroup>
        </Inline>
    );
}
```

#### Orientation

A radio group can be displayed horizontally or vertically.

```tsx
import { Inline, Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline gap="inline-xl">
            <RadioGroup orientation="horizontal" aria-label="roles">
                <Radio value="manager">Manager</Radio>
                <Radio value="designer">Designer</Radio>
            </RadioGroup>
            <RadioGroup orientation="vertical" aria-label="roles">
                <Radio value="manager">Manager</Radio>
                <Radio value="designer">Designer</Radio>
            </RadioGroup>
        </Inline>
    );
}
```

#### Description

A radio group can have a description to provide more information to the user.

```tsx
import { Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup aria-label="roles" description="Select one to continue">
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
            <Radio value="manager">Manager</Radio>
        </RadioGroup>
    );
}
```

#### Variants

A radio group can be bordered.

```tsx
import { Radio, RadioGroup, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup variant="bordered" aria-label="roles">
            <Radio value="developer"><Text>Developer</Text></Radio>
            <Radio value="designer">
                <Text>Designer</Text>
            </Radio>
        </RadioGroup>
    );
}
```

#### Invalid

A radio group can be invalid.

```tsx
import { Radio, RadioGroup } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [isInvalid, setIsInvalid] = useState(true);

    function onChange(value: string) {
        // if value is empty, then it is invalid
        setIsInvalid(value.length === 0);
    }

    return (
        <RadioGroup
            onChange={onChange}
            isInvalid={isInvalid}
            label="Roles"
            description="These are all excellent roles"
            errorMessage="Check this box and the description will appear"
        >
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
            <Radio value="manager">Manager</Radio>
        </RadioGroup>
    );
}
```

#### Fluid

A radio group can be expanded to full width to fill its parent container.

```tsx
import { Radio, RadioField, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup variant="bordered" isFluid aria-label="roles" description="Select one to continue">
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
            <RadioField description="Team Manager">
                <Radio value="manager">Manager</Radio>
            </RadioField>
        </RadioGroup>
    );
}
```

#### Controlled

A radio group can handle `value` state in controlled mode.

```tsx
import { Radio, RadioField, RadioGroup } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selected, setSelected] = useState<string>("designer");

    return (
        <RadioGroup
            aria-label="Roles"
            value={selected}
            onChange={setSelected}
        >
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
            <RadioField description="Team Manager">
                <Radio value="manager">Manager</Radio>
            </RadioField>
        </RadioGroup>
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a RadioGroup.

```tsx
import { ContextualHelp, Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup aria-label="roles" label="Roles" contextualHelp={<ContextualHelp>These are all possible roles</ContextualHelp>}>
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
            <Radio value="manager">Manager</Radio>
        </RadioGroup>
    );
}
```

#### No Label on Items

A radio component can be rendered without a label.

```tsx
import { Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup aria-label="roles">
            <Radio value="label" aria-label="Label"></Radio>
        </RadioGroup>
    );
}
```

#### Disabled Items

A radio component can be disabled.

```tsx
import { Radio, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup aria-label="roles">
            <Radio value="manager" isDisabled>Manager</Radio>
            <Radio value="designer">Designer</Radio>
        </RadioGroup>
    );
}
```

#### Description on Items

A radio component can have a description to provide more information to the user.

```tsx
import { Radio, RadioField, RadioGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <RadioGroup aria-label="roles">
            <Radio value="developer">Developer</Radio>
            <Radio value="designer">Designer</Radio>
            <RadioField description="Team Manager">
                <Radio value="manager">Manager</Radio>
            </RadioField>
        </RadioGroup>
    );
}
```

#### Icon

Each radio can be customized with an icon or an icon list.

```tsx
import { IconList, Radio, RadioGroup, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <RadioGroup aria-label="roles">
            <Radio value="developer"><SparklesIcon /><Text>Developer</Text></Radio>
            <Radio value="designer">
                <Text>Designer</Text>
                <IconList>
                    <SparklesIcon /><SparklesIcon /><SparklesIcon />
                </IconList>
            </Radio>
        </RadioGroup>
    );
}
```

### Best Practices

Radio buttons should:

* Always be used with an associated label component.

* Be part of a list of radio buttons that:

  * Include at least two or more choices.
  * Are used to have users select only one option.
  * Include mutually exclusive options–this means that each option must be independant from every other option in the list.
  * List options in a logical order.
  * Have a default option selected whenever possible.

#### Alignment

Radio button labels are positioned to the right of their inputs. As a grouping, they have to be laid out vertically.

#### Placement

Radio buttons are often used in forms. In a forms, they should be placed at least 24px below or before the next component. A space of 8px between each radio button in a grouping is necessary.

#### Overflow content

We recommend radio button labels being fewer than three words. If you are tight on space, consider rewording the label. Do not truncate the radio button label text with an ellipsis. Long labels may wrap to a second line, and this is preferable to truncation. Text should wrap beneath the radio button so the control and label are top aligned.

#### States

The radio button input allows for two states: unselected and selected. The default view of a radio button is having at least one radio button preselected. Only one radio should be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.

#### Grouping in a wrapper

When the Radio group is the only control in the container, or if you need to bring an intentional prominence to this control, we suggest to organize the Radio within a wrapper and to use the Medium size which will bring more scannability to the options.

### Props

#### RadioGroup

| Prop               | Type                                                           | Default      | Description                                                                                                                                                                                                                               |
| ------------------ | -------------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| listProps          | `RadioListProps`                                               |              | The props of the list element that wraps the Radio components.                                                                                                                                                                            |
| orientation        | `ResponsiveProp<Orientation>`                                  | "vertical"   | A RadioGroup can be displayed horizontally or vertically.                                                                                                                                                                                 |
| variant            | `InputGroupVariant`                                            | "borderless" | A RadioGroup has two variants: borderless and bordered.                                                                                                                                                                                   |
| isFluid            | `ResponsiveProp<boolean>`                                      | false        | If `true`, the RadioGroup will take all available width.                                                                                                                                                                                  |
| form               | `string`                                                       |              | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).              |
| style              | `StyleOrFunction<RadioGroupRenderProps>`                       |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                         |
| children           | `ChildrenOrFunction<RadioGroupRenderProps>`                    |              | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                                 |
| validationBehavior | `"native" \| "aria"`                                           | 'native'     | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                            |
| name               | `string`                                                       |              | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                             |
| value              | `string \| null`                                               |              | The current value (controlled).                                                                                                                                                                                                           |
| defaultValue       | `string \| null`                                               |              | The default value (uncontrolled).                                                                                                                                                                                                         |
| isDisabled         | `boolean`                                                      |              | Whether the input is disabled.                                                                                                                                                                                                            |
| isReadOnly         | `boolean`                                                      |              | Whether the input can be selected but not changed by the user.                                                                                                                                                                            |
| isRequired         | `boolean`                                                      |              | Whether user input is required on the input before form submission.                                                                                                                                                                       |
| isInvalid          | `boolean`                                                      |              | Whether the input value is invalid.                                                                                                                                                                                                       |
| validate           | `((value: string \| null) => true \| ValidationError \| null)` |              | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead. |
| className          | `ClassNameOrFunction<RadioGroupRenderProps>`                   |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                        |
| dir                | `string`                                                       |              |                                                                                                                                                                                                                                           |
| lang               | `string`                                                       |              |                                                                                                                                                                                                                                           |
| inert              | `boolean`                                                      |              |                                                                                                                                                                                                                                           |
| translate          | `"yes" \| "no"`                                                |              |                                                                                                                                                                                                                                           |
| description        | `ReactNode`                                                    |              | The helper message of the field.                                                                                                                                                                                                          |
| errorMessage       | `ReactNode \| ((v: ValidationResult) => ReactNode)`            |              | The error message of the field.                                                                                                                                                                                                           |
| label              | `ReactNode`                                                    |              | The label of the field.                                                                                                                                                                                                                   |
| necessityIndicator | `NecessityIndicator`                                           |              | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                    |
| size               | `ResponsiveProp<FieldSize>`                                    | "md"         | A Field can vary in size.                                                                                                                                                                                                                 |
| contextualHelp     | `ReactNode`                                                    |              | A ContextualHelp element to place next to the label.                                                                                                                                                                                      |

##### Events

| Prop                        | Type                                          | Default | Description                                                     |
| --------------------------- | --------------------------------------------- | ------- | --------------------------------------------------------------- |
| onChange                    | `((value: string) => void)`                   |         | Handler that is called when the value changes.                  |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element receives focus.         |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element loses focus.            |
| onFocusChange               | `((isFocused: boolean) => void)`              |         | Handler that is called when the element's focus status changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`           |         |                                                                 |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`         |         |                                                                 |
| onScroll                    | `UIEventHandler<HTMLDivElement>`              |         |                                                                 |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`              |         |                                                                 |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`           |         |                                                                 |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`           |         |                                                                 |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`       |         |                                                                 |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`      |         |                                                                 |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop              | Type     | Default | Description                                                                                                         |
| ----------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id                | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label        | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby   | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby  | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details      | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| aria-errormessage | `string` |         | Identifies the element that provides an error message for the object.                                               |

#### Radio

| Prop       | Type                                    | Default | Description                                                                                                                                                                        |
| ---------- | --------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| size       | `ResponsiveProp<FieldSize>`             | "md"    | A radio can vary in size.                                                                                                                                                          |
| style      | `StyleOrFunction<RadioRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| children   | `ChildrenOrFunction<RadioRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| value      | `string`                                |         | The value of the radio button, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#Value).                          |
| isDisabled | `boolean`                               |         | Whether the radio button is disabled or not. Shows that a selection exists, but is not available in that circumstance.                                                             |
| autoFocus  | `boolean`                               |         | Whether the element should receive focus on render.                                                                                                                                |
| dir        | `string`                                |         |                                                                                                                                                                                    |
| lang       | `string`                                |         |                                                                                                                                                                                    |
| inert      | `boolean`                               |         |                                                                                                                                                                                    |
| translate  | `"yes" \| "no"`                         |         |                                                                                                                                                                                    |
| inputRef   | `RefObject<HTMLInputElement \| null>`   |         | A ref for the HTML input element.                                                                                                                                                  |
| className  | `ClassNameOrFunction<RadioRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLLabelElement>`                   |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLLabelElement>`                        |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLLabelElement>`                        |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLLabelElement>`                     |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLLabelElement>`                 |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLLabelElement>`                |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

#### RadioGroup

Coming from Orbiter, you should be aware of the following changes:

* `required` has been renamed to `isRequired`.
* `onChange` signature has changed (no event are passed).
* `disabled` has been renamed to `isDisabled`.
* `autofocus` is not supported. You must use `autofocus` on the actual Radio.
* `fluid` has been renamed to `isFluid`.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* The default orientation is now vertical instead of horizontal.
* `validationState` has been removed. Use `isInvalid` instead. There is no `isValid`.
* `wrap` has been removed. If `horizontal`, radios will wrap.
* There is no `align` prop. If needed, the styled system can be used.
* `inline` prop is not available.

#### Radio

Coming from Orbiter, you should be aware of the following changes:

* The `Counter` component is no longer allowed as a specialized slot.
* Values are not auto-generated when missed.
* `onChange` is only supported on `RadioGroup`, not on `Radio`.
* `onValueChange` has been deleted, use `onChange` instead.
* `checked` has been renamed to `isSelected`.
* `disabled` has been renamed to `isDisabled`.
* `required` has been renamed to `isRequired`.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* `validationState` has been removed. Yse `isInvalid` instead. There is no `isValid`.
* `value` is required.

## RangeCalendar

A range calendar displays one or more date grids and allows users to select a contiguous range of dates.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/calendar/src/RangeCalendar.tsx>

```tsx
import { RangeCalendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <RangeCalendar aria-label="Trip dates" />
    );
}
```

### Usage

#### Value

A RangeCalendar has no selection by default. An initial, uncontrolled value can be provided to the RangeCalendar using the `defaultValue` prop. Alternatively, a controlled value can be provided using the `value` prop.

Date values are provided using objects in the [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/index.html) package. This library handles correct international date manipulation across calendars, time zones, and other localization concerns.

RangeCalendar supports values with both date and time components, but only allows users to modify the date. By default, RangeCalendar will emit `CalendarDate` objects in the onChange event, but if a `CalendarDateTime` or `ZonedDateTime` object is passed as the value or defaultValue, values of that type will be emitted, changing only the date and preserving the time components.

```tsx
import { Inline, RangeCalendar, type RangeValue } from "@hopper-ui/components";
import { type DateValue, parseDate } from "@internationalized/date";
import { useState } from "react";

export default function Example() {
    const [value, setValue] = useState<RangeValue<DateValue>>({
        start: parseDate("2020-02-03"),
        end: parseDate("2020-02-12")
    });

    return (
        <Inline>
            <RangeCalendar
                aria-label="Trip dates (uncontrolled)"
                defaultValue={{
                    start: parseDate("2020-02-03"),
                    end: parseDate("2020-02-10")
                }}
            />
            <RangeCalendar
                aria-label="Trip dates (controlled)"
                value={value}
                onChange={setValue}
            />
        </Inline>
    );
}
```

#### Controlled

A range calendar can handle value state in controlled mode.

```tsx
import { Paragraph, RangeCalendar, type RangeValue, Stack } from "@hopper-ui/components";
import { type DateValue, getLocalTimeZone, parseDate } from "@internationalized/date";
import { useState } from "react";
import { useDateFormatter } from "react-aria";

export default function Example() {
    const [range, setRange] = useState<RangeValue<DateValue>>({
        start: parseDate("2020-07-03"),
        end: parseDate("2020-07-10")
    });
    const formatter = useDateFormatter({ dateStyle: "full" });

    return (
        <Stack>
            <RangeCalendar
                aria-label="Trip dates"
                value={range}
                onChange={setRange}
            />
            <Paragraph>
                Selected date: {formatter.formatRange(
                    range.start.toDate(getLocalTimeZone()),
                    range.end.toDate(getLocalTimeZone())
                )}
            </Paragraph>
        </Stack>
    );
}
```

#### Multi-month

Multiple CalendarGrid elements can be rendered to show multiple months at once. The `visibleMonths` prop should be provided to the Calendar component to specify how many months are visible.

```tsx
import { RangeCalendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <RangeCalendar aria-label="Trip dates" visibleMonths={3} />
    );
}
```

##### Page Behavior

The `pageBehavior` prop allows you to control how the calendar navigates between months. By default, the calendar will navigate by `visibleMonths`, but by setting `pageBehavior` to `single`, pagination will be by one month.

```tsx
import { RangeCalendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <RangeCalendar aria-label="Trip dates" visibleMonths={3} pageBehavior="single" />
    );
}
```

##### Fixed weeks

The `isFixedWeeks` prop allows you to control whether the calendar displays fixed weeks. By default, the calendar will display variable weeks, but by setting `isFixedWeeks` to true, all months will be displayed with 6 weeks. This ensures that the height of the calendar does not change when navigating between months.

```tsx
import { RangeCalendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <RangeCalendar aria-label="Trip dates" isFixedWeeks />
    );
}
```

#### Validation

##### Min and Max

The `minValue` and `maxValue` props can be used to limit the range of dates that a user can select.

```tsx
import { RangeCalendar } from "@hopper-ui/components";
import { getLocalTimeZone, today } from "@internationalized/date";

export default function Example() {
    return (
        <RangeCalendar
            aria-label="Trip dates"
            minValue={today(getLocalTimeZone())}
        />
    );
}
```

##### Unavailable Dates

RangeCalendar supports marking certain dates as unavailable. These dates remain focusable with the keyboard so that navigation is consistent, but cannot be selected by the user. In this example, they are displayed in red. The `isDateUnavailable` prop accepts a callback that is called to evaluate whether each visible date is unavailable.

Note that by default, users may not select non-contiguous ranges, i.e. ranges that contain unavailable dates within them. Once a start date is selected, enabled dates will be restricted to subsequent dates until an unavailable date is hit. See [below](#non-contiguous-ranges) for an example of how to allow non-contiguous ranges.

This example includes multiple unavailable date ranges, e.g. dates when a rental house is not available. The `minValue` prop is also used to prevent selecting dates before today.

```tsx
import { RangeCalendar } from "@hopper-ui/components";
import { type DateValue, getLocalTimeZone, today } from "@internationalized/date";

export default function Example() {
    const now = today(getLocalTimeZone());
    const disabledRanges = [
        [now, now.add({ days: 5 })],
        [now.add({ days: 14 }), now.add({ days: 16 })],
        [now.add({ days: 23 }), now.add({ days: 24 })]
    ];

    const isDateUnavailable = (date: DateValue) =>
        disabledRanges.some(interval => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0);

    return (
        <RangeCalendar aria-label="Trip dates" minValue={today(getLocalTimeZone())} isDateUnavailable={isDateUnavailable} />
    );
}
```

##### Non-contiguous ranges

The `allowsNonContiguousRanges` prop enables a range to be selected even if there are unavailable dates in the middle. The value emitted in the onChange event will still be a single range with a start and end property, but unavailable dates will not be displayed as selected. It is up to applications to split the full selected range into multiple as needed for business logic.

This example prevents selecting weekends, but allows selecting ranges that span multiple weeks.

```tsx
import { RangeCalendar, useLocale } from "@hopper-ui/components";
import { isWeekend } from "@internationalized/date";

export default function Example() {
    const { locale } = useLocale();

    return (
        <RangeCalendar
            aria-label="Trip dates"
            isDateUnavailable={date => isWeekend(date, locale)}
            allowsNonContiguousRanges
        />
    );
}
```

##### Error message

RangeCalendar tries to avoid allowing the user to select invalid dates in the first place. However, if according to application logic a selected date range is invalid, the `isInvalid` prop can be set. This alerts assistive technology users that the selection is invalid, and can be used for styling purposes as well. In addition, the `errorMessage` slot may be used to help the user fix the issue.

This example validates that the selected date range is a maximum of 1 week in duration.

```tsx
import { RangeCalendar, type RangeValue } from "@hopper-ui/components";
import { type DateValue, getLocalTimeZone, today } from "@internationalized/date";
import { useState } from "react";

export default function Example() {
    const [range, setRange] = useState<RangeValue<DateValue>>({
        start: today(getLocalTimeZone()),
        end: today(getLocalTimeZone()).add({
            weeks: 1,
            days: 3
        })
    });

    const isInvalid = range.end.compare(range.start) > 7;

    return (
        <RangeCalendar
            aria-label="Trip dates"
            value={range}
            onChange={setRange}
            isInvalid={isInvalid}
            errorMessage="Maximum stay duration is 1 week"
        />
    );
}
```

#### Disabled

A range calendar can be disabled.

```tsx
import { RangeCalendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <RangeCalendar aria-label="Trip dates" isDisabled />
    );
}
```

#### Read-only

A range calendar can be read-only.

```tsx
import { RangeCalendar } from "@hopper-ui/components";
import { parseDate } from "@internationalized/date";

export default function Example() {
    return (
        <RangeCalendar
            defaultValue={{
                start: parseDate("2020-02-03"),
                end: parseDate("2020-02-10")
            }}
            aria-label="Trip dates"
            isReadOnly
        />
    );
}
```

#### Custom First Day of the Week

By default, the first day of the week is automatically set based on the current locale. This can be changed by setting the `firstDayOfWeek` prop to "sun", "mon", "tue", "wed", "thu", "fri", or "sat".

```tsx
import { RangeCalendar } from "@hopper-ui/components";

export default function Example() {
    return (
        <RangeCalendar aria-label="Trip dates" firstDayOfWeek="mon" />
    );
}
```

### Props

| Prop                      | Type                                                          | Default  | Description                                                                                                                                                                                                                                      |
| ------------------------- | ------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| errorMessage              | `ReactNode`                                                   |          | The error message to display when the range calendar is invalid.                                                                                                                                                                                 |
| visibleMonths             | `number`                                                      | 1        | The number of months to display at once.                                                                                                                                                                                                         |
| isFixedWeeks              | `boolean`                                                     | false    | Whether the calendar should always display 6 weeks.                                                                                                                                                                                              |
| allowsNonContiguousRanges | `boolean`                                                     |          | When combined with `isDateUnavailable`, determines whether non-contiguous ranges, i.e. ranges containing unavailable dates, may be selected.                                                                                                     |
| minValue                  | `DateValue \| null`                                           |          | The minimum allowed date that a user may select.                                                                                                                                                                                                 |
| maxValue                  | `DateValue \| null`                                           |          | The maximum allowed date that a user may select.                                                                                                                                                                                                 |
| isDateUnavailable         | `((date: DateValue) => boolean)`                              |          | Callback that is called for each date of the calendar. If it returns true, then the date is unavailable.                                                                                                                                         |
| isDisabled                | `boolean`                                                     | false    | Whether the calendar is disabled.                                                                                                                                                                                                                |
| isReadOnly                | `boolean`                                                     | false    | Whether the calendar value is immutable.                                                                                                                                                                                                         |
| autoFocus                 | `boolean`                                                     | false    | Whether to automatically focus the calendar when it mounts.                                                                                                                                                                                      |
| focusedValue              | `DateValue \| null`                                           |          | Controls the currently focused date within the calendar.                                                                                                                                                                                         |
| defaultFocusedValue       | `DateValue \| null`                                           |          | The date that is focused when the calendar first mounts (uncountrolled).                                                                                                                                                                         |
| isInvalid                 | `boolean`                                                     |          | Whether the current selection is invalid according to application logic.                                                                                                                                                                         |
| pageBehavior              | `PageBehavior`                                                | visible  | Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.                                                                                              |
| firstDayOfWeek            | `"sun" \| "mon" \| "tue" \| "wed" \| "thu" \| "fri" \| "sat"` |          | The day that starts the week.                                                                                                                                                                                                                    |
| selectionAlignment        | `"center" \| "start" \| "end"`                                | 'center' | Determines the alignment of the visible months on initial render based on the current selection or current date if there is no selection.                                                                                                        |
| value                     | `RangeValue<DateValue> \| null`                               |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue              | `RangeValue<DateValue> \| null`                               |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| createCalendar            | `((identifier: CalendarIdentifier) => Calendar)`              |          | A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a given calendar identifier. If not provided, the `createCalendar` function from `@internationalized/date` will be used. |
| style                     | `CSSProperties`                                               |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.                                                                                                                                          |
| className                 | `string`                                                      |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.                                                                                                                                         |
| children                  | `ReactNode`                                                   |          | The children of the component.                                                                                                                                                                                                                   |

##### Events

| Prop          | Type                                       | Default | Description                                           |
| ------------- | ------------------------------------------ | ------- | ----------------------------------------------------- |
| onFocusChange | `((date: CalendarDate) => void)`           |         | Handler that is called when the focused date changes. |
| onChange      | `((value: RangeValue<DateValue>) => void)` |         | Handler that is called when the value changes.        |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

## RichIcon

A rich icon component is used to render a rich custom icon.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/icons/src/RichIcon.tsx>

```tsx
import { createRichIcon } from "@hopper-ui/icons";

import { SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40 } from "../src/index.ts";

const CustomRichIcon = createRichIcon(SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40, "SparklesRichIcon");

export default function Example() {
    return (
        <CustomRichIcon />
    );
}
```

Similar to icons, RichIcons are vibrant and colorful. Perfect for decorative purposes or drawing attention to specific elements.

Hopper provides multiple ways to use rich icons in your project:

* Using the [Workleap icon library](/icons/overview/introduction.md)
* [Creating your own icons](#creating-your-custom-rich-icons)

### Creating your custom rich icons

To use an rich icon component to create custom rich icons you must first import your SVG icon as a component by using [`@svgr/webpack`](https://react-svgr.com/docs/getting-started/).

Hopper provides two methods for creating your custom icons:

* Using the `createRichIcon` function (recommended)
* Using the `RichIcon` component

Both `RichIcon` and `createRichIcon` enable you to style the icon using the styled system.

#### Using the createRichIcon function

The `createRichIcon` function is a convenience wrapper around the process of generating rich icons with `RichIcon`, allowing you to achieve the same functionality with less effort.

```tsx
import CustomRichIcon24 from "./path/to/custom-rich-icon-24.svg";
import CustomRichIcon32 from "./path/to/custom-rich-icon-32.svg";
import CustomRichIcon40 from "./path/to/custom-rich-icon-40.svg";
import { createRichIcon } from "@hopper-ui/icons";

const CustomRichIcon = createRichIcon(CustomRichIcon24, CustomRichIcon32, CustomRichIcon40, "CustomIcon")
```

#### Using the RichIcon component

```tsx
import CustomRichIcon24 from "./path/to/custom-icon-24.svg"
import CustomRichIcon32 from "./path/to/custom-icon-32.svg"
import CustomRichIcon40 from "./path/to/custom-icon-40.svg"
import { Icon, type CreatedRichIconProps } from "@hopper-ui/icons";

function CustomRichIcon(props: CreatedRichIconProps) {
  return (
    <RichIcon
        src24={CustomIcon24}
        src32={CustomRichIcon24}
        src40={CustomRichIcon32}
        {...props} />
  )
}
```

#### Sizes

A rich icon can vary in size. When used inside another component, it'll generally be sized automatically. If you use a standalone icon, you can use the size prop to control the sizing.

```tsx
import { Inline } from "@hopper-ui/components";
import { createRichIcon } from "@hopper-ui/icons";

import { SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40 } from "../src/index.ts";

const CustomRichIcon = createRichIcon(SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40, "SparklesRichIcon");

export default function Example() {
    return (
        <Inline>
            <CustomRichIcon size="md" />
            <CustomRichIcon size="lg" />
            <CustomRichIcon size="xl" />
        </Inline>
    );
}
```

#### Styling

The color of the rich icon can be changed using the `fill` prop. All the styled system props are also available.

```tsx
import { createRichIcon } from "@hopper-ui/icons";

import { SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40 } from "../src/index.ts";

const CustomRichIcon = createRichIcon(SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40, "SparklesRichIcon");

export default function Example() {
    return (
        <CustomRichIcon fill="primary" />
    );
}
```

#### Variants

The color of the rich icon can be changed using the `variant` prop.

```tsx
import { Inline, Stack } from "@hopper-ui/components";
import { createRichIcon } from "@hopper-ui/icons";

import { SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40 } from "../src/index.ts";

const CustomRichIcon = createRichIcon(SparklesRichIcon24, SparklesRichIcon32, SparklesRichIcon40, "SparklesRichIcon");

export default function Example() {
    return (
        <Inline alignY="flex-start">
            <Stack>
                <CustomRichIcon variant="option1" />
                <CustomRichIcon variant="option2" />
                <CustomRichIcon variant="option3" />
                <CustomRichIcon variant="option4" />
                <CustomRichIcon variant="option5" />
                <CustomRichIcon variant="option6" />
                <CustomRichIcon variant="option7" />
                <CustomRichIcon variant="option8" />
            </Stack>
            <Stack>
                <CustomRichIcon variant="success" />
                <CustomRichIcon variant="warning" />
                <CustomRichIcon variant="danger" />
                <CustomRichIcon variant="information" />
                <CustomRichIcon variant="upsell" />
            </Stack>
        </Inline>
    );
}
```

### Props

| Prop      | Type                                                                               | Default   | Description                                 |
| --------- | ---------------------------------------------------------------------------------- | --------- | ------------------------------------------- |
| style     | `CSSProperties`                                                                    |           |                                             |
| className | `string`                                                                           |           |                                             |
| variant   | `RichIconVariant`                                                                  | "option7" | The visual style of the icon.               |
| size      | `ResponsiveProp<"md" \| "lg" \| "xl">`                                             | "lg"      | The size of the icon.                       |
| src24     | `ElementType<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>` |           | The source of the icon with a size of 24px. |
| src32     | `ElementType<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>` |           | The source of the icon with a size of 32px. |
| src40     | `ElementType<Omit<SVGProps<SVGSVGElement>, "ref"> & RefAttributes<SVGSVGElement>>` |           | The source of the icon with a size of 40px. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

## SearchField

A search field is a specialized text input allowing the user to perform a search.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/inputs/src/SearchField.tsx>

```tsx
import { SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField placeholder="New York, NY" label="Filter by location" />
    );
}
```

### Usage

#### Disabled

A search field in a disabled state shows that an input field exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.

```tsx
import { SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField placeholder="New York, NY" isDisabled label="Filter by location" />
    );
}
```

#### ReadOnly

The `isReadOnly` prop makes the SearchField's text content immutable. Unlike `isDisabled`, the search field remains focusable and the contents can still be copied. See [the MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) for more information.

```tsx
import { SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField placeholder="New York, NY" isReadOnly label="Filter by location" />
    );
}
```

#### Error

A search field can be displayed in an error state to indicate that the user input is invalid.

```tsx
import { SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField placeholder="New York, NY" isInvalid label="Filter by location" errorMessage="No results were found" />
    );
}
```

#### Hide Clear Button

A search field can hide its clear button.

```tsx
import { SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField placeholder="New York, NY" isClearable={false} label="Filter by location" />
    );
}
```

#### Sizes

Search fields have multiple sizes to choose from.

```tsx
import { SearchField, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <SearchField label="Filter by location" placeholder="New York, NY" size="sm" />
            <SearchField label="Filter by location" placeholder="New York, NY" />
        </Stack>
    );
}
```

#### Labeling

If a visible label isn't specified, an `aria-label` must be provided to the search field for accessibility. If the field is labeled by a separate element, an `aria-labelledby` prop must be provided using the ID of the labeling element instead.

```tsx
import { SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField placeholder="New York, NY" aria-label="Filter by location" />
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a SearchField.

```tsx
import { ContextualHelp, SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField
            placeholder="New York, NY"
            label="Filter by location"
            contextualHelp={<ContextualHelp>There's tons of locations, search for one!</ContextualHelp>}
        />
    );
}
```

#### Description

A search field with a helper message.

```tsx
import { SearchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SearchField placeholder="New York, NY" label="Filter by location" description="Search by city, state, or postal code" />
    );
}
```

#### Debounce

The `useDebounce` hook can be used to debounce user input in a search field.

```tsx
import { Paragraph, SearchField, Stack, useDebounce } from "@hopper-ui/components";
import { useEffect, useState } from "react";

export default function Example() {
    const [inputValue, setInputValue] = useState("");
    const [debouncedQuery, setDebouncedQuery] = useDebounce("", 400);
    const [results, setResults] = useState<string[]>([]);

    const handleInputChange = (value: string) => {
        setInputValue(value);
        setDebouncedQuery(value);
    };

    useEffect(() => {
        if (debouncedQuery.trim()) {
            // Simulate search - only runs after 400ms of no typing
            const fruits = ["Apple", "Banana", "Cherry", "Date", "Elderberry"];
            const filtered = fruits.filter(fruit =>
                fruit.toLowerCase().includes(debouncedQuery.toLowerCase())
            );
            setResults(filtered);
        } else {
            setResults([]);
        }
    }, [debouncedQuery]);

    return (
        <Stack>
            <SearchField
                value={inputValue}
                onChange={handleInputChange}
                placeholder="Search fruits..."
                label="Search"
            />
            <Paragraph>Results: {results.join(", ")}</Paragraph>
        </Stack>
    );
}
```

### Best Practices

* Be clearly labeled so it's obvious to users what they should enter into the field.
* Be labeled as “Optional” when you need to request input that's not required. View the Form pattern for more details on this.
* Only ask for information that's really needed.
* Validate input as soon as users have finished interacting with a field, but not before.

### Props

| Prop               | Type                                                                                  | Default  | Description                                                                                                                                                                                                                                      |
| ------------------ | ------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| isClearable        | `boolean`                                                                             | true     | Whether the SearchField is clearable.                                                                                                                                                                                                            |
| placeholder        | `string`                                                                              |          | The placeholder text when the SearchField is empty.                                                                                                                                                                                              |
| isFluid            | `ResponsiveProp<boolean>`                                                             | false    | If `true`, the SearchField will take all available width.                                                                                                                                                                                        |
| icon               | `ReactNode`                                                                           |          | An icon to display at the start of the input.                                                                                                                                                                                                    |
| inputRef           | `MutableRefObject<HTMLInputElement \| null>`                                          |          | A ref for the HTML input element.                                                                                                                                                                                                                |
| inputProps         | `Partial<InputProps>`                                                                 |          | The props for the Input.                                                                                                                                                                                                                         |
| inputGroupProps    | `Partial<InputGroupProps>`                                                            |          | The props for the InputGroup.                                                                                                                                                                                                                    |
| clearButtonProps   | `Partial<ClearButtonProps>`                                                           |          | The props for the EmbeddedButton.                                                                                                                                                                                                                |
| form               | `string`                                                                              |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).                     |
| style              | `StyleOrFunction<SearchFieldRenderProps>`                                             |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                |
| pattern            | `string`                                                                              |          | Regex pattern that the value of the input must match to be valid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern).                                                                                 |
| validationBehavior | `"native" \| "aria"`                                                                  | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                                   |
| type               | `"search" \| "text" \| (string & {}) \| "url" \| "tel" \| "email" \| "password"`      | 'search' | The type of input to render. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype).                                                                                                                         |
| enterKeyHint       | `"search" \| "enter" \| "done" \| "go" \| "next" \| "previous" \| "send"`             |          | An enumerated attribute that defines what action label or icon to preset for the enter key on virtual keyboards. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint).                                    |
| isDisabled         | `boolean`                                                                             |          | Whether the input is disabled.                                                                                                                                                                                                                   |
| isReadOnly         | `boolean`                                                                             |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                                   |
| isRequired         | `boolean`                                                                             |          | Whether user input is required on the input before form submission.                                                                                                                                                                              |
| isInvalid          | `boolean`                                                                             |          | Whether the input value is invalid.                                                                                                                                                                                                              |
| validate           | `((value: string) => true \| ValidationError \| null)`                                |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead.        |
| autoFocus          | `boolean`                                                                             |          | Whether the element should receive focus on render.                                                                                                                                                                                              |
| value              | `string`                                                                              |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue       | `string`                                                                              |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| autoComplete       | `string`                                                                              |          | Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).                                                            |
| maxLength          | `number`                                                                              |          | The maximum number of characters supported by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength).                                                                                        |
| minLength          | `number`                                                                              |          | The minimum number of characters required by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength).                                                                                         |
| inputMode          | `"search" \| "text" \| "none" \| "url" \| "tel" \| "email" \| "numeric" \| "decimal"` |          | Hints at the type of data that might be entered by the user while editing the element or its contents. See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute).                             |
| autoCorrect        | `string`                                                                              |          | An attribute that takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#autocomplete). |
| spellCheck         | `string`                                                                              |          | An enumerated attribute that defines whether the element may be checked for spelling errors. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).                                                          |
| name               | `string`                                                                              |          | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                                    |
| className          | `ClassNameOrFunction<SearchFieldRenderProps>`                                         |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                               |
| dir                | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| lang               | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| inert              | `boolean`                                                                             |          |                                                                                                                                                                                                                                                  |
| translate          | `"yes" \| "no"`                                                                       |          |                                                                                                                                                                                                                                                  |
| description        | `ReactNode`                                                                           |          | The helper message of the field.                                                                                                                                                                                                                 |
| errorMessage       | `ReactNode \| ((v: ValidationResult) => ReactNode)`                                   |          | The error message of the field.                                                                                                                                                                                                                  |
| label              | `ReactNode`                                                                           |          | The label of the field.                                                                                                                                                                                                                          |
| necessityIndicator | `NecessityIndicator`                                                                  |          | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                           |
| size               | `ResponsiveProp<FieldSize>`                                                           | "md"     | A Field can vary in size.                                                                                                                                                                                                                        |
| contextualHelp     | `ReactNode`                                                                           |          | A ContextualHelp element to place next to the label.                                                                                                                                                                                             |

##### Events

| Prop                        | Type                                                   | Default | Description                                                                                                                                                                                                |
| --------------------------- | ------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onFocus                     | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element receives focus.                                                                                                                                                    |
| onBlur                      | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element loses focus.                                                                                                                                                       |
| onFocusChange               | `((isFocused: boolean) => void)`                       |         | Handler that is called when the element's focus status changes.                                                                                                                                            |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is pressed.                                                                                                                                                              |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is released.                                                                                                                                                             |
| onChange                    | `((value: string) => void)`                            |         | Handler that is called when the value changes.                                                                                                                                                             |
| onCopy                      | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).                                                                          |
| onCut                       | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).                                                                             |
| onPaste                     | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).                                                                         |
| onCompositionStart          | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).                   |
| onCompositionEnd            | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event). |
| onCompositionUpdate         | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).              |
| onSelect                    | `ReactEventHandler<HTMLInputElement>`                  |         | Handler that is called when text in the input is selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).                                                               |
| onBeforeInput               | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).                                            |
| onInput                     | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).                                                              |
| onSubmit                    | `((value: string) => void)`                            |         | Handler that is called when the SearchField is submitted.                                                                                                                                                  |
| onClear                     | `(() => void)`                                         |         | Handler that is called when the clear button is pressed.                                                                                                                                                   |
| onClick                     | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                  | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-activedescendant | `string`                                                                              |         | Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.                                                                                                                                                                              |
| aria-autocomplete     | `"none" \| "inline" \| "list" \| "both"`                                              |         | 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-haspopup         | `boolean \| "dialog" \| "menu" \| "grid" \| "false" \| "true" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls         | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-label            | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby       | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby      | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details          | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |
| excludeFromTabOrder   | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                    | `string`                                                                              |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-errormessage     | `string`                                                                              |         | Identifies the element that provides an error message for the object.                                                                                                                                                                                                                         |

### Migration Notes

* Boolean props are now prefixed by `is`.
* There is no longer a loading state.
* `icon` prop has been renamed to `prefix`.
* Button props have been removed. To add a clear button, use the `isClearable` prop. For a more complex use case, create your own input using InputGroup.
* `wrapperProps` no longer exists.
* `validationState` has been changed to `isInvalid`.

## SegmentedControl

The SegmentedControl component presents a horizontal row of options or actions that are contextually or conceptually related. It allows users to select a single option at a time.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/segmented-control/src/SegmentedControl.tsx>

```tsx
import { SegmentedControl, SegmentedControlItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <SegmentedControl aria-label="Time granularity">
            <SegmentedControlItem id="day">Day</SegmentedControlItem>
            <SegmentedControlItem id="week">Week</SegmentedControlItem>
            <SegmentedControlItem id="month">Month</SegmentedControlItem>
            <SegmentedControlItem id="year">Year</SegmentedControlItem>
        </SegmentedControl>
    );
}
```

### Usage

#### Selected

A segmented control can have an item initially selected, by using `defaultSelectedKey` for uncontrolled or `selectedKey` for controlled. Here's an example where one item is selected using defaultSelectedKey.

```tsx
import { SegmentedControl, SegmentedControlItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <SegmentedControl aria-label="Time granularity" defaultSelectedKey="day">
            <SegmentedControlItem id="day">Day</SegmentedControlItem>
            <SegmentedControlItem id="week">Week</SegmentedControlItem>
            <SegmentedControlItem id="month">Month</SegmentedControlItem>
            <SegmentedControlItem id="year">Year</SegmentedControlItem>
        </SegmentedControl>
    );
}
```

#### Size

A segmented control supports multiple sizes. Here's an example demonstrating the medium size option:

```tsx
import { SegmentedControl, SegmentedControlItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <SegmentedControl aria-label="Time granularity" defaultSelectedKey="day" size="md">
            <SegmentedControlItem id="day">Day</SegmentedControlItem>
            <SegmentedControlItem id="week">Week</SegmentedControlItem>
            <SegmentedControlItem id="month">Month</SegmentedControlItem>
            <SegmentedControlItem id="year">Year</SegmentedControlItem>
        </SegmentedControl>
    );
}
```

#### Icon only

Items within a segmented control can contain only icons. An accessible name must be provided through [aria-label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) prop. See also [WCAG practices](https://www.w3.org/TR/WCAG20-TECHS/ARIA6.html).

```tsx
import { SegmentedControl, SegmentedControlItem } from "@hopper-ui/components";
import { OrderedListIcon, UnorderedListIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <SegmentedControl aria-label="List ordering">
            <SegmentedControlItem id="unordered">
                <UnorderedListIcon aria-label="unordered" />
            </SegmentedControlItem>
            <SegmentedControlItem id="ordered">
                <OrderedListIcon aria-label="ordered" />
            </SegmentedControlItem>
        </SegmentedControl>
    );
}
```

#### Icon

A segmented control can contain items with icons, starting or ending. **Non standard** starting icons can be provided to handle special cases. However, think twice before adding start icons, end icons should be your go to.

```tsx
import { SegmentedControl, SegmentedControlItem, Text } from "@hopper-ui/components";
import { OrderedListIcon, UnorderedListIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <SegmentedControl aria-label="List ordering">
            <SegmentedControlItem id="unordered">
                <UnorderedListIcon slot="start-icon" />
                <Text>Unordered</Text>
            </SegmentedControlItem>
            <SegmentedControlItem id="ordered">
                <Text>Ordered</Text>
                <OrderedListIcon />
            </SegmentedControlItem>
        </SegmentedControl>
    );
}
```

#### Justified

A segmented control can have items with similar widths.

```tsx
import { SegmentedControl, SegmentedControlItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <SegmentedControl UNSAFE_width="400px" isJustified aria-label="Time granularity">
            <SegmentedControlItem id="day">Day</SegmentedControlItem>
            <SegmentedControlItem id="week">Week</SegmentedControlItem>
            <SegmentedControlItem id="month">Month</SegmentedControlItem>
            <SegmentedControlItem id="year">Year</SegmentedControlItem>
        </SegmentedControl>
    );
}
```

#### Controlled

A segmented control can have a controlled selected value. In this example, it shows how it is possible to select an option.

```tsx
import { SegmentedControl, SegmentedControlItem, type Key } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [selectedKey, setSelectedKey] = useState<Key>("day");

    const handleSelectionChange = (key: Key) => {
        if (selectedKey === key) {
            return;
        }

        setSelectedKey(key);
    };

    return (
        <SegmentedControl
            aria-label="Time granularity"
            selectedKey={selectedKey}
            onSelectionChange={handleSelectionChange}
        >
            <SegmentedControlItem id="day">Day</SegmentedControlItem>
            <SegmentedControlItem id="week">Week</SegmentedControlItem>
            <SegmentedControlItem id="month">Month</SegmentedControlItem>
            <SegmentedControlItem id="year">Year</SegmentedControlItem>
        </SegmentedControl>
    );
}
```

### Best Practices

Segmented control should follow the same guidelines as the Button component. Plus, they should:

* Group together calls to action that have a relationship.
* Be used with consideration that too many calls to action can cause users to be unsure of what to do next.
* Be thoughtful about how multiple calls to action will look on smaller screens.

### Props

#### SegmentedControl

| Prop               | Type                                       | Default | Description                                                                                              |
| ------------------ | ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------- |
| isDisabled         | `boolean`                                  |         | Whether the segmented control is disabled.                                                               |
| isJustified        | `boolean`                                  |         | Whether the items should divide the container width equally.                                             |
| selectedKey        | `Key`                                      |         | The id of the currently selected item (controlled).                                                      |
| defaultSelectedKey | `Key`                                      |         | The id of the initial selected item (uncontrolled).                                                      |
| size               | `ResponsiveProp<SegmentedControlItemSize>` | "sm"    | The size of the controls. \*                                                                             |
| style              | `CSSProperties`                            |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children           | `ReactNode`                                |         | The children of the component.                                                                           |
| className          | `string`                                   |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Events

| Prop              | Type                  | Default | Description                                        |
| ----------------- | --------------------- | ------- | -------------------------------------------------- |
| onSelectionChange | `((id: Key) => void)` |         | Handler that is called when the selection changes. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

#### SegmentedControlItem

| Prop       | Type                                       | Default | Description                                                                                              |
| ---------- | ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------- |
| id         | `Key`                                      |         | The id of the item, matching the value used in SegmentedControl's `selectedKey` prop.                    |
| isDisabled | `boolean`                                  |         | Whether the item is disabled or not.                                                                     |
| size       | `ResponsiveProp<SegmentedControlItemSize>` | "sm"    | The size of the item. \*                                                                                 |
| style      | `CSSProperties`                            |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |
| children   | `ReactNode`                                |         | The children of the component.                                                                           |
| className  | `string`                                   |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

## Select

A select displays a collapsible list of options from which the user can select one.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/select/src/Select.tsx>

The select component collects user-provided information from a list of options. Selects are usually used in forms where a user submits data and chooses one option from a list. Use the select component inside a form where users are selecting from a list of option and submitting data.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select label="Roles">
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

### Anatomy

#### Structure

```tsx
<Select>
    <SelectItem> /* (Required) The items of the select */
        <Avatar /> /* (Optional) An avatar for the item */
        <Text /> /* (Optional) The text content of the item, required if using another element */
        <Text slot="description" /> /* (Optional) A description for the item */
        <Badge /> /* (Optional) A badge for the item */
        <Icon /> /* (Optional) An icon for the item */
    </SelectItem>
    <SelectSection> /* (Optional) A section of select items */
        <Header /> /* (Optional) A header for the section */
        <SelectItem /> /* (Required) An item in the SelectSection */
    </SelectSection>
</Select>
```

#### Composed Components

A `Select` uses the following components:

| Component | Description                                                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Avatar    | Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available. |
| Badge     | A badge is used to bring attention to an element.                                                                                                  |
| Header    | A placeholder for an header section.                                                                                                               |
| Icon      | An icon component is used to render a custom icon.                                                                                                 |
| Text      | A text component is a primitive component matching Hopper's typography type scale.                                                                 |

### Usage

#### Disabled

A select in a disabled state shows that it exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            isDisabled
            label="Roles"
        >
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Disabled Item

A select with a disabled item.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            disabledKeys={["developer"]}
            aria-label="list of options"
        >
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Error

A select can be displayed in an error state to indicate that the selection is invalid.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            isInvalid
            label="Roles"
            errorMessage="This field is required"
        >
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Sizes

A select has multiple sizes to choose from. The select menu also changes size based on the size of the select.

```tsx
import { Select, SelectItem, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Select label="Roles">
                <SelectItem id="designer">Designer</SelectItem>
                <SelectItem id="developer">Developer</SelectItem>
                <SelectItem id="manager">Manager</SelectItem>
            </Select>
            <Select size="md" label="Roles">
                <SelectItem id="designer">Designer</SelectItem>
                <SelectItem id="developer">Developer</SelectItem>
                <SelectItem id="manager">Manager</SelectItem>
            </Select>
        </Stack>
    );
}
```

#### Labeling

If a visible label isn't specified, an `aria-label` must be provided to the select for accessibility. If the field is labeled by a separate element, an `aria-labelledby` prop must be provided using the ID of the labeling element instead.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select aria-label="Roles">
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Icon Prefix

An icon can be displayed at the start of the select trigger.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";
import { OrgChartIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Select
            prefix={<OrgChartIcon />}
            label="Roles"
        >
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Text Prefix

A short text can be displayed at the start of the select trigger.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            prefix="Operations"
            label="Roles"
        >
            <SelectItem id="project-coordinator">Project Coordinator</SelectItem>
            <SelectItem id="qa-specialist">QA Specialist</SelectItem>
            <SelectItem id="system-administrator">System Administrator</SelectItem>
        </Select>
    );
}
```

#### Fluid

A select can take the width of its container.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            isFluid
            label="Roles"
        >
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Custom Value

A select's trigger value can be customized using the `renderValue` function to allow other elements such as an avatar or icon inside the trigger value.

```tsx
import { Avatar, Select, SelectItem, Text, type ValueRenderProps } from "@hopper-ui/components";

import { users, type User } from "./data.ts";

const renderValue = ({ defaultChildren, selectedItem }: ValueRenderProps<User>) => {
    if (selectedItem) {
        const { name, avatar } = selectedItem;

        return (
            <>
                <Avatar name={name} src={avatar} />
                <Text>{name}</Text>
            </>
        );
    }

    return defaultChildren;
};

export default function Example() {
    const [firstUser] = users;

    return (
        <Select
            renderValue={renderValue}
            defaultValue={firstUser.id}
            items={users}
            label="Users"
        >
            {({ id, name, avatar, role }) => {
                return (
                    <SelectItem id={id} textValue={name}>
                        <Avatar name={name} src={avatar} />
                        <Text>{name}</Text>
                        <Text slot="description">{role}</Text>
                    </SelectItem>
                );
            }}
        </Select>
    );
}
```

#### Controlled

A select can have a controlled selected value. In this example, it shows how it is possible to deselect an option.

```tsx
import { Header, Select, SelectItem, SelectSection, type Key } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [value, setValue] = useState<Key | null>();

    const handleSelectionChange = (key: Key | null) => {
        if (value === key) {
            setValue(null);
        } else {
            setValue(key);
        }
    };

    return (
        <Select value={value} onChange={handleSelectionChange} label="Roles">
            <SelectSection>
                <Header>Operations</Header>
                <SelectItem id="1">Project Coordinator</SelectItem>
                <SelectItem id="2">QA Specialist</SelectItem>
            </SelectSection>
            <SelectItem id="3">Manager</SelectItem>
        </Select>
    );
}
```

#### Form

A select can be part of a form. To submit the value of a select, make sure you specify the `name` property.

```tsx
import { Form, Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Form>
            <Select
                name="roles"
                label="Roles"
            >
                <SelectItem id="designer">Designer</SelectItem>
                <SelectItem id="developer">Developer</SelectItem>
                <SelectItem id="manager">Manager</SelectItem>
            </Select>
        </Form>
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a Select.

```tsx
import { ContextualHelp, Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select label="Roles" contextualHelp={<ContextualHelp>These are all possible roles</ContextualHelp>}>
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Auto Menu Width

A select can have a menu that automatically adjusts its width based on the longest item.

```tsx
import { Select, SelectItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            aria-label="list of options with a description"
            isAutoMenuWidth
        >
            <SelectItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </SelectItem>
            <SelectItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </SelectItem>
            <SelectItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </SelectItem>
        </Select>
    );
}
```

#### Menu placement

A select's menu can have a customized menu placement using the `direction` and `align` props.

```tsx
import { Select, SelectItem } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            aria-label="Roles"
            isAutoMenuWidth
            align="start"
            direction="top"
        >
            <SelectItem id="designer">Designer</SelectItem>
            <SelectItem id="developer">Developer</SelectItem>
            <SelectItem id="manager">Manager</SelectItem>
        </Select>
    );
}
```

#### Section

A select can have sections and section headers.

```tsx
import { Header, Select, SelectItem, SelectSection } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select aria-label="list of options">
            <SelectItem>Developer</SelectItem>
            <SelectItem>Manager</SelectItem>
            <SelectSection>
                <Header>Creative Department</Header>
                <SelectItem>Designer</SelectItem>
                <SelectItem>Copywriter</SelectItem>
                <SelectItem>UX Researcher</SelectItem>
            </SelectSection>
            <SelectSection>
                <Header>Operations</Header>
                <SelectItem>Project Coordinator</SelectItem>
                <SelectItem>QA Specialist</SelectItem>
            </SelectSection>
            <SelectItem>Product Owner</SelectItem>
        </Select>
    );
}
```

#### Footer

A select can have a footer.

```tsx
import { Button, Select, SelectItem, Text } from "@hopper-ui/components";
import { AddIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Select
            aria-label="list of options with a description"
            footer={<Button variant="ghost-secondary" isFluid><AddIcon /><Text>Add</Text></Button>}
        >
            <SelectItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </SelectItem>
            <SelectItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </SelectItem>
            <SelectItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </SelectItem>
        </Select>
    );
}
```

#### Avatar

A select option can contain an avatar.

```tsx
import { Avatar, Select, SelectItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select aria-label="Team">
            <SelectItem textValue="Fred Smith">
                <Avatar src="https://i.pravatar.cc/96?img=3" name="Fred Smith" />
                <Text>Fred Smith</Text>
            </SelectItem>
            <SelectItem textValue="Karen Smith">
                <Avatar name="Karen Smith" />
                <Text>Karen Smith</Text>
            </SelectItem>
            <SelectItem textValue="John Doe">
                <Avatar name="John Doe" />
                <Text>John Doe</Text>
            </SelectItem>
        </Select>
    );
}
```

#### Count

A select option can contain a count using a badge.

```tsx
import { Badge, Select, SelectItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select aria-label="list of options">
            <SelectItem textValue="Designer">
                <Text>Designer</Text>
                <Badge>50</Badge>
            </SelectItem>
            <SelectItem textValue="Developer">
                <Badge variant="secondary">99+</Badge>
                <Text>Developer</Text>
            </SelectItem>
            <SelectItem>Manager</SelectItem>
        </Select>
    );
}
```

#### Dynamic Lists

Options and sections can be populated from a hierarchial data structure. If a section has a header, the `Collection` component can be used to render the child items.

```tsx
import { Collection, Header, Select, SelectItem, SelectSection } from "@hopper-ui/components";

const OPTIONS = [
    {
        role: "Operations", children: [
            { id: 2, role: "Project Coordinator" },
            { id: 3, role: "QA Specialist" },
            { id: 4, role: "System Administrator" }
        ]
    },
    {
        role: "Creative Department", children: [
            { id: 6, role: "Designer" },
            { id: 7, role: "Designer" },
            { id: 8, role: "UX Researcher" }
        ]
    }
];

export default function Example() {
    return (
        <Select items={OPTIONS} label="Section">
            {section => {
                const { role: sectionName, children } = section;

                return (
                    <SelectSection id={sectionName}>
                        <Header>{sectionName}</Header>
                        <Collection items={children}>
                            {item => <SelectItem id={item.id}>{item.role}</SelectItem>}
                        </Collection>
                    </SelectSection>
                );
            }}
        </Select>
    );
}
```

#### Icons

A select option can contain icons.

```tsx
import { IconList, Select, SelectItem, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Select aria-label="list of options">
            <SelectItem textValue="Designer">
                <Text>Designer</Text>
                <IconList>
                    <SparklesIcon /><SparklesIcon /><SparklesIcon />
                </IconList>
            </SelectItem>
            <SelectItem textValue="Developer">
                <SparklesIcon />
                <Text>Developer</Text>
            </SelectItem>
            <SelectItem>Manager</SelectItem>
        </Select>
    );
}
```

#### End Icons

A select can contain icons at the end of an option.

```tsx
import { IconList, Select, SelectItem, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Select aria-label="list of options">
            <SelectItem textValue="Designer">
                <Text>Designer</Text>
                <IconList slot="end-icon">
                    <SparklesIcon /><SparklesIcon /><SparklesIcon />
                </IconList>
            </SelectItem>
            <SelectItem textValue="Developer">
                <SparklesIcon slot="end-icon" />
                <Text>Developer</Text>
            </SelectItem>
            <SelectItem>Manager</SelectItem>
        </Select>
    );
}
```

#### Loading

A select can have a loading state.

```tsx
import { Select } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select
            aria-label="list of options"
            isLoading
        >
            {[]}
        </Select>
    );
}
```

#### Load on scroll

A select can load more items when scrolling within.

```tsx
import { Select, SelectItem, useAsyncList } from "@hopper-ui/components";

interface Character {
    name: string;
}

export default function Example() {
    const list = useAsyncList<Character>({
        async load({ signal, cursor }) {
            const res = await fetch(cursor || "https://pokeapi.co/api/v2/pokemon", {
                signal
            });
            const json = await res.json();

            return {
                items: json.results,
                cursor: json.next
            };
        }
    });

    return (
        <Select
            aria-label="list of options"
            items={list.items}
            isLoading={list.isLoading}
            onLoadMore={() => list.loadMore()}
            listBoxProps={{
                maxHeight: "core_1280"
            }}
        >
            {item => {
                const { name } = item;

                return <SelectItem id={name}>{name}</SelectItem>;
            }}
        </Select>
    );
}
```

#### Selection indicator

A select can have a different selection indicator.

```tsx
import { Select, SelectItem, Text, type Key } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [value, setValue] = useState<Key | null>("1");

    return (
        <Select
            aria-label="list of options"
            value={value}
            onChange={setValue}
            selectionIndicator="input"
        >
            <SelectItem textValue="Developer" id="1">
                <Text>Developer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </SelectItem>
            <SelectItem textValue="Designer" id="2">
                <Text>Designer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </SelectItem>
            <SelectItem textValue="Manager" id="3">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </SelectItem>
        </Select>
    );
}
```

#### Description

A select item can have a description.

```tsx
import { Select, SelectItem, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Select aria-label="list of options with a description">
            <SelectItem textValue="Developer">
                <Text>Developer</Text>
                <Text slot="description">Builds and maintains software.</Text>
            </SelectItem>
            <SelectItem textValue="Designer">
                <Text>Designer</Text>
                <Text slot="description">Creates visual design solutions.</Text>
            </SelectItem>
            <SelectItem textValue="Manager">
                <Text>Manager</Text>
                <Text slot="description">Leads teams and projects.</Text>
            </SelectItem>
        </Select>
    );
}
```

#### Filterable

A select can include a [SearchField](/components/SearchField.md) to filter items in the dropdown. This is useful for long lists where users need to quickly find specific options, to enable this use the `isFilterable` prop.

```tsx
import { Select, SelectItem, Text } from "@hopper-ui/components";

const ANIMALS = [
    { id: "aardvark", name: "Aardvark", description: "A nocturnal mammal that feeds on ants and termites" },
    { id: "albatross", name: "Albatross", description: "A large seabird with long narrow wings" },
    { id: "alligator", name: "Alligator", description: "A large reptile with a powerful tail and strong jaws" },
    { id: "bear", name: "Bear", description: "A large mammal with thick fur and a strong build" },
    { id: "cat", name: "Cat", description: "A small domesticated carnivorous mammal" },
    { id: "dog", name: "Dog", description: "A domesticated carnivorous mammal and loyal companion" },
    { id: "elephant", name: "Elephant", description: "The largest land mammal with a long trunk" },
    { id: "fox", name: "Fox", description: "A small omnivorous mammal known for its cunning" },
    { id: "giraffe", name: "Giraffe", description: "The tallest land animal with a very long neck" },
    { id: "horse", name: "Horse", description: "A large domesticated mammal used for riding and transport" },
    { id: "iguana", name: "Iguana", description: "A large tropical lizard with a spiny back" },
    { id: "jaguar", name: "Jaguar", description: "A large spotted cat native to the Americas" },
    { id: "kangaroo", name: "Kangaroo", description: "A marsupial that hops on powerful hind legs" },
    { id: "lion", name: "Lion", description: "A large tawny-colored cat known as the king of the jungle" },
    { id: "monkey", name: "Monkey", description: "A primate with a long tail and high intelligence" }
];

export default function Example() {
    return (
        <Select
            label="Select an animal"
            items={ANIMALS}
            isFilterable
        >
            {(item: typeof ANIMALS[0]) => (
                <SelectItem id={item.id} textValue={item.name}>
                    <Text>{item.name}</Text>
                    <Text slot="description">{item.description}</Text>
                </SelectItem>
            )}
        </Select>
    );
}
```

#### Multiple Selection

If you want to allow users to select multiple options from a list, use the `MultiSelect` component.

```tsx
import { MultiSelect, MultiSelectItem, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <MultiSelect label="Roles" defaultValue={["designer", "developer"]}>
                <MultiSelectItem id="designer">Designer</MultiSelectItem>
                <MultiSelectItem id="developer">Developer</MultiSelectItem>
                <MultiSelectItem id="manager">Manager</MultiSelectItem>
            </MultiSelect>
            <MultiSelect size="md" label="Roles" defaultValue={["designer", "developer"]}>
                <MultiSelectItem id="designer">Designer</MultiSelectItem>
                <MultiSelectItem id="developer">Developer</MultiSelectItem>
                <MultiSelectItem id="manager">Manager</MultiSelectItem>
            </MultiSelect>
        </Stack>
    );
}
```

#### Multiple Selection with custom value display

Use the `renderValue` prop to customize how the selected values are displayed in the trigger of a `MultiSelect`.

```tsx
import { MultiSelect, MultiSelectItem, Stack } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <MultiSelect label="Roles" defaultValue={["designer", "developer"]} renderValue={value => `Selected ${value.selectedItems.length}`}>
                <MultiSelectItem id="designer">Designer</MultiSelectItem>
                <MultiSelectItem id="developer">Developer</MultiSelectItem>
                <MultiSelectItem id="manager">Manager</MultiSelectItem>
            </MultiSelect>
        </Stack>
    );
}
```

### Best Practices

The select component should:

* Be used for selecting between four or more pre-defined options.
* Have a default option selected whenever possible

#### Overflow content

Avoid having multiple lines of text in a select. If the text is too long for one line, add an ellipsis for overflow content, and accompany with a browser-based tooltip to show the full string of text.

### Props

#### Select

| Prop               | Type                                          | Default | Description                                                                                                                                                                                         |
| ------------------ | --------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isLoading          | `boolean`                                     |         | Whether the item is loading.                                                                                                                                                                        |
| size               | `ResponsiveProp<ListBoxItemSize>`             | "sm"    | A ListBoxItem can vary in size.                                                                                                                                                                     |
| isInvalid          | `boolean`                                     |         | Whether or not the ListBoxItem is in an invalid state.                                                                                                                                              |
| selectionIndicator | `SelectionIndicator`                          | "check" | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be an either a radio or checkbox based on the selection mode. |
| radioProps         | `DecorativeRadioProps`                        |         | The props for the Radio.                                                                                                                                                                            |
| checkboxProps      | `DecorativeCheckboxProps`                     |         | The props for the Checkbox.                                                                                                                                                                         |
| style              | `StyleOrFunction<ListBoxItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                   |
| dir                | `string`                                      |         |                                                                                                                                                                                                     |
| lang               | `string`                                      |         |                                                                                                                                                                                                     |
| inert              | `boolean`                                     |         |                                                                                                                                                                                                     |
| translate          | `"yes" \| "no"`                               |         |                                                                                                                                                                                                     |
| id                 | `Key`                                         |         | The unique id of the item.                                                                                                                                                                          |
| value              | `object`                                      |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                                              |
| textValue          | `string`                                      |         | A string representation of the item's contents, used for features like typeahead.                                                                                                                   |
| isDisabled         | `boolean`                                     |         | Whether the item is disabled.                                                                                                                                                                       |
| children           | `ChildrenOrFunction<ListBoxItemRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                           |
| className          | `ClassNameOrFunction<ListBoxItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                  |
| href               | `string`                                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                      |
| hrefLang           | `string`                                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                      |
| target             | `HTMLAttributeAnchorTarget`                   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                      |
| rel                | `string`                                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                     |
| download           | `string \| boolean`                           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                    |
| ping               | `string`                                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                      |
| referrerPolicy     | `HTMLAttributeReferrerPolicy`                 |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                    |
| routerOptions      | `undefined`                                   |         | Options for the configured client side router.                                                                                                                                                      |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

#### SelectSection

| Prop         | Type                                                                                  | Default | Description                                                                                               |
| ------------ | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| style        | `CSSProperties`                                                                       |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.   |
| children     | `ReactNode \| ((item: T) => ReactElement<any, string \| JSXElementConstructor<any>>)` |         | Static child items or a function to render children.                                                      |
| items        | `Iterable<T>`                                                                         |         | Item objects in the section.                                                                              |
| id           | `Key`                                                                                 |         | The unique id of the section.                                                                             |
| value        | `object`                                                                              |         | The object value that this section represents. When using dynamic collections, this is set automatically. |
| dependencies | `readonly any[]`                                                                      |         | Values that should invalidate the item cache when using dynamic collections.                              |
| className    | `string`                                                                              |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.  |
| dir          | `string`                                                                              |         |                                                                                                           |
| lang         | `string`                                                                              |         |                                                                                                           |
| inert        | `boolean`                                                                             |         |                                                                                                           |
| translate    | `"yes" \| "no"`                                                                       |         |                                                                                                           |

##### Events

| Prop                        | Type                                  | Default | Description |
| --------------------------- | ------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |             |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                             |
| ---------- | -------- | ------- | --------------------------------------- |
| aria-label | `string` |         | An accessibility label for the section. |

#### SelectItem

| Prop               | Type                                          | Default | Description                                                                                                                                                                                         |
| ------------------ | --------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isLoading          | `boolean`                                     |         | Whether the item is loading.                                                                                                                                                                        |
| size               | `ResponsiveProp<ListBoxItemSize>`             | "sm"    | A ListBoxItem can vary in size.                                                                                                                                                                     |
| isInvalid          | `boolean`                                     |         | Whether or not the ListBoxItem is in an invalid state.                                                                                                                                              |
| selectionIndicator | `SelectionIndicator`                          | "check" | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be an either a radio or checkbox based on the selection mode. |
| radioProps         | `DecorativeRadioProps`                        |         | The props for the Radio.                                                                                                                                                                            |
| checkboxProps      | `DecorativeCheckboxProps`                     |         | The props for the Checkbox.                                                                                                                                                                         |
| style              | `StyleOrFunction<ListBoxItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                   |
| dir                | `string`                                      |         |                                                                                                                                                                                                     |
| lang               | `string`                                      |         |                                                                                                                                                                                                     |
| inert              | `boolean`                                     |         |                                                                                                                                                                                                     |
| translate          | `"yes" \| "no"`                               |         |                                                                                                                                                                                                     |
| id                 | `Key`                                         |         | The unique id of the item.                                                                                                                                                                          |
| value              | `object`                                      |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                                              |
| textValue          | `string`                                      |         | A string representation of the item's contents, used for features like typeahead.                                                                                                                   |
| isDisabled         | `boolean`                                     |         | Whether the item is disabled.                                                                                                                                                                       |
| children           | `ChildrenOrFunction<ListBoxItemRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                           |
| className          | `ClassNameOrFunction<ListBoxItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                  |
| href               | `string`                                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                      |
| hrefLang           | `string`                                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                      |
| target             | `HTMLAttributeAnchorTarget`                   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                      |
| rel                | `string`                                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                     |
| download           | `string \| boolean`                           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                    |
| ping               | `string`                                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                      |
| referrerPolicy     | `HTMLAttributeReferrerPolicy`                 |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                    |
| routerOptions      | `undefined`                                   |         | Options for the configured client side router.                                                                                                                                                      |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

#### MultiSelect

| Prop               | Type                                          | Default | Description                                                                                                                                                                                         |
| ------------------ | --------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isLoading          | `boolean`                                     |         | Whether the item is loading.                                                                                                                                                                        |
| size               | `ResponsiveProp<ListBoxItemSize>`             | "sm"    | A ListBoxItem can vary in size.                                                                                                                                                                     |
| isInvalid          | `boolean`                                     |         | Whether or not the ListBoxItem is in an invalid state.                                                                                                                                              |
| selectionIndicator | `SelectionIndicator`                          | "check" | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be an either a radio or checkbox based on the selection mode. |
| radioProps         | `DecorativeRadioProps`                        |         | The props for the Radio.                                                                                                                                                                            |
| checkboxProps      | `DecorativeCheckboxProps`                     |         | The props for the Checkbox.                                                                                                                                                                         |
| style              | `StyleOrFunction<ListBoxItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                   |
| dir                | `string`                                      |         |                                                                                                                                                                                                     |
| lang               | `string`                                      |         |                                                                                                                                                                                                     |
| inert              | `boolean`                                     |         |                                                                                                                                                                                                     |
| translate          | `"yes" \| "no"`                               |         |                                                                                                                                                                                                     |
| id                 | `Key`                                         |         | The unique id of the item.                                                                                                                                                                          |
| value              | `object`                                      |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                                              |
| textValue          | `string`                                      |         | A string representation of the item's contents, used for features like typeahead.                                                                                                                   |
| isDisabled         | `boolean`                                     |         | Whether the item is disabled.                                                                                                                                                                       |
| children           | `ChildrenOrFunction<ListBoxItemRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                           |
| className          | `ClassNameOrFunction<ListBoxItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                  |
| href               | `string`                                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                      |
| hrefLang           | `string`                                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                      |
| target             | `HTMLAttributeAnchorTarget`                   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                      |
| rel                | `string`                                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                     |
| download           | `string \| boolean`                           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                    |
| ping               | `string`                                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                      |
| referrerPolicy     | `HTMLAttributeReferrerPolicy`                 |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                    |
| routerOptions      | `undefined`                                   |         | Options for the configured client side router.                                                                                                                                                      |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

#### MultiSelectSection

| Prop         | Type                                                                                  | Default | Description                                                                                               |
| ------------ | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| style        | `CSSProperties`                                                                       |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.   |
| children     | `ReactNode \| ((item: T) => ReactElement<any, string \| JSXElementConstructor<any>>)` |         | Static child items or a function to render children.                                                      |
| items        | `Iterable<T>`                                                                         |         | Item objects in the section.                                                                              |
| id           | `Key`                                                                                 |         | The unique id of the section.                                                                             |
| value        | `object`                                                                              |         | The object value that this section represents. When using dynamic collections, this is set automatically. |
| dependencies | `readonly any[]`                                                                      |         | Values that should invalidate the item cache when using dynamic collections.                              |
| className    | `string`                                                                              |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.  |
| dir          | `string`                                                                              |         |                                                                                                           |
| lang         | `string`                                                                              |         |                                                                                                           |
| inert        | `boolean`                                                                             |         |                                                                                                           |
| translate    | `"yes" \| "no"`                                                                       |         |                                                                                                           |

##### Events

| Prop                        | Type                                  | Default | Description |
| --------------------------- | ------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLElement>` |         |             |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                             |
| ---------- | -------- | ------- | --------------------------------------- |
| aria-label | `string` |         | An accessibility label for the section. |

#### MultiSelectItem

| Prop               | Type                                          | Default | Description                                                                                                                                                                                         |
| ------------------ | --------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isLoading          | `boolean`                                     |         | Whether the item is loading.                                                                                                                                                                        |
| size               | `ResponsiveProp<ListBoxItemSize>`             | "sm"    | A ListBoxItem can vary in size.                                                                                                                                                                     |
| isInvalid          | `boolean`                                     |         | Whether or not the ListBoxItem is in an invalid state.                                                                                                                                              |
| selectionIndicator | `SelectionIndicator`                          | "check" | The selection indicator to use. Only available if the selection mode is not "none". When set to "input", the selection indicator will be an either a radio or checkbox based on the selection mode. |
| radioProps         | `DecorativeRadioProps`                        |         | The props for the Radio.                                                                                                                                                                            |
| checkboxProps      | `DecorativeCheckboxProps`                     |         | The props for the Checkbox.                                                                                                                                                                         |
| style              | `StyleOrFunction<ListBoxItemRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                   |
| dir                | `string`                                      |         |                                                                                                                                                                                                     |
| lang               | `string`                                      |         |                                                                                                                                                                                                     |
| inert              | `boolean`                                     |         |                                                                                                                                                                                                     |
| translate          | `"yes" \| "no"`                               |         |                                                                                                                                                                                                     |
| id                 | `Key`                                         |         | The unique id of the item.                                                                                                                                                                          |
| value              | `object`                                      |         | The object value that this item represents. When using dynamic collections, this is set automatically.                                                                                              |
| textValue          | `string`                                      |         | A string representation of the item's contents, used for features like typeahead.                                                                                                                   |
| isDisabled         | `boolean`                                     |         | Whether the item is disabled.                                                                                                                                                                       |
| children           | `ChildrenOrFunction<ListBoxItemRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                           |
| className          | `ClassNameOrFunction<ListBoxItemRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                  |
| href               | `string`                                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                                      |
| hrefLang           | `string`                                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                                      |
| target             | `HTMLAttributeAnchorTarget`                   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                                      |
| rel                | `string`                                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                                     |
| download           | `string \| boolean`                           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).                    |
| ping               | `string`                                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                                      |
| referrerPolicy     | `HTMLAttributeReferrerPolicy`                 |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                                    |
| routerOptions      | `undefined`                                   |         | Options for the configured client side router.                                                                                                                                                      |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onAction                    | `(() => void)`                                            |         | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's `selectionBehavior` prop and the interaction modality.                                |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop       | Type     | Default | Description                           |
| ---------- | -------- | ------- | ------------------------------------- |
| aria-label | `string` |         | An accessibility label for this item. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `Item` has been renamed to `SelectItem`.
* The selected value only includes text. If an icon or avatar is needed, customize it using the `renderValue` function.
* There is no `allowFlip`. Use `shouldFlip`.
* There is no `allowPreventOverflow`. This is done automatically.
* There is no `allowResponsiveMenuWidth`. Use `isAutoMenuWidth`.
* `disabled` has been renamed to `isDisabled`.
* `fluid` has been renamed to `isFluid`.
* `open` has been renamed to `isOpen`..
* `required` has been renamed to `isRequired`.
* A select cannot be read-only.
* `overlayProps` has been removed. Use `popoverProps` instead.
* Use `isInvalid` instead of `validationState`.
* `variant` has been removed.
* `zIndex` has been removed.
* Custom tooltips are not supported.

## Span

A specialized component to represent an HTML span element.

```tsx
import { Span } from "@hopper-ui/components";

export default function Example() {
    return (
        <Span color="neutral-weak">
            NASA is now preparing for an ambitious new era of sustainable human spaceflight and discovery.
            The agency is building the Space Launch System rocket and the Orion spacecraft for human deep
            space exploration.
        </Span>
    );
}
```

### Usage

A span component accepts all the [span HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/span) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Spinner

A spinner indicates that a part of the product is currently performing a task of unknown duration.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/spinner/src/Spinner.tsx>

```tsx
import { Spinner } from "@hopper-ui/components";

export default function Example() {
    return (
        <Spinner aria-label="Loading..." />
    );
}
```

### Usage

#### Sizes

A spinner can vary in size.

```tsx
import { Spinner, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline alignY="end">
            <Spinner size="sm" aria-label="Loading..." />
            <Spinner aria-label="Loading..." />
            <Spinner size="lg" aria-label="Loading..." />
        </Inline>
    );
}
```

#### Label

A spinner can have a label on its side.

```tsx
import { Spinner, Inline } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline alignY="end">
            <Spinner size="sm">Loading...</Spinner>
            <Spinner>Loading...</Spinner>
            <Spinner size="lg">Loading...</Spinner>
        </Inline>
    );
}
```

#### Over Background

You can change a spinner style when over a background by setting a color property on the spinner.

```tsx
import { Spinner, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div backgroundColor="primary-strong" padding="inset-md">
            <Spinner color="primary-strong">Loading…</Spinner>
        </Div>
    );
}
```

### Props

| Prop      | Type                          | Default | Description                                                                                              |
| --------- | ----------------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| size      | `ResponsiveProp<SpinnerSize>` | "md"    | What the Spinner's diameter should be.                                                                   |
| children  | `ReactNode`                   |         | The children of the component.                                                                           |
| className | `string`                      |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| style     | `CSSProperties`               |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* The `color` props will only affect the spinner's text color and not the color of the tracks.

## Stack

A stack component is a layout primitive used to arrange elements vertically.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/layout/src/Stack.tsx>

```tsx
import { Stack, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Stack>
                <Square backgroundColor="decorative-option1" />
                <Square width="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Stack>
        </Div>
    );
}
```

### Usage

#### Reverse

The order and direction of stack items can be reversed.

```tsx
import { Stack, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%" paddingY="core_320">
            <Stack reverse UNSAFE_height="20rem">
                <Square backgroundColor="decorative-option1" />
                <Square width="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Stack>
        </Div>
    );
}
```

#### Align X

Stack items can be aligned on the horizontal axis.

```tsx
import { Stack, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Stack alignX="center">
                <Square backgroundColor="decorative-option1" />
                <Square width="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Stack>
        </Div>
    );
}
```

#### Align Y

Stack items can be aligned on the vertical axis.

```tsx
import { Stack, Div, type DivProps } from "@hopper-ui/components";

function Square(props: DivProps) {
    return <Div backgroundColor="decorative-option1" height="core_640" width="core_640" {...props} />;
}

export default function Example() {
    return (
        <Div width="100%">
            <Stack alignY="flex-end" UNSAFE_height="20rem">
                <Square backgroundColor="decorative-option1" />
                <Square width="core_800" backgroundColor="decorative-option3" />
                <Square backgroundColor="decorative-option4" />
            </Stack>
        </Div>
    );
}
```

### Best Practices

Stack is a specialized layout component for arranging items vertically with consistent spacing. It's a preset of `Flex` with `direction="column"`, designed for common vertical layouts like form fields, card content, and list items.

Stack should:

* Be used for simple vertical layouts where items are stacked with consistent spacing.
* Use [Hopper space tokens](/tokens/semantic/space.md) for the `gap` property to ensure consistency.
* Be the default choice for vertical layouts unless you need custom alignment or other flex properties.
* Keep layouts simple and semantic without unnecessary wrapper elements.

#### Do's and Don'ts

**Rule 1**

* ✅ Do:

  ```tsx
  import { Button, Stack, TextField } from "@hopper-ui/components";

  export function Example() {
      return (
          <Stack gap="stack-md">
              <TextField label="Email" />
              <TextField label="Password" type="password" />
              <Button variant="primary">Sign In</Button>
          </Stack>
      );
  }
  ```

  Use Stack for simple vertical layouts with consistent spacing

* 🚫 Don't:

  ```tsx
  import { Button, Flex, TextField } from "@hopper-ui/components";

  export function Example() {
      return (
          <Flex direction="column" gap="stack-md">
              <TextField label="Email" />
              <TextField label="Password" type="password" />
              <Button variant="primary">Sign In</Button>
          </Flex>
      );
  }
  ```

  Use Flex with direction='column' when Stack is sufficient

**Rule 2**

* ✅ Do:

  Use \`alignY\` to adjust vertical alignment of items

* 🚫 Don't:

  Use \`alignItems\` which is not supported by \`Stack\`

**Rule 3**

* ✅ Do:

  Use \`alignX\` to adjust horizontal alignment of items

* 🚫 Don't:

  Use \`justifyContent\` which is not supported by \`Stack\`

### Props

| Prop      | Type                                                  | Default | Description                                                      |
| --------- | ----------------------------------------------------- | ------- | ---------------------------------------------------------------- |
| reverse   | `boolean`                                             |         | Whether or not to reverse the order of the elements.             |
| alignX    | `ResponsiveProp<AlignItems>`                          |         | An alias for the css align-items property.                       |
| alignY    | `ResponsiveProp<JustifyContent>`                      |         | An alias for the css justify-content property.                   |
| style     | `CSSProperties`                                       |         |                                                                  |
| className | `string`                                              |         |                                                                  |
| wrap      | `ResponsiveProp<FlexWrap> \| ResponsiveProp<boolean>` |         | Whether to wrap the flex items. The value can also be a boolean. |
| basis     | `ResponsiveProp<FlexBasis<0 \| (string & {})>>`       |         | An alias for the css flex-basis property.                        |
| grow      | `ResponsiveProp<FlexGrow>`                            |         | An alias for the css flex-grow property.                         |
| shrink    | `ResponsiveProp<FlexShrink>`                          |         | An alias for the css flex-shrink property.                       |
| inline    | `boolean`                                             |         | Whether to display the flex container as an inline element.      |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

### Migration Notes

Coming from Orbiter, you should be aware of the following change:

* The default `gap` value has been reduced to `1rem` / `var(--hop-space-stack-md)` from `1.25rem`. Use `UNSAFE_gap="1.25rem"` as a temporary measure during the migration to the Hopper design system. This value should eventually be removed to align with the new design standards.

## Switch

A switch is used to quickly switch between two possible states.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/switch/src/Switch.tsx>

* Aria: <https://www.w3.org/WAI/ARIA/apg/patterns/switch/>

Switch is a control that is used to quickly switch between two possible states. Switches are only used for these binary actions that occur immediately after the user “flips the switch.” They are commonly used for “on/off” switches.

```tsx
import { Switch } from "@hopper-ui/components";

export default function Example() {
    return (
        <Switch>Save</Switch>
    );
}
```

### Anatomy

#### Structure

```tsx
<Switch>
    <IconList /> /* (Optional) A list of icons in the switch */
    <Icon /> /* (Optional) An icon in the switch */
    <Text /> /* (Optional) Text in the switch */
</Switch>
```

#### Composed Components

A `Switch` uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| IconList  | An IconList encapsulates a collection of icons.                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### Selected

A switch can be selected.

```tsx
import { Switch } from "@hopper-ui/components";

export default function Example() {
    return (
        <Switch defaultSelected>Save</Switch>
    );
}
```

#### No label

A switch can be rendered without a label.

```tsx
import { Switch } from "@hopper-ui/components";

export default function Example() {
    return (
        <Switch aria-label="Label" />
    );
}
```

#### Disabled

A switch can be disabled.

```tsx
import { Switch, SwitchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SwitchField isDisabled>
            <Switch>Save</Switch>
        </SwitchField>
    );
}
```

#### Disabled Field

A switch field can be disabled.

```tsx
import { Switch, SwitchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <SwitchField isDisabled description="This will override your changes">
            <Switch>Save</Switch>
        </SwitchField>
    );
}
```

#### Sizes

A switch can vary in size.

```tsx
import { Inline, Switch } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Switch size="sm">Save</Switch>
            <Switch size="md">Save</Switch>
        </Inline>
    );
}
```

#### Field Sizes

A switch field can vary in size.

```tsx
import { Inline, Switch, SwitchField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <SwitchField size="sm" description="This will override your changes.">
                <Switch>Save</Switch>
            </SwitchField>
            <SwitchField size="md" description="This will override your changes.">
                <Switch>Save</Switch>
            </SwitchField>
        </Inline>
    );
}
```

#### Icon

A switch can be rendered with an icon or an icon list.

```tsx
import { IconList, Inline, Switch } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Switch>
                Save
                <SparklesIcon />
            </Switch>
            <Switch>
                Save
                <IconList>
                    <SparklesIcon />
                    <SparklesIcon />
                </IconList>
            </Switch>
        </Inline>
    );
}
```

### Best Practices

Switches should:

* Have an immediate, visible effect when they are flipped on or off.
* Only offer an active or inactive state.
* Always be accompanied by a clear label.
* Offer choices that are mutually exclusive to one another.

#### Checkbox vs. Switch

Checkbox and Switch components are very similar in term of results when used in a form. However, a few details tell them apart.

* Checkbox component can offer multiple options to the user, while the Switch only offers one.
* Users can select none to any option with checkboxes, while the Switch always have one active selection at all time (either “on” or “off” position)
* Choices offered in checkbox grouping are independant from each other, while the Switch's mutually exclusive.
* The Switch's selection takes effect immediately, while the checkbox only happens once the user applied the change.

### Props

#### Switch

| Prop            | Type                                     | Default | Description                                                                                                                                                                                                                  |
| --------------- | ---------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| size            | `ResponsiveProp<FieldSize>`              | "md"    | A Switch can vary in size.                                                                                                                                                                                                   |
| form            | `string`                                 |         | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form). |
| style           | `StyleOrFunction<SwitchRenderProps>`     |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                            |
| children        | `ChildrenOrFunction<SwitchRenderProps>`  |         | The children of the component. A function may be provided to alter the children based on component state.                                                                                                                    |
| defaultSelected | `boolean`                                |         | Whether the Switch should be selected (uncontrolled).                                                                                                                                                                        |
| isSelected      | `boolean`                                |         | Whether the Switch should be selected (controlled).                                                                                                                                                                          |
| value           | `string`                                 |         | The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).                                                              |
| isDisabled      | `boolean`                                |         | Whether the input is disabled.                                                                                                                                                                                               |
| isReadOnly      | `boolean`                                |         | Whether the input can be selected but not changed by the user.                                                                                                                                                               |
| autoFocus       | `boolean`                                |         | Whether the element should receive focus on render.                                                                                                                                                                          |
| name            | `string`                                 |         | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                |
| dir             | `string`                                 |         |                                                                                                                                                                                                                              |
| lang            | `string`                                 |         |                                                                                                                                                                                                                              |
| inert           | `boolean`                                |         |                                                                                                                                                                                                                              |
| translate       | `"yes" \| "no"`                          |         |                                                                                                                                                                                                                              |
| inputRef        | `RefObject<HTMLInputElement \| null>`    |         | A ref for the HTML input element.                                                                                                                                                                                            |
| className       | `ClassNameOrFunction<SwitchRenderProps>` |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                           |

##### Events

| Prop                        | Type                                          | Default | Description                                                       |
| --------------------------- | --------------------------------------------- | ------- | ----------------------------------------------------------------- |
| onChange                    | `((isSelected: boolean) => void)`             |         | Handler that is called when the Switch's selection state changes. |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element receives focus.           |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)` |         | Handler that is called when the element loses focus.              |
| onFocusChange               | `((isFocused: boolean) => void)`              |         | Handler that is called when the element's focus status changes.   |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                |         | Handler that is called when a key is pressed.                     |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                |         | Handler that is called when a key is released.                    |
| onClickCapture              | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onAuxClick                  | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onAuxClickCapture           | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onContextMenu               | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onContextMenuCapture        | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onDoubleClick               | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onDoubleClickCapture        | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseDown                 | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseDownCapture          | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseEnter                | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseLeave                | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseMove                 | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseMoveCapture          | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseOut                  | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseOutCapture           | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseOver                 | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseOverCapture          | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseUp                   | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onMouseUpCapture            | `MouseEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchCancel               | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchCancelCapture        | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchEnd                  | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchEndCapture           | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchMove                 | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchMoveCapture          | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchStart                | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onTouchStartCapture         | `TouchEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onPointerDown               | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerDownCapture        | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerMove               | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerMoveCapture        | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerUp                 | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerUpCapture          | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerCancel             | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerCancelCapture      | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerEnter              | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerLeave              | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerOver               | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerOverCapture        | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerOut                | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onPointerOutCapture         | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onGotPointerCapture         | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onLostPointerCapture        | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLLabelElement>`       |         |                                                                   |
| onScroll                    | `UIEventHandler<HTMLLabelElement>`            |         |                                                                   |
| onScrollCapture             | `UIEventHandler<HTMLLabelElement>`            |         |                                                                   |
| onWheel                     | `WheelEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onWheelCapture              | `WheelEventHandler<HTMLLabelElement>`         |         |                                                                   |
| onAnimationStart            | `AnimationEventHandler<HTMLLabelElement>`     |         |                                                                   |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLLabelElement>`     |         |                                                                   |
| onAnimationEnd              | `AnimationEventHandler<HTMLLabelElement>`     |         |                                                                   |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLLabelElement>`     |         |                                                                   |
| onAnimationIteration        | `AnimationEventHandler<HTMLLabelElement>`     |         |                                                                   |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLLabelElement>`     |         |                                                                   |
| onTransitionCancel          | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onTransitionEnd             | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onTransitionRun             | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onTransitionStart           | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLLabelElement>`    |         |                                                                   |
| onHoverStart                | `((e: HoverEvent) => void)`                   |         | Handler that is called when a hover interaction starts.           |
| onHoverEnd                  | `((e: HoverEvent) => void)`                   |         | Handler that is called when a hover interaction ends.             |
| onHoverChange               | `((isHovering: boolean) => void)`             |         | Handler that is called when the hover state changes.              |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type      | Default | Description                                                                                                                                                                                                                                                                                   |
| ------------------- | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-controls       | `string`  |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| excludeFromTabOrder | `boolean` |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                  | `string`  |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-label          | `string`  |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby     | `string`  |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby    | `string`  |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details        | `string`  |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |

#### SwitchField

| Prop        | Type                                                                                                      | Default | Description                                                                                                                                                                        |
| ----------- | --------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| description | `ReactNode`                                                                                               |         | The description of the switch field.                                                                                                                                               |
| isDisabled  | `boolean`                                                                                                 |         | Whether the switch field is disabled.                                                                                                                                              |
| size        | `ResponsiveProp<FieldSize>`                                                                               | "md"    | A switch field can vary in size.                                                                                                                                                   |
| children    | `ReactNode \| ((values: SwitchFieldRenderProps & { defaultChildren: ReactNode; }) => ReactNode)`          |         | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className   | `string \| ((values: SwitchFieldRenderProps & { defaultClassName: string; }) => string)`                  |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| style       | `CSSProperties \| ((values: SwitchFieldRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties)` |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `onChange` signature has been changed – no events are passed.
* `onValueChange` has been deleted, use `onChange` instead.
* `checked` has been renamed to `isSelected`.
* `disabled` has been renamed to `isDisabled`.
* The `Counter` component is no longer allowed as a specialized slot.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* `validationState` has been removed. A `Switch` cannot be invalid.

## Table

A specialized component to represent an HTML table element.

```tsx
import { Table, TBody, TD, TFoot, TH, THead, TR } from "@hopper-ui/components";

export default function Example() {
    return (
        <Table cellPadding={5} color="neutral-weak">
            <THead fontWeight="core_680">
                <TR>
                    <TH textAlign="left">Company</TH>
                    <TH textAlign="left">Employees</TH>
                </TR>
            </THead>
            <TBody>
                <TR>
                    <TD>Space X</TD>
                    <TD>More than 10 000</TD>
                </TR>
                <TR>
                    <TD>Blue Origin</TD>
                    <TD>3 500</TD>
                </TR>
                <TR color="core_sapphire-600">
                    <TD>Virgin Galactic</TD>
                    <TD>823</TD>
                </TR>
            </TBody>
            <TFoot></TFoot>
        </Table>
    );
}
```

### Usage

A table component accepts all the [table HTML element attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/table) and [Hopper styled component props](/styled-system/concepts/styling.md).

## Tabs

Tabs are used to organize content by grouping similar information on the same page.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/tabs/src/Tabs.tsx>

Tabs are used to group different but related content, allowing users to navigate views without leaving the page. They always contain at least two items and one tab is active at a time. Tabs can be used on full page layouts or in components such as modals, listbox, or side panels.

```tsx
import { Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tabs aria-label="Frogs">
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">Poison Dart Frog</Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

### Anatomy

#### Structure

```tsx
<Tabs>
    <TabList> /* (Required) A list of tabs */
        <Tab> /* (Required) A tab in the TabList */
            <Icon /> /* (Optional) An icon in the tab */
            <Badge /> /* (Optional) A badge in the tab */
            <Text /> /* (Optional) Text in the tab, required if using another element */
            <Tag /> /* (Optional) A tag in the tab */
        </Tab>
    </TabList>
    <TabPanel /> /* (Required) A panel for the TabList */
</Tabs>
```

#### Composed Components

A `Tab` uses the following components:

| Component | Description                                                                                                                                                      |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Badge     | A badge is used to bring attention to an element.                                                                                                                |
| Icon      | An icon component is used to render a custom icon.                                                                                                               |
| Tag       | A tag represents a label, category, keyword, or filter, and can be used for various groupings. If you need multiple tags, consider using the TagGroup component. |
| Text      | A text component is a primitive component matching Hopper's typography type scale.                                                                               |

### Usage

#### Sizes

Tabs can vary in size.

```tsx
import { Stack, Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack gap="stack-md">
            <Tabs aria-label="Frogs">
                <TabList>
                    <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                    <Tab id="poison-dart">Poison Dart Frog</Tab>
                    <Tab id="goliath">Goliath Frog</Tab>
                </TabList>
                <TabPanel id="red-eye-tree" padding="inset-md">
                    The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
                </TabPanel>
                <TabPanel id="poison-dart" padding="inset-md">
                    The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
                </TabPanel>
                <TabPanel id="goliath" padding="inset-md">
                    The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
                </TabPanel>
            </Tabs>
            <Tabs aria-label="Frogs" size="md">
                <TabList>
                    <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                    <Tab id="poison-dart">Poison Dart Frog</Tab>
                    <Tab id="goliath">Goliath Frog</Tab>
                </TabList>
                <TabPanel id="red-eye-tree" padding="inset-md">
                    The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
                </TabPanel>
                <TabPanel id="poison-dart" padding="inset-md">
                    The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
                </TabPanel>
                <TabPanel id="goliath" padding="inset-md">
                    The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
                </TabPanel>
            </Tabs>
        </Stack>
    );
}
```

#### Icon

A tab can contain an icon.

```tsx
import { Tab, TabList, TabPanel, Tabs, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Tabs aria-label="Frogs">
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">
                    <SparklesIcon />
                    <Text>Poison Dart Frog</Text>
                </Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

#### Lozenge

A tab can contain a lozenge.

```tsx
import { Tab, TabList, TabPanel, Tabs, Tag, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tabs aria-label="Frogs">
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">
                    <Tag>New</Tag>
                    <Text>Poison Dart Frog</Text>
                </Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

#### Badge

A tab can contain a badge.

```tsx
import { Badge, Tab, TabList, TabPanel, Tabs, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tabs aria-label="Frogs">
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">
                    <Badge>100</Badge>
                    <Text>Poison Dart Frog</Text>
                </Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

#### Dynamic Tabs

Tabs items can be rendered dynamically.

```tsx
import { Collection, Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    const items = [
        {
            id: "red-eye-tree",
            header: "Red-Eyed Tree Frog",
            content: "The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest."
        },
        {
            id: "poison-dart",
            header: "Poison Dart Frog",
            content: "The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters."
        },
        {
            id: "goliath",
            header: "Goliath Frog",
            content: "The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa."
        }
    ];

    return (
        <Tabs aria-label="Frogs">
            <TabList>
                <Collection items={items}>
                    {({ id, header }) => (
                        <Tab id={id}>{header}</Tab>
                    )}
                </Collection>
            </TabList>
            <Collection items={items}>
                {({ id, content }) => (
                    <TabPanel id={id} padding="inset-md">
                        {content}
                    </TabPanel>
                )}
            </Collection>
        </Tabs>
    );
}
```

#### Manually Activated Tabs

By default, tabs are activated automatically. This means when you use the arrow keys to change tabs, the tab is activated and focused.

> **information**
>
> The content of a tab should ideally be preloaded. However, if switching to a tab panel causes a network request and possibly a page refresh, there might be some notable latency and this might affect the experience for keyboard and screen reader users.

In this scenario, you should use a manually activated tab, which moves focus without activating the tabs. With the focus on a specific tab, users can activate a tab by pressing Space or Enter.

```tsx
import { Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tabs aria-label="Frogs" keyboardActivation="manual">
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">Poison Dart Frog</Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

#### Variants

Tabs can use different variants.

```tsx
import { Card, Stack, Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack gap="stack-lg">
            <Tabs aria-label="Frogs" variant="standalone">
                <TabList>
                    <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                    <Tab id="poison-dart">Poison Dart Frog</Tab>
                    <Tab id="goliath">Goliath Frog</Tab>
                </TabList>
                <TabPanel id="red-eye-tree" padding="inset-md">
                    The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
                </TabPanel>
                <TabPanel id="poison-dart" padding="inset-md">
                    The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
                </TabPanel>
                <TabPanel id="goliath" padding="inset-md">
                    The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
                </TabPanel>
            </Tabs>
            <Card>
                <Tabs aria-label="Frogs" variant="in-card">
                    <TabList>
                        <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                        <Tab id="poison-dart">Poison Dart Frog</Tab>
                        <Tab id="goliath">Goliath Frog</Tab>
                    </TabList>
                    <TabPanel id="red-eye-tree" padding="inset-md">
                        The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
                    </TabPanel>
                    <TabPanel id="poison-dart" padding="inset-md">
                        The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
                    </TabPanel>
                    <TabPanel id="goliath" padding="inset-md">
                        The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
                    </TabPanel>
                </Tabs>
            </Card>
            <Tabs aria-label="Frogs" variant="heading">
                <TabList>
                    <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                    <Tab id="poison-dart">Poison Dart Frog</Tab>
                    <Tab id="goliath">Goliath Frog</Tab>
                </TabList>
                <TabPanel id="red-eye-tree" padding="inset-md">
                    The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
                </TabPanel>
                <TabPanel id="poison-dart" padding="inset-md">
                    The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
                </TabPanel>
                <TabPanel id="goliath" padding="inset-md">
                    The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
                </TabPanel>
            </Tabs>
        </Stack>
    );
}
```

#### Fluid

A tabs component can split the width of its container equally between its tabs.

```tsx
import { Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tabs aria-label="Frogs" isFluid>
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">Poison Dart Frog</Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

#### Controlled

The selectedKey state can be handled in a controlled mode.

```tsx
import { type Key, Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [selectedKey, setSelectedKey] = useState("poison-dart");
    const handleSelectionChange = useCallback((key: Key) => {
        setSelectedKey(key as string);
    }, [setSelectedKey]);

    return (
        <Tabs aria-label="Frogs" onSelectionChange={handleSelectionChange} selectedKey={selectedKey}>
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">Poison Dart Frog</Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

#### Disabled

All tabs can be disabled using the `isDisabled` prop.

```tsx
import { Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tabs aria-label="Frogs" isDisabled>
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">Poison Dart Frog</Tab>
                <Tab id="goliath">Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

##### Disabled items

An individual Tab can be disabled with the isDisabled prop. Disabled tabs are not focusable, selectable, or keyboard navigable.

```tsx
import { Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tabs aria-label="Frogs">
            <TabList>
                <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                <Tab id="poison-dart">Poison Dart Frog</Tab>
                <Tab id="goliath" isDisabled>Goliath Frog</Tab>
            </TabList>
            <TabPanel id="red-eye-tree" padding="inset-md">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" padding="inset-md">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" padding="inset-md">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

In dynamic collections, it may be more convenient to use the disabledKeys prop at the Tabs level instead of isDisabled on individual tabs. Each key in this list corresponds with the `id` prop passed to the Tab component, or automatically derived from the values passed to the items prop. A tab is considered disabled if its id exists in `disabledKeys` or if it has `isDisabled`.

```tsx
import { Collection, Tab, TabList, TabPanel, Tabs } from "@hopper-ui/components";

export default function Example() {
    const items = [
        {
            id: "red-eye-tree",
            header: "Red-Eyed Tree Frog",
            content: "The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest."
        },
        {
            id: "poison-dart",
            header: "Poison Dart Frog",
            content: "The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species’ toxins historically used by Indigenous hunters."
        },
        {
            id: "goliath",
            header: "Goliath Frog",
            content: "The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn’t croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa."
        }
    ];

    return (
        <Tabs aria-label="Frogs" disabledKeys={["poison-dart"]}>
            <TabList>
                <Collection items={items}>
                    {({ id, header }) => (
                        <Tab id={id}>{header}</Tab>
                    )}
                </Collection>
            </TabList>
            <Collection items={items}>
                {({ id, content }) => (
                    <TabPanel id={id} padding="inset-md">
                        {content}
                    </TabPanel>
                )}
            </Collection>
        </Tabs>
    );
}
```

#### Embedded

Tabs can be embedded in other components.

```tsx
import { Button, Heading, Inline, Tab, TabList, TabPanel, Tabs, Text } from "@hopper-ui/components";
import { PlusIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Tabs aria-label="Frogs" variant="heading">
            <Inline justifyItems="space-between" alignY="flex-end">
                <Heading>Goal</Heading>
                <TabList>
                    <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                    <Tab id="poison-dart">Poison Dart Frog</Tab>
                    <Tab id="goliath">Goliath Frog</Tab>
                </TabList>
                <Button>
                    <PlusIcon />
                    <Text>New goal</Text>
                </Button>
            </Inline>
            <TabPanel id="red-eye-tree" paddingTop="inset-lg">
                The Red-Eyed Tree Frog (Agalychnis callidryas) is a vibrant nocturnal climber with bright green skin, red eyes, and blue-striped sides, using its colors to startle predators before blending into the rainforest.
            </TabPanel>
            <TabPanel id="poison-dart" paddingTop="inset-lg">
                The Poison Dart Frog (Dendrobatidae) is a tiny but highly toxic amphibian, flaunting brilliant shades of yellow, blue, or red to warn predators, with some species' toxins historically used by Indigenous hunters.
            </TabPanel>
            <TabPanel id="goliath" paddingTop="inset-lg">
                The Goliath Frog (Conraua goliath) is the largest frog in the world, reaching up to 12 inches long and 7 pounds, yet it doesn't croak, relying instead on movement to communicate in the fast-flowing rivers of West Africa.
            </TabPanel>
        </Tabs>
    );
}
```

#### Links

Tabs can be used as links.

```tsx
import { HopperProvider, Stack, Tab, TabList, Tabs } from "@hopper-ui/components";
import { createMemoryRouter, RouterProvider, useLocation, useNavigate } from "react-router-dom";

export default function Exemple() {
    const router = createMemoryRouter([
        {
            path: "/deleted",
            element: (
                <Stack>
                    <Example />
                    Deleted
                </Stack>
            )
        },
        {
            path: "/shared",
            element: (
                <Stack>
                    <Example />
                    Shared
                </Stack>
            )
        },
        {
            path: "/",
            element: (
                <Stack>
                    <Example />
                    Home
                </Stack>
            )
        }, {
            path: "*",
            element: <Example />
        }
    ]);

    return (
        <RouterProvider router={router} />
    );
}

function Example() {
    const navigate = useNavigate();
    const { pathname } = useLocation();

    return (
        <HopperProvider colorScheme="system" navigate={navigate}>
            <Tabs aria-label="Navigation" selectedKey={pathname}>
                <TabList>
                    <Tab id="/" href="/">Home</Tab>
                    <Tab id="/shared" href="/shared">Shared</Tab>
                    <Tab id="/deleted" href="/deleted">Deleted</Tab>
                </TabList>
            </Tabs>
        </HopperProvider>
    );
}
```

### Best Practices

Tabs should:

* Represent the same kind of content, such as a list-view with different filters applied. Don't use tabs to group content that is dissimilar.
* Only be active one at a time.
* Not force users to jump back and forth to do a single task. Users should be able to complete this work and find what they need under each tab.
* Not be used for primary navigation.

#### Overflowing content

When the tab group's width is larger than the space necessary to display all of the tabs, we group them within a menu. This grouping happens when two or more tabs cannot be visible in the viewport. We add tabs to the menu as the viewport gets narrower. The grouping is always at the end of the tab group. However, the menu will never regroup all of the tabs of the tab group and will always keep the most important tab (the first one in the tab group) always visible.

When a user selects a tab from the tab grouping menu, the selected tab is displayed in the tab group and takes the position of the tab that was to the left of the grouping.

#### Displaying tabs in grouping

When users click on the tab grouping button, we display the tabs in the same order they would have appeared without the grouping in a Listbox component. All details like count, icons and upsell are displayed in the listbox.

### Props

#### Tabs

| Prop               | Type                                     | Default      | Description                                                                                                |
| ------------------ | ---------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------- |
| variant            | `"standalone" \| "in-card" \| "heading"` | "standalone" | The variant of the tabs.                                                                                   |
| size               | `"sm" \| "md"`                           | "sm"         | The size of the tabs.                                                                                      |
| isFluid            | `boolean`                                |              | Whether or not the tabs takes up the width of its container.                                               |
| selectedKey        | `Key \| null`                            |              | The currently selected key in the collection (controlled).                                                 |
| defaultSelectedKey | `Key`                                    |              | The initial selected key in the collection (uncontrolled).                                                 |
| isDisabled         | `boolean`                                |              | Whether the TabList is disabled. Shows that a selection exists, but is not available in that circumstance. |
| disabledKeys       | `Iterable<Key>`                          |              | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.    |
| keyboardActivation | `"automatic" \| "manual"`                | 'automatic'  | Whether tabs are activated automatically on focus or manually.                                             |
| dir                | `string`                                 |              |                                                                                                            |
| lang               | `string`                                 |              |                                                                                                            |
| inert              | `boolean`                                |              |                                                                                                            |
| translate          | `"yes" \| "no"`                          |              |                                                                                                            |
| children           | `ReactNode`                              |              | The children of the component.                                                                             |
| style              | `CSSProperties`                          |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.    |
| className          | `string`                                 |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.   |

##### Events

| Prop                        | Type                                     | Default | Description                                        |
| --------------------------- | ---------------------------------------- | ------- | -------------------------------------------------- |
| onSelectionChange           | `((key: Key) => void)`                   |         | Handler that is called when the selection changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                    |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                    |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                    |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                    |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

#### TabList

| Prop         | Type               | Default | Description                                                                                              |
| ------------ | ------------------ | ------- | -------------------------------------------------------------------------------------------------------- |
| items        | `Iterable<object>` |         | Item objects in the collection.                                                                          |
| dependencies | `readonly any[]`   |         | Values that should invalidate the item cache when using dynamic collections.                             |
| dir          | `string`           |         |                                                                                                          |
| lang         | `string`           |         |                                                                                                          |
| inert        | `boolean`          |         |                                                                                                          |
| translate    | `"yes" \| "no"`    |         |                                                                                                          |
| children     | `ReactNode`        |         | The children of the component.                                                                           |
| className    | `string`           |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. |
| style        | `CSSProperties`    |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.  |

##### Events

| Prop                        | Type                                     | Default | Description |
| --------------------------- | ---------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

#### Tab

| Prop           | Type                          | Default | Description                                                                                                                                                                      |
| -------------- | ----------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dir            | `string`                      |         |                                                                                                                                                                                  |
| lang           | `string`                      |         |                                                                                                                                                                                  |
| inert          | `boolean`                     |         |                                                                                                                                                                                  |
| translate      | `"yes" \| "no"`               |         |                                                                                                                                                                                  |
| isDisabled     | `boolean`                     |         | Whether the tab is disabled.                                                                                                                                                     |
| href           | `string`                      |         | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                   |
| hrefLang       | `string`                      |         | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                   |
| target         | `HTMLAttributeAnchorTarget`   |         | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                   |
| rel            | `string`                      |         | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                  |
| download       | `string \| boolean`           |         | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download). |
| ping           | `string`                      |         | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                   |
| referrerPolicy | `HTMLAttributeReferrerPolicy` |         | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                 |
| routerOptions  | `undefined`                   |         | Options for the configured client side router.                                                                                                                                   |
| children       | `ReactNode`                   |         | The children of the component.                                                                                                                                                   |
| className      | `string`                      |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.                                                                         |
| style          | `CSSProperties`               |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.                                                                          |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

#### TabPanel

| Prop             | Type            | Default | Description                                                                                                                                                                                                             |
| ---------------- | --------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| shouldForceMount | `boolean`       | false   | Whether to mount the tab panel in the DOM even when it is not currently selected. Inactive tab panels are inert and cannot be interacted with. They must be styled appropriately so this is clear to the user visually. |
| dir              | `string`        |         |                                                                                                                                                                                                                         |
| lang             | `string`        |         |                                                                                                                                                                                                                         |
| inert            | `boolean`       |         |                                                                                                                                                                                                                         |
| translate        | `"yes" \| "no"` |         |                                                                                                                                                                                                                         |
| children         | `ReactNode`     |         | The children of the component.                                                                                                                                                                                          |
| className        | `string`        |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.                                                                                                                |
| style            | `CSSProperties` |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.                                                                                                                 |

##### Events

| Prop                        | Type                                     | Default | Description |
| --------------------------- | ---------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `orientation` has been removed, not supported.
* `disabled` has been removed, not supported.
* `manual` has been removed. Refer to this [sample](#usage-manually-activated-tabs) to quickly match old sizes.

## Tag

A tag represents a label, category, keyword, or filter, and can be used for various groupings. If you need multiple tags, consider using the TagGroup component.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/tag/src/Tag.tsx>

Tags can be used to categorize items. Use short labels for easy scanning. Use two words only if necessary to describe the status and differentiate it from other tags.

```tsx
import { Tag } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tag id="designer">Designer</Tag>
    );
}
```

### Anatomy

#### Structure

```tsx
<Tag>
    <Avatar /> /* (Optional) An avatar in the Tag */
    <Icon /> /* (Optional) An icon in the Tag */
    <IconList /> /* (Optional) A list of icons in the Tag */
    <Text /> /* (Optional) Text is optional, but becomes required if any other elements are present */
    <Badge /> /* (Optional) A badge in the Tag */
</Tag>
```

#### Composed Components

A `Tag` uses the following components:

| Component | Description                                                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Avatar    | Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available. |
| Badge     | A badge is used to bring attention to an element.                                                                                                  |
| Icon      | An icon component is used to render a custom icon.                                                                                                 |
| IconList  | An IconList encapsulates a collection of icons.                                                                                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale.                                                                 |

### Usage

> **information**
>
> If you need multiple tags to describe an element, consider using the [TagGroup](TagGroup.md) component.

#### Sizes

A tag can vary in size.

```tsx
import { Inline, Tag } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Tag id="designer" size="sm">Designer</Tag>
            <Tag id="developer" size="md">Developer</Tag>
            <Tag id="manager" size="lg">Manager</Tag>
        </Inline>
    );
}
```

#### Disabled

A tag can be disabled using the `isDisabled` prop.

```tsx
import { Tag } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tag id="designer" isDisabled>
            Designer
        </Tag>
    );
}
```

#### Variants

A tag can vary in style using the `variant` prop.

```tsx
import { Inline, Tag } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Tag variant="neutral">
                Neutral
            </Tag>
            <Tag variant="subdued">
                Subdued
            </Tag>
            <Tag variant="progress">
                Progress
            </Tag>
            <Tag variant="positive">
                Positive
            </Tag>
            <Tag variant="caution">
                Caution
            </Tag>
            <Tag variant="negative">
                Negative
            </Tag>
            <Tag variant="option1">
                Option 1
            </Tag>
            <Tag variant="option2">
                Option 2
            </Tag>
            <Tag variant="option3">
                Option 3
            </Tag>
            <Tag variant="option4">
                Option 4
            </Tag>
            <Tag variant="option5">
                Option 5
            </Tag>
            <Tag variant="option6">
                Option 6
            </Tag>
        </Inline>
    );
}
```

#### Invalid

A tag can be set as invalid using the `isInvalid` prop.

```tsx
import { Tag } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tag id="designer" isInvalid>
            Designer
        </Tag>
    );
}
```

#### Loading

A tag can have a loading state using the `isLoading` prop.

```tsx
import { Tag } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tag id="manager" isLoading>Manager</Tag>
    );
}
```

#### Avatar

A tag can contain an avatar.

```tsx
import { Avatar, Tag, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tag id="1" textValue="Frodo Baggin" size="sm">
            <Avatar name="Frodo Baggins" src="https://i.pravatar.cc/96?img=3" />
            <Text>Frodo Baggin</Text>
        </Tag>
    );
}
```

#### Icons

A tag can contain an icon or an icon list.

```tsx
import { IconList, Inline, Tag, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <Tag id="developer" size="sm" textValue="Developer">
                <SparklesIcon />
                <Text>Developer</Text>
            </Tag>
            <Tag id="designer" size="md" textValue="Designer">
                <Text>Designer</Text>
                <IconList>
                    <SparklesIcon />
                    <SparklesIcon />
                    <SparklesIcon />
                </IconList>
            </Tag>
        </Inline>
    );
}
```

#### Count

A tag can contain a count using the `Badge` component.

```tsx
import { Badge, Inline, Tag, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <Tag id="designer" size="sm" textValue="Designer">
                <Text>Designer</Text>
                <Badge>12</Badge>
            </Tag>
            <Tag id="developer" size="md" textValue="Developer">
                <Text>Developer</Text>
                <Badge variant="subdued">100</Badge>
            </Tag>
            <Tag id="manager" size="lg" textValue="Manager">
                <Text>Manager</Text>
                <Badge>99+</Badge>
            </Tag>
        </Inline>
    );
}
```

#### Links

A tag can be a link by using the `href` prop on the Tag component. Tags with an `href` are not selectable.

```tsx
import { Tag } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tag id="1" href="https://www.google.com">Google</Tag>
    );
}
```

#### React Router Links

A tag can be rendered as a react router link when using the `href` prop and setting the `navigate` prop on the `HopperProvider`.

```tsx
import { HopperProvider, Tag } from "@hopper-ui/components";
import { createMemoryRouter, RouterProvider, useNavigate } from "react-router-dom";

export default function App() {
    const router = createMemoryRouter([{
        path: "/123",
        element: <>Navigated Successfully to page 1! <Example /></>
    }, {
        path: "/456",
        element: <>Navigated Successfully to page 2! <Example /></>
    }, {
        path: "*",
        element: <Example />
    }
    ]);

    return (
        <RouterProvider router={router} />
    );
}

function Example() {
    const navigate = useNavigate();

    return (
        <HopperProvider colorScheme="light" navigate={navigate}>
            <Tag id="1" href="/123">Page 1</Tag>
        </HopperProvider>
    );
}
```

### Best Practices

Tags should:

* Be presented close to or within the input control that allows users to add and remove tags.
* Use appropriate colour semantics when describing states of an object
* Use a size that match the object it relates to. Tags should not be bigger or more prominent than the object it relates to.

### Props

| Prop             | Type                                  | Default   | Description                                                                                                                                                                        |
| ---------------- | ------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isInvalid        | `boolean`                             |           | Whether the tag is invalid or not.                                                                                                                                                 |
| isLoading        | `boolean`                             |           | Whether the tag is loading or not.                                                                                                                                                 |
| size             | `ResponsiveProp<TagSize>`             | "md"      | The size of the tag.                                                                                                                                                               |
| variant          | `TagVariant`                          | "neutral" | The visual style of the Tag.                                                                                                                                                       |
| clearButtonProps | `ClearButtonProps`                    |           | The props of the ClearButton.                                                                                                                                                      |
| spinnerProps     | `SpinnerProps`                        |           | The props of the Spinner.                                                                                                                                                          |
| style            | `StyleOrFunction<TagRenderProps>`     |           | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| dir              | `string`                              |           |                                                                                                                                                                                    |
| lang             | `string`                              |           |                                                                                                                                                                                    |
| inert            | `boolean`                             |           |                                                                                                                                                                                    |
| translate        | `"yes" \| "no"`                       |           |                                                                                                                                                                                    |
| id               | `Key`                                 |           | A unique id for the tag.                                                                                                                                                           |
| textValue        | `string`                              |           | A string representation of the tags's contents, used for accessibility. Required if children is not a plain text string.                                                           |
| isDisabled       | `boolean`                             |           | Whether the tag is disabled.                                                                                                                                                       |
| children         | `ChildrenOrFunction<TagRenderProps>`  |           | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className        | `ClassNameOrFunction<TagRenderProps>` |           | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| href             | `string`                              |           | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                     |
| hrefLang         | `string`                              |           | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                     |
| target           | `HTMLAttributeAnchorTarget`           |           | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                     |
| rel              | `string`                              |           | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                    |
| download         | `string \| boolean`                   |           | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).   |
| ping             | `string`                              |           | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                     |
| referrerPolicy   | `HTMLAttributeReferrerPolicy`         |           | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                   |
| routerOptions    | `undefined`                           |           | Options for the configured client side router.                                                                                                                                     |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type      | Default | Description                                                                                                                                                                                                                                                                                                                                               |
| ------------------- | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| excludeFromTabOrder | `boolean` |         | This property is only available for Tag without a TagGroup. Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* A dot is not supported
* `fluid` is not supported.
* `variant` values are now `neutral` | `subdued` | `progress` | `positive` | `caution` | `negative` | `option1` | `option2` | `option3` | `option4` | `option5` | `option6` and not `solid` | `outline`.
* `validationState` is not supported. Use `isInvalid` instead.

## TagGroup

The TagGroup is a dynamic UI component that encapsulates a collection of tags. Each tag represents a label, category, keyword, or filter, and can be used for various groupings

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/tag/src/TagGroup.tsx>

Multiple or single tags can be used to categorize items. Use short labels for easy scanning. Use two words only if necessary to describe the status and differentiate it from other tags.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

### Anatomy

#### Structure

```tsx
<TagGroup>
    <Tag> /* (Required) An item in the TagGroup */
        <Avatar /> /* (Optional) An avatar in the Tag */
        <Icon /> /* (Optional) An icon in the Tag */
        <IconList /> /* (Optional) A list of icons in the Tag */
        <Text /> /* (Optional) Text is optional, but becomes required if any other elements are present */
        <Badge /> /* (Optional) A badge in the Tag */
    </Tag>
</TagGroup>
```

#### Composed Components

A `Tag` within a `TagGroup` uses the following components:

| Component | Description                                                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Avatar    | Avatars are used to represent a user, a team or another entity in the Workleap ecosystem. They are often paired with text where room is available. |
| Badge     | A badge is used to bring attention to an element.                                                                                                  |
| Icon      | An icon component is used to render a custom icon.                                                                                                 |
| IconList  | An IconList encapsulates a collection of icons.                                                                                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale.                                                                 |

### Usage

#### Label

A tag group can use the `label` prop to provide more context to the user.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup label="Jobs">
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Description

A tag group can use a `description` prop to provide more information to the user.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs" description="The jobs in this list are in no particular order.">
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Disabled

Tags can be disabled using the `disabledKeys` prop.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs" disabledKeys={["1", "2", "3"]}>
            <Tag id="1">Designer</Tag>
            <Tag id="2">Developer</Tag>
            <Tag id="3">Manager</Tag>
        </TagGroup>
    );
}
```

#### Disabled Item

A tag can be disabled using the `isDisabled` prop.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag id="designer" isDisabled>
                Designer
            </Tag>
            <Tag id="developer">
                Developer
            </Tag>
            <Tag id="manager">
                Manager
            </Tag>
        </TagGroup>
    );
}
```

#### Invalid Tag

If a tag group is invalid, it will display an error message. Displaying this error message will hide the helper message.

```tsx
import { Tag, TagGroup, type Selection } from "@hopper-ui/components";
import { useState } from "react";

export default function Example() {
    const [isInvalid, setIsInvalid] = useState(true);

    function onChange(keys: Selection) {
        // if value is empty, then it is invalid
        if (typeof keys === "object") {
            setIsInvalid(keys.size === 0);
        }
    }

    return (
        <TagGroup
            aria-label="Jobs"
            selectionMode="multiple"
            onSelectionChange={onChange}
            isInvalid={isInvalid}
            description="Unselect all to show the error message"
            errorMessage="Select a job and the description will appear"
        >
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Removable

Tags can be removed using the `onRemove` callback. If you are using a keyboard, you can press the backspace key to remove a tag.

```tsx
import { Tag, TagGroup, type Selection } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup
            aria-label="Jobs"
            onRemove={(ids: Selection) => {
                alert(`Remove: ${[...ids]}`);
            }}
        >
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Readonly

Tags can be set to read-only using the `isReadOnly` prop. This will prevent the user from removing tags.

```tsx
import { Tag, TagGroup, type Selection } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup
            aria-label="Jobs"
            isReadOnly
            onRemove={(ids: Selection) => {
                alert(`Remove: ${[...ids]}`);
            }}
        >
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Selectable

Tags can be selected using the `selectionMode` prop. Use `defaultSelectedKeys` for initially selected items (uncontrolled) and `selectedKeys` to manage selected items (controlled). The selected keys should match the item's `id` prop.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs" selectionMode="multiple" defaultSelectedKeys={["designer", "developer"]}>
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Sizes

A tag group can vary in size.

```tsx
import { Stack, Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <TagGroup aria-label="Jobs" size="sm" >
                <Tag id="designer">Designer</Tag>
                <Tag id="developer">Developer</Tag>
                <Tag id="manager">Manager</Tag>
            </TagGroup>
            <TagGroup aria-label="Jobs" size="md" >
                <Tag id="designer">Designer</Tag>
                <Tag id="developer">Developer</Tag>
                <Tag id="manager">Manager</Tag>
            </TagGroup>
            <TagGroup aria-label="Jobs" size="lg" >
                <Tag id="designer">Designer</Tag>
                <Tag id="developer">Developer</Tag>
                <Tag id="manager">Manager</Tag>
            </TagGroup>
        </Stack>
    );
}
```

#### Item Sizes

A tag can vary in size.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag id="designer" size="sm">Designer</Tag>
            <Tag id="developer" size="md">Developer</Tag>
            <Tag id="manager" size="lg">Manager</Tag>
        </TagGroup>
    );
}
```

#### Variants

A tag group can vary in style using the `variant` prop. The one seen here is `subdued`.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs" variant="subdued">
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Item Variants

A tag can vary in style using the `variant` prop.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag variant="neutral">
                Neutral
            </Tag>
            <Tag variant="subdued">
                Subdued
            </Tag>
            <Tag variant="progress">
                Progress
            </Tag>
            <Tag variant="positive">
                Positive
            </Tag>
            <Tag variant="caution">
                Caution
            </Tag>
            <Tag variant="negative">
                Negative
            </Tag>
            <Tag variant="option1">
                Option 1
            </Tag>
            <Tag variant="option2">
                Option 2
            </Tag>
            <Tag variant="option3">
                Option 3
            </Tag>
            <Tag variant="option4">
                Option 4
            </Tag>
            <Tag variant="option5">
                Option 5
            </Tag>
            <Tag variant="option6">
                Option 6
            </Tag>
        </TagGroup>
    );
}
```

#### Empty List

Using the `renderEmptyState` prop, you can customize the empty state message when there are no tags.

```tsx
import { TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Status" renderEmptyState={() => "No jobs posting available"}>
            {[]}
        </TagGroup>
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a TagGroup.

```tsx
import { ContextualHelp, Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs" contextualHelp={<ContextualHelp>These are all possible jobs</ContextualHelp>}>
            <Tag id="designer">Designer</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="manager">Manager</Tag>
        </TagGroup>
    );
}
```

#### Invalid TagGroup

A tag can be set as invalid using the `isInvalid` prop.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag id="designer" isInvalid>
                Designer
            </Tag>
            <Tag id="developer">
                Developer
            </Tag>
            <Tag id="manager">
                Manager
            </Tag>
        </TagGroup>
    );
}
```

#### Loading

A tag can have a loading state using the `isLoading` prop.

```tsx
import { Tag, TagGroup, type Selection } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup
            aria-label="Jobs"
            onRemove={(ids: Selection) => {
                alert(`Remove: ${[...ids]}`);
            }}
        >
            <Tag id="manager" isLoading>Manager</Tag>
            <Tag id="developer">Developer</Tag>
            <Tag id="designer">Designer</Tag>
        </TagGroup>
    );
}
```

#### Avatar

A tag can contain an avatar.

```tsx
import { Avatar, Tag, TagGroup, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Team Members">
            <Tag id="1" textValue="Frodo Baggin" size="sm">
                <Avatar name="Frodo Baggins" src="https://i.pravatar.cc/96?img=3" />
                <Text>Frodo Baggin</Text>
            </Tag>
            <Tag id="2" textValue="Karen Smith" size="md">
                <Avatar name="Karen Smith" />
                <Text>Karen Smith</Text>
            </Tag>
            <Tag id="3" textValue="John Smith" size="lg">
                <Text>John Smith</Text>
                <Avatar name="John Smith" />
            </Tag>
        </TagGroup>
    );
}
```

#### Icons

A tag can contain an icon or an icon list.

```tsx
import { IconList, Tag, TagGroup, Text } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag id="developer" size="sm" textValue="Developer">
                <SparklesIcon />
                <Text>Developer</Text>
            </Tag>
            <Tag id="designer" size="md" textValue="Designer">
                <Text>Designer</Text>
                <IconList>
                    <SparklesIcon />
                    <SparklesIcon />
                    <SparklesIcon />
                </IconList>
            </Tag>
            <Tag id="manager" size="lg" textValue="Manager">
                <Text>Manager</Text>
                <IconList>
                    <SparklesIcon />
                    <SparklesIcon />
                    <SparklesIcon />
                </IconList>
            </Tag>
        </TagGroup>
    );
}
```

#### Count

A tag can contain a count using the `Badge` component.

```tsx
import { Badge, Tag, TagGroup, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag id="designer" size="sm" textValue="Designer">
                <Text>Designer</Text>
                <Badge>12</Badge>
            </Tag>
            <Tag id="developer" size="md" textValue="Developer">
                <Text>Developer</Text>
                <Badge variant="subdued">100</Badge>
            </Tag>
            <Tag id="manager" size="lg" textValue="Manager">
                <Text>Manager</Text>
                <Badge>99+</Badge>
            </Tag>
        </TagGroup>
    );
}
```

#### Links

A tag can be a link by using the `href` prop on the Tag component. Tags with an `href` are not selectable.

```tsx
import { Tag, TagGroup } from "@hopper-ui/components";

export default function Example() {
    return (
        <TagGroup aria-label="Jobs">
            <Tag id="1" href="https://www.google.com">Google</Tag>
            <Tag id="2" href="https://www.bing.com">Bing</Tag>
            <Tag id="3" href="https://www.yahoo.com">Yahoo</Tag>
        </TagGroup>
    );
}
```

#### React Router Links

A tag can be rendered as a react router link when using the `href` prop and setting the `navigate` prop on the `HopperProvider`.

```tsx
import { HopperProvider, Tag, TagGroup } from "@hopper-ui/components";
import { createMemoryRouter, RouterProvider, useNavigate } from "react-router-dom";

export default function App() {
    const router = createMemoryRouter([{
        path: "/123",
        element: <>Navigated Successfully to page 1! <Example /></>
    }, {
        path: "/456",
        element: <>Navigated Successfully to page 2! <Example /></>
    }, {
        path: "*",
        element: <Example />
    }
    ]);

    return (
        <RouterProvider router={router} />
    );
}

function Example() {
    const navigate = useNavigate();

    return (
        <HopperProvider colorScheme="light" navigate={navigate}>
            <TagGroup aria-label="tag-group">
                <Tag id="1" href="/123">Page 1</Tag>
                <Tag id="2" href="/456">Page 2</Tag>
            </TagGroup>
        </HopperProvider>
    );
}
```

### Best Practices

Tags should:

* Be presented close to or within the input control that allows users to add and remove tags.
* Use appropriate colour semantics when describing states of an object
* Use a size that match the object it relates to. Tags should not be bigger or more prominent than the object it relates to.

### Props

#### TagGroup

| Prop                   | Type                                                                                    | Default          | Description                                                                                                                                                                                                                                                                                                      |
| ---------------------- | --------------------------------------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isInvalid              | `boolean`                                                                               |                  | Whether the tags are invalid or not.                                                                                                                                                                                                                                                                             |
| size                   | `ResponsiveProp<TagSize>`                                                               | "md"             | A tag can vary in size.                                                                                                                                                                                                                                                                                          |
| tagListProps           | `(Omit<Omit<TagListProps<T>, ListProps>, keyof StyledSystemProps> & StyledSystemProps)` |                  | The tag list props                                                                                                                                                                                                                                                                                               |
| variant                | `TagVariant`                                                                            | "neutral"        | The visual style of the TagGroup.                                                                                                                                                                                                                                                                                |
| isReadOnly             | `boolean`                                                                               |                  | Whether or not the tags should render as readonly.                                                                                                                                                                                                                                                               |
| style                  | `CSSProperties`                                                                         |                  | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.                                                                                                                                                                                                          |
| escapeKeyBehavior      | `"clearSelection" \| "none"`                                                            | 'clearSelection' | Whether pressing the escape key should clear selection in the TagGroup or not.Most experiences should not modify this option as it eliminates a keyboard user's ability to easily clear selection. Only use if the escape key is being handled externally or should not trigger selection clearing contextually. |
| selectionBehavior      | `SelectionBehavior`                                                                     |                  | How multiple selection should behave in the collection.                                                                                                                                                                                                                                                          |
| shouldSelectOnPressUp  | `boolean`                                                                               |                  | Whether selection should occur on press up instead of press down.                                                                                                                                                                                                                                                |
| disabledKeys           | `Iterable<Key>`                                                                         |                  | The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.                                                                                                                                                                                                          |
| selectionMode          | `SelectionMode`                                                                         |                  | The type of selection that is allowed in the collection.                                                                                                                                                                                                                                                         |
| disallowEmptySelection | `boolean`                                                                               |                  | Whether the collection allows empty selection.                                                                                                                                                                                                                                                                   |
| selectedKeys           | `Iterable<Key> \| "all"`                                                                |                  | The currently selected keys in the collection (controlled).                                                                                                                                                                                                                                                      |
| defaultSelectedKeys    | `Iterable<Key> \| "all"`                                                                |                  | The initial selected keys in the collection (uncontrolled).                                                                                                                                                                                                                                                      |
| className              | `string`                                                                                |                  | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.                                                                                                                                                                                                         |
| dir                    | `string`                                                                                |                  |                                                                                                                                                                                                                                                                                                                  |
| lang                   | `string`                                                                                |                  |                                                                                                                                                                                                                                                                                                                  |
| inert                  | `boolean`                                                                               |                  |                                                                                                                                                                                                                                                                                                                  |
| translate              | `"yes" \| "no"`                                                                         |                  |                                                                                                                                                                                                                                                                                                                  |
| children               | `ReactNode \| ((item: T) => ReactNode)`                                                 |                  | The contents of the collection.                                                                                                                                                                                                                                                                                  |
| items                  | `Iterable<T>`                                                                           |                  | Item objects in the collection.                                                                                                                                                                                                                                                                                  |
| renderEmptyState       | `((props: TagListRenderProps) => ReactNode)`                                            |                  | Provides content to display when there are no items in the tag list.                                                                                                                                                                                                                                             |
| label                  | `ReactNode`                                                                             |                  | The label of the field.                                                                                                                                                                                                                                                                                          |
| description            | `ReactNode`                                                                             |                  | The helper message of the field.                                                                                                                                                                                                                                                                                 |
| errorMessage           | `ReactNode \| ((v: ValidationResult) => ReactNode)`                                     |                  | The error message of the field.                                                                                                                                                                                                                                                                                  |
| necessityIndicator     | `NecessityIndicator`                                                                    |                  | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                                                                                           |
| contextualHelp         | `ReactNode`                                                                             |                  | A ContextualHelp element to place next to the label.                                                                                                                                                                                                                                                             |

##### Events

| Prop                        | Type                                     | Default | Description                                        |
| --------------------------- | ---------------------------------------- | ------- | -------------------------------------------------- |
| onRemove                    | `((keys: Set<Key>) => void)`             |         | Handler that is called when a user deletes a tag.  |
| onSelectionChange           | `((keys: Selection) => void)`            |         | Handler that is called when the selection changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                    |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                    |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                    |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                    |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |

#### Tag

| Prop             | Type                                  | Default   | Description                                                                                                                                                                        |
| ---------------- | ------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| isInvalid        | `boolean`                             |           | Whether the tag is invalid or not.                                                                                                                                                 |
| isLoading        | `boolean`                             |           | Whether the tag is loading or not.                                                                                                                                                 |
| size             | `ResponsiveProp<TagSize>`             | "md"      | The size of the tag.                                                                                                                                                               |
| variant          | `TagVariant`                          | "neutral" | The visual style of the Tag.                                                                                                                                                       |
| clearButtonProps | `ClearButtonProps`                    |           | The props of the ClearButton.                                                                                                                                                      |
| spinnerProps     | `SpinnerProps`                        |           | The props of the Spinner.                                                                                                                                                          |
| style            | `StyleOrFunction<TagRenderProps>`     |           | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| dir              | `string`                              |           |                                                                                                                                                                                    |
| lang             | `string`                              |           |                                                                                                                                                                                    |
| inert            | `boolean`                             |           |                                                                                                                                                                                    |
| translate        | `"yes" \| "no"`                       |           |                                                                                                                                                                                    |
| id               | `Key`                                 |           | A unique id for the tag.                                                                                                                                                           |
| textValue        | `string`                              |           | A string representation of the tags's contents, used for accessibility. Required if children is not a plain text string.                                                           |
| isDisabled       | `boolean`                             |           | Whether the tag is disabled.                                                                                                                                                       |
| children         | `ChildrenOrFunction<TagRenderProps>`  |           | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className        | `ClassNameOrFunction<TagRenderProps>` |           | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| href             | `string`                              |           | A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).                                                                                     |
| hrefLang         | `string`                              |           | Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).                                                     |
| target           | `HTMLAttributeAnchorTarget`           |           | The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).                                                                     |
| rel              | `string`                              |           | The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).                                    |
| download         | `string \| boolean`                   |           | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).   |
| ping             | `string`                              |           | A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).                                     |
| referrerPolicy   | `HTMLAttributeReferrerPolicy`         |           | How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).                                   |
| routerOptions    | `undefined`                           |           | Options for the configured client side router.                                                                                                                                     |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type      | Default | Description                                                                                                                                                                                                                                                                                                                                               |
| ------------------- | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| excludeFromTabOrder | `boolean` |         | This property is only available for Tag without a TagGroup. Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |

### Migration Notes

#### TagGroup

Coming from Orbiter, you should be aware of the following changes:

* `onClear` is not supported.
* `validationState` is not supported. Use `isInvalid` instead,
* `readOnly` has been renamed `isReadOnly`.

#### Tag

Coming from Orbiter, you should be aware of the following changes:

* A dot is not supported
* `fluid` is not supported.
* `variant` values are now `neutral` | `subdued` | `progress` | `positive` | `caution` | `negative` | `option1` | `option2` | `option3` | `option4` | `option5` | `option6` and not `solid` | `outline`.
* `validationState` is not supported. Use `isInvalid` instead.

## Text

A text component is a primitive component matching Hopper's typography type scale.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/typography/text/src/Text.tsx>

```tsx
import { Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Text>Software built for everyone to do their best work</Text>
    );
}
```

### Usage

#### Sizes

You can alter the size of the text by specifying a `size` prop. The available sizes match the Hopper Typography Type Scale — a type scale is a set of [font-size and line-height](https://hopper.workleap.design/tokens/semantic/typography#tokens-body) pairs.

```tsx
import { Stack, Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Text size="xs">Software built for everyone to do their best work</Text>
            <Text size="sm">Software built for everyone to do their best work</Text>
            <Text size="md">Software built for everyone to do their best work</Text>
            <Text size="lg">Software built for everyone to do their best work</Text>
            <Text size="xl">Software built for everyone to do their best work</Text>
            <Text size="2xl">Software built for everyone to do their best work</Text>
        </Stack>
    );
}
```

#### Inherit

You can also alter the size to match the parent element's type scale by using the `inherit` size.

```tsx
import { Text, Div } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div fontSize="body-xs">
            <Text size="inherit">Software built for everyone to do their best work</Text>
        </Div>
    );
}
```

#### Nested

The Text component can be nested within other Text components and inherit the parent's size by default.

```tsx
import { Text } from "@hopper-ui/components";

export default function Example() {
    return (
        <Text size="lg">
            <Text color="primary">Mr.</Text> Johnson
        </Text>
    );
}
```

### Props

| Prop        | Type                       | Default | Description                       |
| ----------- | -------------------------- | ------- | --------------------------------- |
| size        | `ResponsiveProp<TextSize>` | "md"    | The Typography Type Scale to use. |
| style       | `CSSProperties`            |         |                                   |
| elementType | `string`                   |         |                                   |
| className   | `string`                   |         |                                   |

##### Accessibility

| Prop | Type     | Default | Description |
| ---- | -------- | ------- | ----------- |
| id   | `string` |         |             |

## TextArea

A text area serves as a multi-line, plain-text editing interface.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/inputs/src/TextArea.tsx>

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" label="Address" />
    );
}
```

### Usage

#### Disabled

A text area in a disabled state shows that an input field exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" isDisabled label="Address" />
    );
}
```

#### ReadOnly

The `isReadOnly` prop makes the text area's text content immutable. Unlike `isDisabled`, the text area remains focusable and the contents can still be copied. See [the MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) for more information.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" value="280 Baker Street" isReadOnly label="Address" />
    );
}
```

#### Error

A text area can be displayed in an error state to indicate that the user input is invalid.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" isInvalid label="Address" errorMessage="This field is required" />
    );
}
```

#### Sizes

A text area can vary in size. The height is determined by the number of rows. Each size has a unique font size, resulting in varying heights across different sizes.

```tsx
import { Stack, TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <TextArea label="Address" placeholder="123 Main St, City, State" size="sm" />
            <TextArea label="Address" placeholder="123 Main St, City, State" />
        </Stack>
    );
}
```

#### Labeling

If a visible label isn't specified, an `aria-label` must be provided to the text area for accessibility. If the field is labeled by a separate element, an `aria-labelledby` prop must be provided using the ID of the labeling element instead.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" aria-label="Address" />
    );
}
```

#### Description

A text area can have a description using the [HelperMessage](HelperMessage.md) component to provide additional context to the user.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" label="Address" description="Enter on multiple lines if needed" />
    );
}
```

#### Character Count

A character count can be displayed below the input. The character count is based on the `maxLength` prop. If the `maxLength` prop is not set, the character count will not be displayed.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" showCharacterCount maxLength={60} label="Address" />
    );
}
```

#### Max Length Exceeded

To exceed the max length, set the `allowExceedingMaxLength` prop to `true` – default is `false`. When the character count is displayed, it turns red if the max length is exceeded.

Note: If allowExceedingMaxLength is set, a character count is required to be set as well.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea
            showCharacterCount
            maxLength={20}
            allowExceedingMaxLength
            defaultValue="I appreciate their open-door policy and willingness to listen to our ideas and concerns."
            label="Comment"
        />
    );
}
```

#### Rows

The `rows` prop can be used to set the height of the text area and should be used in favor of the `height` prop. One row is equivalent to the height of one line of text.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea
            rows={8}
            defaultValue="I appreciate their open-door policy and willingness to listen to our ideas and concerns. "
            label="Name"
        />
    );
}
```

#### Min Rows

The `minRows` prop can be used to set the minimum height of the text area and should be used in favor of the `minHeight` prop. Defaults to 3.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea
            minRows={1}
            label="Prompt"
            placeholder="Ask anything..."
        />
    );
}
```

#### Max Rows

The `maxRows` prop can be used to set the maximum height of the text area and should be used in favor of the `maxHeight` prop. It differs from the `rows` prop in that it will not set the initial height of the text area.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea
            maxRows={8}
            defaultValue="I appreciate their open-door policy and willingness to listen to our ideas and concerns."
            label="Comment"
        />
    );
}
```

#### Vertical Resize

The `resizeMode` prop can be used to set the resize behavior of the text area. The default behavior is `none`, which prevents the user from resizing the text area. The `vertical` behavior allows the user to resize the text area vertically.

```tsx
import { TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea placeholder="123 Main St, City, State" resizeMode="vertical" label="Address" />
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a TextArea.

```tsx
import { ContextualHelp, TextArea } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextArea
            placeholder="123 Main St, City, State"
            label="Address"
            contextualHelp={<ContextualHelp>Write the full address</ContextualHelp>}
        />
    );
}
```

### Best Practices

Use a text area when the expected user input is more than a few words and could span multiple lines. It is commonly used for features like commentary or descriptions. It supports all the same states and functionality as text fields, except for the password functionality. A text area has several unique functionality not included in the text field, like the resize handle, character counter and text formatting tool bar.

* Be clearly labeled so it's obvious to users what they should enter into the field.
* Be labeled as “Optional” when you need to request input that's not required. View the Form pattern for more details on this.
* Only ask for information that's really needed.
* Validate input as soon as users have finished interacting with a field, but not before.

### Props

| Prop                         | Type                                                                                  | Default  | Description                                                                                                                                                                                                                                      |
| ---------------------------- | ------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| showCharacterCount           | `boolean`                                                                             |          | True to display the number of remaining allowed characters on the right of the input. Requires a valid value in the "maxLength" prop.                                                                                                            |
| minRows                      | `number`                                                                              | 3        | The minimum number of visible text lines.                                                                                                                                                                                                        |
| maxRows                      | `number`                                                                              |          | The maximum number of visible text lines before displaying a scrollbar.                                                                                                                                                                          |
| placeholder                  | `string`                                                                              |          | The placeholder text when the TextArea is empty.                                                                                                                                                                                                 |
| rows                         | `number`                                                                              |          | See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows).                                                                                                                                                         |
| cols                         | `number`                                                                              |          | See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols).                                                                                                                                                         |
| isFluid                      | `ResponsiveProp<boolean>`                                                             |          | If `true`, the TextArea will take all available width.                                                                                                                                                                                           |
| allowExceedingMaxLength      | `boolean`                                                                             |          | This should only be used with the `showCharacterCount` prop. If `true`, the TextArea will allow the text to go over the max length, but it will add an error look to the character count.                                                        |
| resizeMode                   | `ResponsiveProp<ResizeMode>`                                                          | "none"   | The resize mode value of the TextArea. It's equivalent to the CSS resize property.                                                                                                                                                               |
| inputRef                     | `MutableRefObject<HTMLTextAreaElement \| null>`                                       |          | A ref for the HTML textarea element.                                                                                                                                                                                                             |
| inputGroupProps              | `Partial<InputGroupProps>`                                                            |          | The props for the InputGroup.                                                                                                                                                                                                                    |
| inputProps                   | `Partial<TextAreaProps>`                                                              |          | The props for the Input.                                                                                                                                                                                                                         |
| remainingCharacterCountProps | `RemainingCharacterCountProps`                                                        |          | The props for the RemainingCharacterCount.                                                                                                                                                                                                       |
| form                         | `string`                                                                              |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).                     |
| style                        | `StyleOrFunction<TextFieldRenderProps>`                                               |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                |
| pattern                      | `string`                                                                              |          | Regex pattern that the value of the input must match to be valid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern).                                                                                 |
| validationBehavior           | `"native" \| "aria"`                                                                  | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                                   |
| enterKeyHint                 | `"search" \| "enter" \| "done" \| "go" \| "next" \| "previous" \| "send"`             |          | An enumerated attribute that defines what action label or icon to preset for the enter key on virtual keyboards. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint).                                    |
| isDisabled                   | `boolean`                                                                             |          | Whether the input is disabled.                                                                                                                                                                                                                   |
| isReadOnly                   | `boolean`                                                                             |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                                   |
| isRequired                   | `boolean`                                                                             |          | Whether user input is required on the input before form submission.                                                                                                                                                                              |
| isInvalid                    | `boolean`                                                                             |          | Whether the value is invalid.                                                                                                                                                                                                                    |
| validate                     | `((value: string) => true \| ValidationError \| null)`                                |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead.        |
| autoFocus                    | `boolean`                                                                             |          | Whether the element should receive focus on render.                                                                                                                                                                                              |
| value                        | `string`                                                                              |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue                 | `string`                                                                              |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| autoComplete                 | `string`                                                                              |          | Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).                                                            |
| maxLength                    | `number`                                                                              |          | The maximum number of characters supported by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength).                                                                                        |
| minLength                    | `number`                                                                              |          | The minimum number of characters required by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength).                                                                                         |
| type                         | `"search" \| "text" \| (string & {}) \| "url" \| "tel" \| "email" \| "password"`      | 'text'   | The type of input to render. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype).                                                                                                                         |
| inputMode                    | `"search" \| "text" \| "none" \| "url" \| "tel" \| "email" \| "numeric" \| "decimal"` |          | Hints at the type of data that might be entered by the user while editing the element or its contents. See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute).                             |
| autoCorrect                  | `string`                                                                              |          | An attribute that takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#autocomplete). |
| spellCheck                   | `string`                                                                              |          | An enumerated attribute that defines whether the element may be checked for spelling errors. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).                                                          |
| name                         | `string`                                                                              |          | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                                    |
| className                    | `ClassNameOrFunction<TextFieldRenderProps>`                                           |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                               |
| dir                          | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| lang                         | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| inert                        | `boolean`                                                                             |          |                                                                                                                                                                                                                                                  |
| translate                    | `"yes" \| "no"`                                                                       |          |                                                                                                                                                                                                                                                  |
| description                  | `ReactNode`                                                                           |          | The helper message of the field.                                                                                                                                                                                                                 |
| errorMessage                 | `ReactNode \| ((v: ValidationResult) => ReactNode)`                                   |          | The error message of the field.                                                                                                                                                                                                                  |
| label                        | `ReactNode`                                                                           |          | The label of the field.                                                                                                                                                                                                                          |
| necessityIndicator           | `NecessityIndicator`                                                                  |          | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                           |
| size                         | `ResponsiveProp<FieldSize>`                                                           | "md"     | A Field can vary in size.                                                                                                                                                                                                                        |
| contextualHelp               | `ReactNode`                                                                           |          | A ContextualHelp element to place next to the label.                                                                                                                                                                                             |

##### Events

| Prop                        | Type                                                   | Default | Description                                                                                                                                                                                                |
| --------------------------- | ------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onFocus                     | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element receives focus.                                                                                                                                                    |
| onBlur                      | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element loses focus.                                                                                                                                                       |
| onFocusChange               | `((isFocused: boolean) => void)`                       |         | Handler that is called when the element's focus status changes.                                                                                                                                            |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is pressed.                                                                                                                                                              |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is released.                                                                                                                                                             |
| onChange                    | `((value: string) => void)`                            |         | Handler that is called when the value changes.                                                                                                                                                             |
| onCopy                      | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).                                                                          |
| onCut                       | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).                                                                             |
| onPaste                     | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).                                                                         |
| onCompositionStart          | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).                   |
| onCompositionEnd            | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event). |
| onCompositionUpdate         | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).              |
| onSelect                    | `ReactEventHandler<HTMLInputElement>`                  |         | Handler that is called when text in the input is selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).                                                               |
| onBeforeInput               | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).                                            |
| onInput                     | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).                                                              |
| onClick                     | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                  | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-activedescendant | `string`                                                                              |         | Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.                                                                                                                                                                              |
| aria-autocomplete     | `"none" \| "inline" \| "list" \| "both"`                                              |         | 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-haspopup         | `boolean \| "dialog" \| "menu" \| "grid" \| "false" \| "true" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls         | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-label            | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby       | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby      | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details          | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |
| excludeFromTabOrder   | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                    | `string`                                                                              |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-errormessage     | `string`                                                                              |         | Identifies the element that provides an error message for the object.                                                                                                                                                                                                                         |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* Boolean props are now prefixed by `is`.
* There is no longer a loading state.
* `icon` prop has been removed since it is not used in a TextArea.
* `button` prop has been removed.
* `wrapperProps` no longer exists.
* `validationState` has been changed to `isInvalid`.
* `showCharacterCount` has been added.

## TextField

A text field allows a user to enter a plain text value.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/inputs/src/TextField.tsx>

Specialized text fields are available for different scenarios:

* If you want a text field with `type="search"`, use the [SearchField](./SearchField.md) component.
* If you want a text field that shows/hides a password, use the [PasswordField](./PasswordField.md) component.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField placeholder="Full name (e.g., Jane Smith)" label="Name" />
    );
}
```

### Usage

#### Disabled

A text field in a disabled state shows that an input field exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField placeholder="Full name (e.g., Jane Smith)" isDisabled label="Name" />
    );
}
```

#### ReadOnly

The `isReadOnly` prop makes the text field's text content immutable. Unlike `isDisabled`, the text field remains focusable and the contents can still be copied. See [the MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly) for more information.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField value="John Doe" placeholder="Full name (e.g., Jane Smith)" isReadOnly label="Name" />
    );
}
```

#### Error

A text field can be displayed in an error state to indicate that the user input is invalid.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField
            placeholder="Full name (e.g., Jane Smith)"
            isInvalid
            label="Name"
            errorMessage="This field is required"
        />
    );
}
```

#### Clearable

The `isClearable` prop can be set to `true` to display a clear button at the end of the input.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField defaultValue="John Doe" placeholder="Full name (e.g., Jane Smith)" isClearable label="Name" />
    );
}
```

#### Sizes

Text fields have multiple sizes to choose from.

```tsx
import { Stack, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <TextField label="Name" placeholder="Full name (e.g., Jane Smith)" size="sm" />
            <TextField label="Name" placeholder="Full name (e.g., Jane Smith)" />
        </Stack>
    );
}
```

#### Labeling

If a visible label isn't specified, an `aria-label` must be provided to the text field for accessibility. If the field is labeled by a separate element, an `aria-labelledby` prop must be provided using the ID of the labeling element instead.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField placeholder="Full name (e.g., Jane Smith)" aria-label="Name" />
    );
}
```

#### Description

A text field with a helper message.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField
            placeholder="Full name (e.g., Jane Smith)"
            label="Name"
            description="Enter both first name and last name"
        />
    );
}
```

#### Icon Prefix

An icon can be displayed at the start of the input.

```tsx
import { TextField } from "@hopper-ui/components";
import { SearchIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <TextField placeholder="Full name (e.g., Jane Smith)" prefix={<SearchIcon />} label="Name" />
    );
}
```

#### Text Prefix

A short text can be displayed at the start of the input.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField placeholder="(000) 000-0000" prefix="+1" label="Phone number" />
    );
}
```

#### Character Count

A character count can be displayed at the end of the input. The character count is based on the `maxLength` prop. If the `maxLength` prop is not set, the character count will not be displayed.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField placeholder="Full name (e.g., Jane Smith)" showCharacterCount maxLength={60} label="Name" />
    );
}
```

#### Max Length Exceeded

To exceed the max length, set the `allowExceedingMaxLength` prop to `true` – default is `false`. When the character count is displayed, it turns red if the max length is exceeded.

Note: If allowExceedingMaxLength is set, a character count is required to be set as well.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField
            showCharacterCount
            maxLength={20}
            allowExceedingMaxLength
            defaultValue="I appreciate their open-door policy and willingness to listen to our ideas and concerns."
            label="Name"
        />
    );
}
```

#### ContextualHelp

A [ContextualHelp](/components/ContextualHelp.md) element may be placed next to the label to provide additional information or help about a TextField.

```tsx
import { ContextualHelp, TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField
            contextualHelp={<ContextualHelp>Write your name</ContextualHelp>}
            placeholder="Full name (e.g., Jane Smith)"
            label="Name"
        />
    );
}
```

#### Fluid

A text field can take the width of its container.

```tsx
import { TextField } from "@hopper-ui/components";

export default function Example() {
    return (
        <TextField placeholder="Full name (e.g., Jane Smith)" isFluid label="Name" />
    );
}
```

#### Debounce

The `useDebounce` hook can be used to debounce user input in a text field.

```tsx

import { TextField, useDebounce } from "@hopper-ui/components";
import { useEffect, useState } from "react";

export default function Example() {
    const [inputValue, setInputValue] = useState("");
    const [debouncedEmail, setDebouncedEmail] = useDebounce("", 400);
    const [isValid, setIsValid] = useState(true);
    const [isValidating, setIsValidating] = useState(false);

    const handleInputChange = (value: string) => {
        setInputValue(value); // Update input immediately for responsiveness
        setDebouncedEmail(value); // Trigger debounced validation
        if (value) {
            setIsValidating(true);
        }
    };

    useEffect(() => {
        if (debouncedEmail) {
            const isEmailValid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(debouncedEmail);
            setIsValid(isEmailValid);
        }
        setIsValidating(false);
    }, [debouncedEmail]);

    return (
        <TextField
            type="email"
            value={inputValue}
            onChange={handleInputChange}
            placeholder="Enter your email"
            description={isValidating ? "Validating..." : undefined}
            errorMessage="Invalid email"
            isInvalid={!isValid && !isValidating && !!inputValue}
        />
    );
}
```

### Props

| Prop                         | Type                                                                                  | Default  | Description                                                                                                                                                                                                                                      |
| ---------------------------- | ------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| prefix                       | `ReactNode`                                                                           |          | An icon or text to display at the start of the input.                                                                                                                                                                                            |
| showCharacterCount           | `boolean`                                                                             | false    | True to display the number of remaining allowed characters on the right of the input. Requires a valid value in the "maxLength" prop.                                                                                                            |
| isClearable                  | `boolean`                                                                             |          | Whether the TextField is clearable.                                                                                                                                                                                                              |
| placeholder                  | `string`                                                                              |          | The placeholder text when the TextField is empty.                                                                                                                                                                                                |
| allowExceedingMaxLength      | `boolean`                                                                             |          | This should only be used with the `showCharacterCount` prop. If `true`, the TextField will allow the text to go over the max length, but it will add an error look to the character count.                                                       |
| isFluid                      | `ResponsiveProp<boolean>`                                                             | false    | If `true`, the TextField will take all available width.                                                                                                                                                                                          |
| inputRef                     | `MutableRefObject<HTMLInputElement \| null>`                                          |          | A ref for the HTML input element.                                                                                                                                                                                                                |
| inputProps                   | `Partial<InputProps>`                                                                 |          | The props for the Input.                                                                                                                                                                                                                         |
| inputGroupProps              | `Partial<InputGroupProps>`                                                            |          | The props for the InputGroup.                                                                                                                                                                                                                    |
| remainingCharacterCountProps | `RemainingCharacterCountProps`                                                        |          | The props for the RemainingCharacterCount.                                                                                                                                                                                                       |
| form                         | `string`                                                                              |          | The `<form>` element to associate the input with. The value of this attribute must be the id of a `<form>` in the same document. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).                     |
| style                        | `StyleOrFunction<TextFieldRenderProps>`                                               |          | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.                                                                |
| pattern                      | `string`                                                                              |          | Regex pattern that the value of the input must match to be valid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern).                                                                                 |
| validationBehavior           | `"native" \| "aria"`                                                                  | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.                                                                                   |
| enterKeyHint                 | `"search" \| "enter" \| "done" \| "go" \| "next" \| "previous" \| "send"`             |          | An enumerated attribute that defines what action label or icon to preset for the enter key on virtual keyboards. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint).                                    |
| isDisabled                   | `boolean`                                                                             |          | Whether the input is disabled.                                                                                                                                                                                                                   |
| isReadOnly                   | `boolean`                                                                             |          | Whether the input can be selected but not changed by the user.                                                                                                                                                                                   |
| isRequired                   | `boolean`                                                                             |          | Whether user input is required on the input before form submission.                                                                                                                                                                              |
| isInvalid                    | `boolean`                                                                             |          | Whether the value is invalid.                                                                                                                                                                                                                    |
| validate                     | `((value: string) => true \| ValidationError \| null)`                                |          | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead.        |
| autoFocus                    | `boolean`                                                                             |          | Whether the element should receive focus on render.                                                                                                                                                                                              |
| value                        | `string`                                                                              |          | The current value (controlled).                                                                                                                                                                                                                  |
| defaultValue                 | `string`                                                                              |          | The default value (uncontrolled).                                                                                                                                                                                                                |
| autoComplete                 | `string`                                                                              |          | Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete).                                                            |
| maxLength                    | `number`                                                                              |          | The maximum number of characters supported by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength).                                                                                        |
| minLength                    | `number`                                                                              |          | The minimum number of characters required by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength).                                                                                         |
| type                         | `"search" \| "text" \| (string & {}) \| "url" \| "tel" \| "email" \| "password"`      | 'text'   | The type of input to render. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype).                                                                                                                         |
| inputMode                    | `"search" \| "text" \| "none" \| "url" \| "tel" \| "email" \| "numeric" \| "decimal"` |          | Hints at the type of data that might be entered by the user while editing the element or its contents. See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute).                             |
| autoCorrect                  | `string`                                                                              |          | An attribute that takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#autocomplete). |
| spellCheck                   | `string`                                                                              |          | An enumerated attribute that defines whether the element may be checked for spelling errors. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).                                                          |
| name                         | `string`                                                                              |          | The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).                                                                                    |
| className                    | `ClassNameOrFunction<TextFieldRenderProps>`                                           |          | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.                                                               |
| dir                          | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| lang                         | `string`                                                                              |          |                                                                                                                                                                                                                                                  |
| inert                        | `boolean`                                                                             |          |                                                                                                                                                                                                                                                  |
| translate                    | `"yes" \| "no"`                                                                       |          |                                                                                                                                                                                                                                                  |
| description                  | `ReactNode`                                                                           |          | The helper message of the field.                                                                                                                                                                                                                 |
| errorMessage                 | `ReactNode \| ((v: ValidationResult) => ReactNode)`                                   |          | The error message of the field.                                                                                                                                                                                                                  |
| label                        | `ReactNode`                                                                           |          | The label of the field.                                                                                                                                                                                                                          |
| necessityIndicator           | `NecessityIndicator`                                                                  |          | Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.                                                                                                           |
| size                         | `ResponsiveProp<FieldSize>`                                                           | "md"     | A Field can vary in size.                                                                                                                                                                                                                        |
| contextualHelp               | `ReactNode`                                                                           |          | A ContextualHelp element to place next to the label.                                                                                                                                                                                             |

##### Events

| Prop                        | Type                                                   | Default | Description                                                                                                                                                                                                |
| --------------------------- | ------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onClear                     | `(() => void)`                                         |         | Handler that is called when the clear button is pressed.                                                                                                                                                   |
| onFocus                     | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element receives focus.                                                                                                                                                    |
| onBlur                      | `((e: FocusEvent<HTMLInputElement, Element>) => void)` |         | Handler that is called when the element loses focus.                                                                                                                                                       |
| onFocusChange               | `((isFocused: boolean) => void)`                       |         | Handler that is called when the element's focus status changes.                                                                                                                                            |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is pressed.                                                                                                                                                              |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                         |         | Handler that is called when a key is released.                                                                                                                                                             |
| onChange                    | `((value: string) => void)`                            |         | Handler that is called when the value changes.                                                                                                                                                             |
| onCopy                      | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user copies text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy).                                                                          |
| onCut                       | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user cuts text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut).                                                                             |
| onPaste                     | `ClipboardEventHandler<HTMLInputElement>`              |         | Handler that is called when the user pastes text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste).                                                                         |
| onCompositionStart          | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event).                   |
| onCompositionEnd            | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event). |
| onCompositionUpdate         | `CompositionEventHandler<HTMLInputElement>`            |         | Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event).              |
| onSelect                    | `ReactEventHandler<HTMLInputElement>`                  |         | Handler that is called when text in the input is selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event).                                                               |
| onBeforeInput               | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event).                                            |
| onInput                     | `FormEventHandler<HTMLInputElement>`                   |         | Handler that is called when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event).                                                              |
| onClick                     | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                            |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                            |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                    |         |                                                                                                                                                                                                            |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                |         |                                                                                                                                                                                                            |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`               |         |                                                                                                                                                                                                            |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                  | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-activedescendant | `string`                                                                              |         | Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.                                                                                                                                                                              |
| aria-autocomplete     | `"none" \| "inline" \| "list" \| "both"`                                              |         | 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-haspopup         | `boolean \| "dialog" \| "menu" \| "grid" \| "false" \| "true" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls         | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-label            | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby       | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby      | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details          | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |
| excludeFromTabOrder   | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| id                    | `string`                                                                              |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).                                                                                                                                                                           |
| aria-errormessage     | `string`                                                                              |         | Identifies the element that provides an error message for the object.                                                                                                                                                                                                                         |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `disabled` has been renamed `isDisabled`.
* `fluid` has been renamed `isFluid`.
* `readOnly` has been renamed `isReadOnly`.
* There is no longer a loading state.
* `icon` prop has been renamed to `prefix`.
* Button props have been removed. To add a clear button, use the `isClearable` prop. For a more complex use case, create your own input using InputGroup.
* `wrapperProps` no longer exists.
* `validationState` has been changed to `isInvalid`.
* `showCharacterCount` has been added.

## Tile

A tile groups information into an interactive element to let users browse and take action on a group of related items.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/tile/src/Tile.tsx>

```tsx
import { Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Tile id="frog">Frog</Tile>
    );
}
```

### Anatomy

#### Structure

```tsx
<Tile>
    <Heading /> /* (Optional) The heading of the Tile */
    <Content /> /* (Optional) The content of the Tile, but required if any other elements are present */
    <Image /> /* (Optional) The image of the Tile */
    <Illustration /> /* (Optional) The illustration of the Tile */
</Tile>
```

#### Composed Components

A `Tile` uses the following components:

| Component    | Description                                                                                          |
| ------------ | ---------------------------------------------------------------------------------------------------- |
| Content      | A placeholder for the main content section of a component.                                           |
| Heading      | A heading is a primitive component matching Hopper's typography type scale.                          |
| Illustration | An illustration compose an image with a background color. Use an illustration as an hero in a modal. |
| Image        | An image component that can be used to display images.                                               |

### Usage & Layout Samples

To facilitate the migration process, we've provided layout samples as reference guides. These examples demonstrate how to recreate features previously supported in [Orbiter](https://wl-orbiter-website.netlify.app/?path=/docs/tile--docs).

#### Basic

A tile consists of minimally some content.

```tsx
import { Content, Div, Heading, Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_width="20rem">
            <Tile id="buy">
                <Heading>Buy a ticket</Heading>
                <Content>Purchase a ticket for any of our ribbit adventures.</Content>
            </Tile>
        </Div>
    );
}
```

#### Image

A tile can have an image.

```tsx
import { Content, Div, Heading, Image, Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_width="20rem">
            <Tile id="buy">
                <Image alt="frog" src="/cute-frog.png" />
                <Heading>Buy a ticket</Heading>
                <Content>
                    Tickets are not refundable and not transferable. A confirmation email will be sent
                    within the next few minutes.
                </Content>
            </Tile>
        </Div>
    );
}
```

Or an illustration with a background color.

```tsx
import { Content, Div, Heading, Illustration, Image, Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_width="20rem">
            <Tile id="buy">
                <Illustration backgroundColor="primary-weak">
                    <Image alt="frog" src="/cute-frog.png" />
                </Illustration>
                <Heading>Buy a ticket</Heading>
                <Content>
                    Tickets are not refundable and not transferable. A confirmation email will be sent
                    within the next few minutes
                </Content>
            </Tile>
        </Div>
    );
}
```

#### Selected

A tile can be selected.

```tsx
import { Content, Div, Heading, Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_width="20rem">
            <Tile isSelected id="buy">
                <Heading>Buy a ticket</Heading>
                <Content>Purchase a ticket for any of our space travel adventure.</Content>
            </Tile>
        </Div>
    );
}
```

#### Read-only

A tile can be read-only.

```tsx
import { Content, Div, Heading, Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_width="20rem">
            <Tile id="buy" isReadonly>
                <Heading>Buy a ticket</Heading>
                <Content>Purchase a ticket for any of our ribbit adventures.</Content>
            </Tile>
        </Div>
    );
}
```

#### Disabled

A tile can be disabled.

```tsx
import { Content, Div, Heading, Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Div UNSAFE_width="20rem">
            <Tile isDisabled id="buy">
                <Heading>Buy a ticket</Heading>
                <Content>Purchase a ticket for any of our space travel adventure.</Content>
            </Tile>
        </Div>
    );
}
```

#### Orientation

A tile can render horizontally.

```tsx
import { Content, Heading, Illustration, Image, Inline, Tile } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline
            wrap={{
                base: true,
                md: false
            }}
        >
            <Tile id="buy" orientation="horizontal">
                <Image alt="frog" src="/cute-frog.png" />
                <Heading>Buy a ticket</Heading>
                <Content>
                    Tickets are not refundable and not transferable. A confirmation email will be sent
                    within the next few minutes.
                </Content>
            </Tile>
            <Tile id="buy" orientation="horizontal">
                <Illustration backgroundColor="primary-weak">
                    <Image alt="frog" src="/cute-frog.png" width="100%" />
                </Illustration>
                <Heading>Buy a ticket</Heading>
                <Content>
                    Tickets are not refundable and not transferable. A confirmation email will be sent
                    within the next few minutes.
                </Content>
            </Tile>
        </Inline>
    );
}
```

#### Controlled

A tile can handle `isSelected` state in controlled mode.

```tsx
import { Content, Div, Heading, Tile } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [isSelected, setIsSelected] = useState(false);
    const handleChange = useCallback(() => {
        setIsSelected(x => !x);
    }, [setIsSelected]);

    return (
        <Div UNSAFE_width="20rem">
            <Tile id="buy" isSelected={isSelected} onChange={handleChange}>
                <Heading>Buy a ticket</Heading>
                <Content>Purchase a ticket for any of our space travel adventure.</Content>
            </Tile>
        </Div>
    );
}
```

### Best Practices

Tiles are always used in groups. Similarly to Radio, they should:

* Always have a clear label. You can use a description subtext to provide more details.
* Be part of a group of minimally two tiles.
* Be used to have users select one tile at once.
* Include mutually exclusive options.
* Be ordered in a logical way that users can understand.

Unlike Radio, it is not mandatory for Tiles to have a default option selected.

### Props

| Prop            | Type                                           | Default    | Description                                                                                                                                                                        |
| --------------- | ---------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id              | `Key`                                          |            | The id of the Tile, matching the values used in TileGroup's `selectedKeys` prop.                                                                                                   |
| isReadonly      | `boolean`                                      |            | Whether or not the Tile is read-only.                                                                                                                                              |
| orientation     | `ResponsiveProp<Orientation>`                  | 'vertical' | The axis the Tile should align with.                                                                                                                                               |
| style           | `StyleOrFunction<ToggleButtonRenderProps>`     |            | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| children        | `ChildrenOrFunction<ToggleButtonRenderProps>`  |            | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| isSelected      | `boolean`                                      |            | Whether the element should be selected (controlled).                                                                                                                               |
| defaultSelected | `boolean`                                      |            | Whether the element should be selected (uncontrolled).                                                                                                                             |
| isDisabled      | `boolean`                                      |            | Whether the button is disabled.                                                                                                                                                    |
| autoFocus       | `boolean`                                      |            | Whether the element should receive focus on render.                                                                                                                                |
| dir             | `string`                                       |            |                                                                                                                                                                                    |
| lang            | `string`                                       |            |                                                                                                                                                                                    |
| inert           | `boolean`                                      |            |                                                                                                                                                                                    |
| translate       | `"yes" \| "no"`                                |            |                                                                                                                                                                                    |
| className       | `ClassNameOrFunction<ToggleButtonRenderProps>` |            | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onChange                    | `((isSelected: boolean) => void)`                         |         | Handler that is called when the element's selection state changes.                                                                                                                                        |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-disabled       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element is disabled to users of assistive technology.                                                                                                                                                                                                                   |
| aria-expanded       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.                                                                                                                                                                                   |
| aria-haspopup       | `boolean \| "dialog" \| "menu" \| "grid" \| "true" \| "false" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls       | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-pressed        | `boolean \| "true" \| "false" \| "mixed"`                                             |         | Indicates the current "pressed" state of toggle buttons.                                                                                                                                                                                                                                      |
| preventFocusOnPress | `boolean`                                                                             |         | Whether to prevent focus from moving to the button when pressing it.Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.                  |
| excludeFromTabOrder | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| aria-label          | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby     | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby    | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details        | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `checked` has been renamed `isSelected`.
* `defaultChecked` has been renamed `defaultSelected`.
* `value` has been removed, use the `id` instead.

## TileGroup

A TileGroup groups Tiles to let users browse and take action on a group of related items.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/Tile/src/TileGroup.tsx>

```tsx
import { Tile, TileGroup } from "../../src/index.ts";

export default function Example() {
    return (
        <TileGroup aria-label="Animals">
            <Tile id="frog">Frog</Tile>
            <Tile id="camel">Camel</Tile>
            <Tile id="elephant">Elephant</Tile>
        </TileGroup>
    );
}
```

### Anatomy

#### Structure

```tsx
<TileGroup>
    <Tile /> /* (Required) A tile in a TileGroup */
</TileGroup>
```

### Usage

#### Selected

A tile group can have an item initially selected, by using `defaultSelectedKeys` for uncontrolled or `selectedKeys` for controlled. Here's an example where one item is selected using defaultSelectedKeys.

```tsx
import { Tile, TileGroup } from "../../src/index.ts";

export default function Example() {
    return (
        <TileGroup aria-label="Animals" defaultSelectedKeys={["camel"]}>
            <Tile id="frog">Frog</Tile>
            <Tile id="camel">Camel</Tile>
            <Tile id="elephant">Elephant</Tile>
        </TileGroup>
    );
}
```

#### Controlled

A tile group can have a controlled selected value. In this example, it shows how it is possible to select an option.

```tsx
import type { Key } from "@hopper-ui/components";
import { useState } from "react";

import { Tile, TileGroup } from "../../src/index.ts";

export default function Example() {
    const [selectedKeys, setSelectedKeys] = useState<Set<Key>>();

    const handleSelectionChange = (keys: Set<Key>) => {
        setSelectedKeys(keys);
    };

    return (
        <TileGroup
            aria-label="Animals"
            selectedKeys={selectedKeys}
            onSelectionChange={handleSelectionChange}
        >
            <Tile id="frog">Frog</Tile>
            <Tile id="camel">Camel</Tile>
            <Tile id="elephant">Elephant</Tile>
        </TileGroup>
    );
}
```

#### Read-only

A tile group can be read-only.

```tsx
import { Tile, TileGroup } from "../../src/index.ts";

export default function Example() {
    return (
        <TileGroup aria-label="Animals" isReadonly>
            <Tile id="frog">Frog</Tile>
            <Tile id="camel">Camel</Tile>
            <Tile id="elephant">Elephant</Tile>
        </TileGroup>
    );
}
```

#### Disabled

A tile group can be disabled.

```tsx
import { Tile, TileGroup } from "../../src/index.ts";

export default function Example() {
    return (
        <TileGroup aria-label="Animals" isDisabled>
            <Tile id="frog">Frog</Tile>
            <Tile id="camel">Camel</Tile>
            <Tile id="elephant">Elephant</Tile>
        </TileGroup>
    );
}
```

#### Wrapping

Tiles are automatically wrapped

```tsx
import { Tile, TileGroup } from "../../src/index.ts";

export default function Example() {
    return (
        <TileGroup aria-label="Animals">
            <Tile id="frog">Frog</Tile>
            <Tile id="camel">Camel</Tile>
            <Tile id="elephant">Elephant</Tile>
            <Tile id="giraffe">Giraffe</Tile>
            <Tile id="hippo">Hippo</Tile>
        </TileGroup>
    );
}
```

#### Number of columns

A tile group can have a number of columns. Default is 3. Here's an example where it's 4.

```tsx
import { Tile, TileGroup } from "../../src/index.ts";

export default function Example() {
    return (
        <TileGroup aria-label="Animals" numberOfColumns={4}>
            <Tile id="frog">Frog</Tile>
            <Tile id="camel">Camel</Tile>
            <Tile id="elephant">Elephant</Tile>
            <Tile id="giraffe">Giraffe</Tile>
            <Tile id="hippo">Hippo</Tile>
        </TileGroup>
    );
}
```

### Best Practices

Tiles are always used in groups. Similarly to Radio, they should:

* Always have a clear label. You can use a description subtext to provide more details.
* Be part of a group of minimally two tiles.
* Be used to have users select one tile at once.
* Include mutually exclusive options.
* Be ordered in a logical way that users can understand.

Unlike Radio, it is not mandatory for Tiles to have a default option selected.

### Props

| Prop                   | Type                                                | Default      | Description                                                                                                                                                                        |
| ---------------------- | --------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| numberOfColumns        | `ResponsiveProp<number>`                            | 3            | The number of columns to display the tiles in.                                                                                                                                     |
| selectionMode          | `"single" \| "multiple"`                            | "single"     | Whether single or multiple selection is enabled.                                                                                                                                   |
| disallowEmptySelection | `boolean`                                           | true         | Whether the collection allows empty selection.                                                                                                                                     |
| isReadonly             | `boolean`                                           |              | Whether the collection is readonly.                                                                                                                                                |
| style                  | `StyleOrFunction<ToggleButtonGroupRenderProps>`     |              | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| orientation            | `Orientation`                                       | 'horizontal' | The orientation of the the toggle button group.                                                                                                                                    |
| selectedKeys           | `Iterable<Key>`                                     |              | The currently selected keys in the collection (controlled).                                                                                                                        |
| defaultSelectedKeys    | `Iterable<Key>`                                     |              | The initial selected keys in the collection (uncontrolled).                                                                                                                        |
| isDisabled             | `boolean`                                           |              | Whether all items are disabled.                                                                                                                                                    |
| children               | `ChildrenOrFunction<ToggleButtonGroupRenderProps>`  |              | The children of the component. A function may be provided to alter the children based on component state.                                                                          |
| className              | `ClassNameOrFunction<ToggleButtonGroupRenderProps>` |              | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |
| dir                    | `string`                                            |              |                                                                                                                                                                                    |
| lang                   | `string`                                            |              |                                                                                                                                                                                    |
| inert                  | `boolean`                                           |              |                                                                                                                                                                                    |
| translate              | `"yes" \| "no"`                                     |              |                                                                                                                                                                                    |

##### Events

| Prop                        | Type                                     | Default | Description                                        |
| --------------------------- | ---------------------------------------- | ------- | -------------------------------------------------- |
| onSelectionChange           | `((keys: Set<Key>) => void)`             |         | Handler that is called when the selection changes. |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |                                                    |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |                                                    |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |                                                    |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |                                                    |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |                                                    |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |                                                    |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |                                                    |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |                                                    |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                        |
| ---------------- | -------- | ------- | -------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                            |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                              |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                    |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `align` has been removed, use `alignItems` instead.
* `autoFocus` has been removed.
* `disabled` has been renamed to `isDisabled`.
* `inline` has been removed.
* `reverse` is not supported, use `flex-direction` or `row-reverse` instead.
* `onChange` has been removed, use `onSelectionChange` instead.
* `selectionMode` type "none" should be `undefined` instead.
* `defaultValue` has been removed.
* `value` has been removed.
* `rowSize` has been removed.

## ToggleButton

Offer a similar experience as a checkbox or radio with the appearance of a button.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/buttons/src/ToggleButton.tsx>

```tsx
import { ToggleButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <ToggleButton>Toggle me</ToggleButton>
    );
}
```

### Anatomy

#### Structure

```tsx
<ToggleButton>
    <IconList /> /* (Optional) A list of icons in the ToggleButton */
    <Icon /> /* (Optional) An icon in the ToggleButton */
    <Text /> /* (Optional) Text in the ToggleButton, required if using an Icon or an IconList */
</ToggleButton>
```

#### Composed Components

A `ToggleButton` uses the following components:

| Component | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| Icon      | An icon component is used to render a custom icon.                                 |
| IconList  | An IconList encapsulates a collection of icons.                                    |
| Text      | A text component is a primitive component matching Hopper's typography type scale. |

### Usage

#### Variants

A toggle button can use different variants.

```tsx
import { Inline, ToggleButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <ToggleButton variant="primary">Save</ToggleButton>
            <ToggleButton variant="secondary">Save</ToggleButton>
            <ToggleButton variant="upsell">Save</ToggleButton>
            <ToggleButton variant="danger">Save</ToggleButton>
            <ToggleButton variant="ghost-primary">Save</ToggleButton>
            <ToggleButton variant="ghost-secondary">Save</ToggleButton>
            <ToggleButton variant="ghost-danger">Save</ToggleButton>
        </Inline>
    );
}
```

#### Sizes

A toggle button can vary in size.

```tsx
import { Inline, ToggleButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <ToggleButton variant="primary">Save</ToggleButton>
            <ToggleButton size="sm" variant="primary">Save</ToggleButton>
            <ToggleButton size="xs" variant="primary">Save</ToggleButton>
        </Inline>
    );
}
```

#### Disabled

A toggle button can be disabled.

```tsx
import { Inline, ToggleButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <ToggleButton isDisabled variant="primary">Save</ToggleButton>
            <ToggleButton isDisabled variant="secondary">Save</ToggleButton>
            <ToggleButton isDisabled variant="upsell">Save</ToggleButton>
            <ToggleButton isDisabled variant="danger">Save</ToggleButton>
            <ToggleButton isDisabled variant="ghost-primary">Save</ToggleButton>
            <ToggleButton isDisabled variant="ghost-secondary">Save</ToggleButton>
            <ToggleButton isDisabled variant="ghost-danger">Save</ToggleButton>
        </Inline>
    );
}
```

#### Loading

A toggle button can show a loading indicator. The button text is hidden but the button maintains the width that it would have if the text were visible.

```tsx
import { Inline, ToggleButton } from "@hopper-ui/components";

export default function Example() {
    return (
        <Inline>
            <ToggleButton isLoading variant="primary">Save</ToggleButton>
            <ToggleButton isLoading variant="secondary">Save</ToggleButton>
            <ToggleButton isLoading variant="danger">Save</ToggleButton>
            <ToggleButton isLoading variant="upsell">Save</ToggleButton>
            <ToggleButton isLoading variant="ghost-primary">Save</ToggleButton>
            <ToggleButton isLoading variant="ghost-secondary">Save</ToggleButton>
            <ToggleButton isLoading variant="ghost-danger">Save</ToggleButton>
        </Inline>
    );
}
```

#### Pending

Toggle buttons can indicate that a quick progress task is taking place (e.g., saving settings on a server). After a 1 second delay, an indeterminate spinner will be displayed in place of the button label and icon.

```tsx
import { ToggleButton } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [isLoading, setIsLoading] = useState(false);

    const handlePress = useCallback(() => {
        setIsLoading(true);

        setTimeout(() => {
            setIsLoading(false);
        }, 3000);
    }, [setIsLoading]);

    return (
        <ToggleButton isLoading={isLoading} onPress={handlePress}>
            Click me!
        </ToggleButton>
    );
}
```

#### Fluid

A toggle button can be expanded to full width to fill its parent container.

```tsx
import { Inline, Text, ToggleButton } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <ToggleButton isFluid variant="primary">
                Save
            </ToggleButton>
            <ToggleButton isFluid variant="primary">
                <SparklesIcon />
                <Text>Save</Text>
            </ToggleButton>
            <ToggleButton isFluid>
                <Text>Save</Text>
                <SparklesIcon slot="end-icon" />
            </ToggleButton>
        </Inline>
    );
}
```

#### Icon Only

A toggle button can contain only an icon. An accessible name must be provided through [aria-label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) prop. See also [WCAG practices](https://www.w3.org/TR/WCAG20-TECHS/ARIA6.html).

```tsx
import { Inline, ToggleButton } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <ToggleButton aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </ToggleButton>
            <ToggleButton size="sm" aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </ToggleButton>
            <ToggleButton size="xs" aria-label="Clean" variant="secondary">
                <SparklesIcon />
            </ToggleButton>
        </Inline>
    );
}
```

#### Icon

A toggle button can contain icons.

```tsx
import { Inline, Text, ToggleButton } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <ToggleButton aria-label="Save" variant="secondary">
                <SparklesIcon />
                <Text>Save</Text>
            </ToggleButton>
            <ToggleButton size="sm" aria-label="Save" variant="secondary">
                <SparklesIcon />
                <Text>Save</Text>
            </ToggleButton>
            <ToggleButton size="xs" aria-label="Save" variant="secondary">
                <SparklesIcon />
                <Text>Save</Text>
            </ToggleButton>
        </Inline>
    );
}
```

#### End Icon

Nonstandard end icons can be provided to handle special cases. However, think twice before adding end icons, start icons should be your go-to.

```tsx
import { Inline, Text, ToggleButton } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Inline>
            <ToggleButton aria-label="Save" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Save</Text>
            </ToggleButton>
            <ToggleButton size="sm" aria-label="Save" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Save</Text>
            </ToggleButton>
            <ToggleButton size="xs" aria-label="Save" variant="secondary">
                <SparklesIcon slot="end-icon" />
                <Text>Save</Text>
            </ToggleButton>
        </Inline>
    );
}
```

### Props

| Prop            | Type                                           | Default   | Description                                                                                                                                                                        |
| --------------- | ---------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| children        | `ReactNode`                                    |           | The content to display in the button.                                                                                                                                              |
| isFluid         | `ResponsiveProp<boolean>`                      |           | Whether or not the toggle button takes up the width of its container.                                                                                                              |
| isLoading       | `boolean`                                      |           | A toggle button can show a loading indicator.                                                                                                                                      |
| size            | `ResponsiveProp<ButtonSize>`                   | "md"      | A toggle button can vary in size.                                                                                                                                                  |
| spinnerProps    | `SpinnerProps`                                 |           | The props for the Spinner.                                                                                                                                                         |
| variant         | `ButtonVariant`                                | "primary" | The visual style of the toggle button.                                                                                                                                             |
| id              | `Key`                                          |           | The id of the toggle button.                                                                                                                                                       |
| style           | `StyleOrFunction<ToggleButtonRenderProps>`     |           | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state.  |
| isSelected      | `boolean`                                      |           | Whether the element should be selected (controlled).                                                                                                                               |
| defaultSelected | `boolean`                                      |           | Whether the element should be selected (uncontrolled).                                                                                                                             |
| isDisabled      | `boolean`                                      |           | Whether the button is disabled.                                                                                                                                                    |
| autoFocus       | `boolean`                                      |           | Whether the element should receive focus on render.                                                                                                                                |
| dir             | `string`                                       |           |                                                                                                                                                                                    |
| lang            | `string`                                       |           |                                                                                                                                                                                    |
| inert           | `boolean`                                      |           |                                                                                                                                                                                    |
| translate       | `"yes" \| "no"`                                |           |                                                                                                                                                                                    |
| className       | `ClassNameOrFunction<ToggleButtonRenderProps>` |           | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. |

##### Events

| Prop                        | Type                                                      | Default | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onChange                    | `((isSelected: boolean) => void)`                         |         | Handler that is called when the element's selection state changes.                                                                                                                                        |
| onPress                     | `((e: PressEvent) => void)`                               |         | Handler that is called when the press is released over the target.                                                                                                                                        |
| onPressStart                | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction starts.                                                                                                                                                   |
| onPressEnd                  | `((e: PressEvent) => void)`                               |         | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.                                                                                       |
| onPressChange               | `((isPressed: boolean) => void)`                          |         | Handler that is called when the press state changes.                                                                                                                                                      |
| onPressUp                   | `((e: PressEvent) => void)`                               |         | Handler that is called when a press is released over the target, regardless of whether it started on the target or not.                                                                                   |
| onClick                     | `((e: MouseEvent<FocusableElement, MouseEvent>) => void)` |         | **Not recommended – use `onPress` instead.** `onClick` is an alias for `onPress` provided for compatibility with other libraries. `onPress` provides additional event details for non-mouse interactions. |
| onFocus                     | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element receives focus.                                                                                                                                                   |
| onBlur                      | `((e: FocusEvent<Element, Element>) => void)`             |         | Handler that is called when the element loses focus.                                                                                                                                                      |
| onFocusChange               | `((isFocused: boolean) => void)`                          |         | Handler that is called when the element's focus status changes.                                                                                                                                           |
| onKeyDown                   | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is pressed.                                                                                                                                                             |
| onKeyUp                     | `((e: KeyboardEvent) => void)`                            |         | Handler that is called when a key is released.                                                                                                                                                            |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`                     |         |                                                                                                                                                                                                           |
| onScroll                    | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`                          |         |                                                                                                                                                                                                           |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`                       |         |                                                                                                                                                                                                           |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`                   |         |                                                                                                                                                                                                           |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>`                  |         |                                                                                                                                                                                                           |
| onHoverStart                | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction starts.                                                                                                                                                   |
| onHoverEnd                  | `((e: HoverEvent) => void)`                               |         | Handler that is called when a hover interaction ends.                                                                                                                                                     |
| onHoverChange               | `((isHovering: boolean) => void)`                         |         | Handler that is called when the hover state changes.                                                                                                                                                      |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop                | Type                                                                                  | Default | Description                                                                                                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| aria-disabled       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element is disabled to users of assistive technology.                                                                                                                                                                                                                   |
| aria-expanded       | `boolean \| "true" \| "false"`                                                        |         | Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.                                                                                                                                                                                   |
| aria-haspopup       | `boolean \| "dialog" \| "menu" \| "grid" \| "true" \| "false" \| "listbox" \| "tree"` |         | Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.                                                                                                                                                                |
| aria-controls       | `string`                                                                              |         | Identifies the element (or elements) whose contents or presence are controlled by the current element.                                                                                                                                                                                        |
| aria-pressed        | `boolean \| "true" \| "false" \| "mixed"`                                             |         | Indicates the current "pressed" state of toggle buttons.                                                                                                                                                                                                                                      |
| preventFocusOnPress | `boolean`                                                                             |         | Whether to prevent focus from moving to the button when pressing it.Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.                  |
| excludeFromTabOrder | `boolean`                                                                             |         | Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available. |
| aria-label          | `string`                                                                              |         | Defines a string value that labels the current element.                                                                                                                                                                                                                                       |
| aria-labelledby     | `string`                                                                              |         | Identifies the element (or elements) that labels the current element.                                                                                                                                                                                                                         |
| aria-describedby    | `string`                                                                              |         | Identifies the element (or elements) that describes the object.                                                                                                                                                                                                                               |
| aria-details        | `string`                                                                              |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                                                                                                                                                                                            |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `fluid` has been renamed `isFluid`.
* `disabled` has been renamed `isDisabled`.
* `checked` has been renamed `isSelected`.
* `defaultChecked` has been renamed `defaultSelected`.
* `inherit` has been removed.
* `loading` has been renamed `isLoading`.
* `onChange` signature has been changed (no event is passed).
* `value` has been removed, use the `id` instead.

## Tooltip

Tooltips display additional information upon hover or focus that is contextual, helpful, and nonessential while providing the ability to communicate and give clarity to a user.

* Source: <https://github.com/workleap/wl-hopper/blob/main/packages/components/src/tooltip/src/Tooltip.tsx>

A tooltip is a message box displayed when a user hovers over or focuses on an element of the interface. A tooltip is used to provide more information and should be paired with and interaction element. Tooltips should be used sparingly and contain succinct supplementary information. Do not include interactive elements in tooltips; use the Popover component instead.

```tsx
import { Button, Tooltip, TooltipTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <TooltipTrigger>
            <Button>Trigger</Button>
            <Tooltip>Frogs can breathe through their skin</Tooltip>
        </TooltipTrigger>
    );
}
```

### Usage

#### Trigger

A tooltip trigger can be anything.

```tsx
import { Button, Div, Stack, Tooltip, TooltipTrigger } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";

export default function Example() {
    return (
        <Stack>
            <TooltipTrigger>
                <Button variant="secondary">
                    <SparklesIcon />
                </Button>
                <Tooltip>Frogs can breathe through their skin</Tooltip>
            </TooltipTrigger>
            <TooltipTrigger>
                <SparklesIcon />
                <Tooltip>Frogs can breathe through their skin</Tooltip>
            </TooltipTrigger>
            <TooltipTrigger>
                <Div>Just a normal div</Div>
                <Tooltip>Frogs can breathe through their skin</Tooltip>
            </TooltipTrigger>
        </Stack>
    );
}
```

#### Placement

A tooltip can open at different placements.

```tsx
import { Button, Tooltip, TooltipTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <TooltipTrigger placement="right">
            <Button>Trigger</Button>
            <Tooltip>Frogs can breathe through their skin</Tooltip>
        </TooltipTrigger>
    );
}
```

#### Disabled

A tooltip can be disabled.

```tsx
import { Button, Tooltip, TooltipTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <TooltipTrigger isDisabled>
            <Button>Trigger</Button>
            <Tooltip>Frogs can breathe through their skin</Tooltip>
        </TooltipTrigger>
    );
}
```

#### Custom Trigger

A tooltip trigger can update its appearance based on the isOpen value by using TooltipTriggerContext.

```tsx
import { Button, Tooltip, TooltipTrigger, TooltipTriggerContext } from "@hopper-ui/components";
import { SparklesIcon } from "@hopper-ui/icons";
import { forwardRef, useContext } from "react";

const CustomTrigger = forwardRef<HTMLButtonElement>((props, ref) => {
    const { isOpen } = useContext(TooltipTriggerContext);

    return (
        <Button
            {...props}
            aria-label="Frog"
            ref={ref}
            variant={isOpen ? "primary" : "secondary"}
        >
            <SparklesIcon />
        </Button>
    );
});

export default function Example() {
    return (
        <TooltipTrigger>
            <CustomTrigger />
            <Tooltip>Frogs can breathe through their skin</Tooltip>
        </TooltipTrigger>
    );
}
```

#### Disabled Trigger

While it is not recommended to add a tooltip to a disabled element, it is possible to do so.

```tsx
import { Button, Tooltip, TooltipTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <TooltipTrigger>
            <Button isDisabled>Trigger</Button>
            <Tooltip>Frogs can breathe through their skin</Tooltip>
        </TooltipTrigger>
    );
}
```

#### Controlled

The open state can be handled in controlled mode.

```tsx
import { Button, Tooltip, TooltipTrigger } from "@hopper-ui/components";
import { useCallback, useState } from "react";

export default function Example() {
    const [isOpen, setIsOpen] = useState(false);
    const handleOpenChange = useCallback(
        (newValue: boolean) => {
            setIsOpen(newValue);
        },
        [setIsOpen]
    );

    return (
        <TooltipTrigger isOpen={isOpen} onOpenChange={handleOpenChange}>
            <Button>Trigger</Button>
            <Tooltip>Frogs can breathe through their skin</Tooltip>
        </TooltipTrigger>
    );
}
```

#### Collection Items

Tooltips can be used in Collection items.

```tsx
import { Stack, Tab, TabList, Tabs, Tag, TagGroup, Tooltip, TooltipTrigger } from "@hopper-ui/components";

export default function Example() {
    return (
        <Stack>
            <Tabs aria-label="frogs">
                <TabList>
                    <Tab id="red-eye-tree">Red-Eyed Tree Frog</Tab>
                    <TooltipTrigger>
                        <Tab id="poison-dart">Poison Da..</Tab>
                        <Tooltip>Poison Dart Frog</Tooltip>
                    </TooltipTrigger>
                    <Tab id="goliath">Goliath Frog</Tab>
                </TabList>
            </Tabs>
            <TagGroup aria-label="tags" size="sm" label="Small">
                <Tag id="1">Red-Eyed Tree Frog</Tag>
                <TooltipTrigger>
                    <Tag id="2">Poison Da...</Tag>
                    <Tooltip>Poison Dart Frog</Tooltip>
                </TooltipTrigger>
                <Tag id="3">Goliath Frog</Tag>
            </TagGroup>
        </Stack>
    );
}
```

### Best Practices

Tooltips should:

* Provide useful, additional information or clarification.
* Succinctly describe or expand on the element they point to.
* Not be used to communicate critical information, including errors in forms or other feedback.
* Not contain any links or buttons.
* Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience.

### Props

#### Tooltip

| Prop       | Type                         | Default | Description                                                                                                                                                                       |
| ---------- | ---------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| triggerRef | `RefObject<Element \| null>` |         | The ref for the element which the tooltip positions itself with respect to.When used within a TooltipTrigger this is set automatically. It is only required when used standalone. |
| dir        | `string`                     |         |                                                                                                                                                                                   |
| lang       | `string`                     |         |                                                                                                                                                                                   |
| inert      | `boolean`                    |         |                                                                                                                                                                                   |
| translate  | `"yes" \| "no"`              |         |                                                                                                                                                                                   |
| children   | `ReactNode`                  |         | The children of the component.                                                                                                                                                    |
| className  | `string`                     |         | The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.                                                                          |
| style      | `CSSProperties`              |         | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.                                                                           |

##### Events

| Prop                        | Type                                     | Default | Description |
| --------------------------- | ---------------------------------------- | ------- | ----------- |
| onClick                     | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onClickCapture              | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClick                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onAuxClickCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenu               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onContextMenuCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClick               | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onDoubleClickCapture        | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDown                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseDownCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseEnter                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseLeave                | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMove                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseMoveCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOut                  | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOutCapture           | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOver                 | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseOverCapture          | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUp                   | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onMouseUpCapture            | `MouseEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancel               | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchCancelCapture        | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEnd                  | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchEndCapture           | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMove                 | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchMoveCapture          | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStart                | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onTouchStartCapture         | `TouchEventHandler<HTMLDivElement>`      |         |             |
| onPointerDown               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerDownCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMove               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerMoveCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUp                 | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerUpCapture          | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancel             | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerCancelCapture      | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerEnter              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerLeave              | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOver               | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOverCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOut                | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onPointerOutCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCapture         | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onGotPointerCaptureCapture  | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCapture        | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onLostPointerCaptureCapture | `PointerEventHandler<HTMLDivElement>`    |         |             |
| onScroll                    | `UIEventHandler<HTMLDivElement>`         |         |             |
| onScrollCapture             | `UIEventHandler<HTMLDivElement>`         |         |             |
| onWheel                     | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onWheelCapture              | `WheelEventHandler<HTMLDivElement>`      |         |             |
| onAnimationStart            | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationStartCapture     | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEnd              | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationEndCapture       | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIteration        | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onAnimationIterationCapture | `AnimationEventHandler<HTMLDivElement>`  |         |             |
| onTransitionCancel          | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionCancelCapture   | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEnd             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionEndCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRun             | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionRunCapture      | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStart           | `TransitionEventHandler<HTMLDivElement>` |         |             |
| onTransitionStartCapture    | `TransitionEventHandler<HTMLDivElement>` |         |             |

##### Layout

| Prop | Type             | Default | Description                                                                                                                                                                                                      |
| ---- | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| slot | `string \| null` |         | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |

##### Positioning

| Prop   | Type      | Default | Description |
| ------ | --------- | ------- | ----------- |
| hidden | `boolean` |         |             |

##### Accessibility

| Prop             | Type     | Default | Description                                                                                                         |
| ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| aria-label       | `string` |         | Defines a string value that labels the current element.                                                             |
| aria-labelledby  | `string` |         | Identifies the element (or elements) that labels the current element.                                               |
| aria-describedby | `string` |         | Identifies the element (or elements) that describes the object.                                                     |
| aria-details     | `string` |         | Identifies the element (or elements) that provide a detailed, extended description for the object.                  |
| id               | `string` |         | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |

#### TooltipTrigger

| Prop             | Type                                                         | Default | Description                                                                                                                                        |
| ---------------- | ------------------------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| placement        | `"start" \| "end" \| "right" \| "left" \| "top" \| "bottom"` | 'top'   | The placement of the element with respect to its anchor element.                                                                                   |
| delay            | `number`                                                     | 600     | The delay time for the tooltip to show up.                                                                                                         |
| isDisabled       | `boolean`                                                    |         | Whether the tooltip should be disabled, independent from the trigger.                                                                              |
| trigger          | `"hover" \| "focus"`                                         | 'hover' | By default, opens for both focus and hover. Can be made to open only for focus.                                                                    |
| isOpen           | `boolean`                                                    |         | Whether the overlay is open by default (controlled).                                                                                               |
| defaultOpen      | `boolean`                                                    |         | Whether the overlay is open by default (uncontrolled).                                                                                             |
| shouldFlip       | `boolean`                                                    | true    | Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely. |
| containerPadding | `number`                                                     | 12      | The placement padding that should be applied between the element and its surrounding container.                                                    |
| offset           | `number`                                                     | 0       | The additional offset applied along the main axis between the element and its anchor element.                                                      |
| crossOffset      | `number`                                                     | 0       | The additional offset applied along the cross axis between the element and its anchor element.                                                     |

##### Events

| Prop         | Type                          | Default | Description                                                   |
| ------------ | ----------------------------- | ------- | ------------------------------------------------------------- |
| onOpenChange | `((isOpen: boolean) => void)` |         | Handler that is called when the overlay's open state changes. |

### Migration Notes

Coming from Orbiter, you should be aware of the following changes:

* `position` has been renamed to `placement`. Refer to this [sample](#usage-placement)

## UL

A specialized component to represent an HTML ul/ol/li element.

```tsx
import { LI, UL } from "@hopper-ui/components";

export default function Example() {
    return (
        <UL color="neutral-weak">
            <LI>Explore</LI>
            <LI>Discover</LI>
            <LI color="core_sapphire-600">Colonize</LI>
        </UL>
    );
}
```

### Usage

A list component accepts all the [ul](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ul), [ol](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/ol), and [li](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/li) HTML element attributes and [Hopper styled component props](/styled-system/concepts/styling.md).

## Orbiter to Hopper Mapping

A list of all Orbiter Hopper Components and their equivalent within Hopper

Below is a list of all Orbiter Components and their equivalent within Hopper. Unavailable components are currently prioritized for development by the Design System Team.

| Orbiter Component  | Hopper Component                                                |
| ------------------ | --------------------------------------------------------------- |
| Accordion          | [Accordion](/components/Accordion.md)                              |
| Alert              | [Alert](/components/Alert.md)                                      |
| Autocomplete       | [ComboBox](/components/ComboBox.md)                                |
| Avatar             | [Avatar](/components/Avatar.md)                                    |
| Badge              | [Badge](/components/Badge.md)                                      |
| Box                | [Box](/components/Box.md)                                          |
| Button             | [Button](/components/Button.md)                                    |
| Card               | [Card](/components/Card.md), shims were created to ease migration. |
| Checkbox           | [Checkbox](/components/Checkbox.md)                                |
| Counter            | Use the Badge with subdued variant                              |
| CrossButton        | CloseButton                                                     |
| DateInput          | In development                                                  |
| DateRangeInput     | In development                                                  |
| Disclosure         | [Disclosure](/components/Disclosure.md)                            |
| DisclosureArrow    | ToggleArrow                                                     |
| Divider            | [Divider](/components/Divider.md)                                  |
| Dot                | Use [Badge](/components/Badge.md) with the isIndeterminate prop    |
| Field              | Not supported anymore                                           |
| Flex               | [Flex](/components/Flex.md)                                        |
| Form               | [Form](/components/Form.md)                                        |
| Grid               | [Grid](/components/Grid.md)                                        |
| Heading            | [Heading](/components/Heading.md)                                  |
| IllustratedMessage | [IllustratedMessage](/components/IllustratedMessage.md)            |
| Illustration       | [Illustration](/components/Illustration.md)                        |
| Image              | [Image](/components/Image.md)                                      |
| InputGroup         | InputGroup                                                      |
| Link               | [Link](/components/Link.md)                                        |
| Listbox            | [ListBox](/components/Listbox.md)                                  |
| Loader             | Not supported anymore, consider using Spinner                   |
| Lozenge            | [Tag](/components/Tag.md)                                          |
| Menu               | [Menu](/components/Menu.md)                                        |
| Modal              | [Modal](/components/Modal.md)                                      |
| NumberInput        | [NumberField](/components/NumberField.md)                          |
| Overlay            | Not supported anymore, use Modal instead                        |
| Paragraph          | [Paragraph](/components/Paragraph.md)                              |
| Popover            | [Popover](/components/Popover.md)                                  |
| RadioGroup         | [RadioGroup](/components/RadioGroup.md)                            |
| Select             | [Select](/components/Select.md)                                    |
| Spinner            | [Spinner](/components/Spinner.md)                                  |
| Switch             | [Switch](/components/Switch.md)                                    |
| Tabs               | [Tabs](/components/Tabs.md)                                        |
| Tag                | [Tag](/components/Tag.md)                                          |
| Text               | [Text](/components/Text.md)                                        |
| TextArea           | [TextArea](/components/Text.md)                                    |
| TextInput          | [TextField](/components/TextField.md)                              |
| ThemeProvider      | [HopperProvider](/components/HopperProvider.md)                    |
| Tile               | [Tile](/components/Tile.md)                                        |
| Toolbar            | Not supported anymore                                           |
| Tooltip            | [Tooltip](/components/Tooltip.md)                                  |
| Transition         | Not supported anymore, shims were created to ease migration.    |

