You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add MultiSelect, RadioGroup and Checkbox input widget types (#2472)
### Summary
This PR addresses issue #1858 by introducing several new UI input
widgets to Chainlit, including `MultiSelect`, `Checkbox`, and
`RadioGroup`. These new components provide more flexibility for creating
interactive and user-friendly chat settings.
### Changes
- **Frontend:**
- Created a new `MultiSelectInput` component with a modern, tag-based
design.
- Added a new `CheckboxInput` component with a simplified UI and
improved tooltip handling.
- Added a new `RadioButtonGroup` component.
- Integrated the new components into the main form in `FormInput.tsx`.
- Internationalized the `MultiSelectInput` component with a new
translation key.
- Updated every `.json` translation file to include this new key.
- **Backend:**
- Added `Checkbox`, `RadioGroup`, and `MultiSelect` classes to
`input_widget.py`.
- Updated the `__init__.py` file to expose the new `RadioGroup` class.
### How the New Widgets Work
- **MultiSelect:** The `MultiSelect` component allows users to select
multiple options from a dropdown list. Selected items are displayed as
tags, and can be removed by clicking the "x" button. The dropdown also
includes a search input to quickly filter through a long list of
options.
- **Checkbox:** The `Checkbox` component has been simplified to remove
the redundant title. The `label` is now displayed next to the checkbox,
and the `tooltip` is displayed when the user hovers over the label.
### Testing
Honestly, I tried updating the `chat_setting` test but I wasn't able to
set it properly. I'm a bit of a nooby with Cypress.
### Preview
<img width="523" height="726" alt="image"
src="https://github.com/user-attachments/assets/ffabc0ca-758f-41a7-b71b-e23c70048906"
/>
---
<img width="481" height="133" alt="image"
src="https://github.com/user-attachments/assets/0a11534e-9860-4356-87fc-90262f8c5b3d"
/>
---
<img width="454" height="102" alt="image"
src="https://github.com/user-attachments/assets/24a05854-b338-4ae0-8264-47f70402e3c7"
/>
0 commit comments