Files
headlessui/packages
Robin Malfait 9a4c030003 Add invalid prop to Combobox component (#3677)
This PR adds the `invalid` prop to the `Combobox` component. This will
also expose the `invalid` value as a render prop to the `Combobox.Input`
and `Combobox.Button` components.

It will also expose the `data-invalid` attribute on these components
when the `invalid` prop is set to `true`.

```tsx
<Combobox invalid>
 <Combobox.Input />
 <Combobox.Button />
</Combobox>
```

Without `invalid` prop:
<img width="916" alt="image"
src="https://github.com/user-attachments/assets/2c199691-7b29-450f-89a5-4b84e6704c6a"
/>


With invalid prop:
<img width="913" alt="image"
src="https://github.com/user-attachments/assets/4bdde518-39b3-4998-b353-604a818a3c99"
/>

Notice the `data-invalid` prop on the `<input>` and the `<button>`.
2025-04-04 09:46:50 +00:00
..