New component request: list of tags from user input #4174
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary. Hi team, For implementing a compact component where completed items get turned into pills inside the input field, as described in your examples, you can utilize the Multi-select Combobox component available in Paste. This component allows selections to show up as pills within the input field, which seems to align closely with your requirements. The pills span to the width of the field and will wrap to the next line if more space is needed. Here's a snippet from the documentation that might help: <Combobox
items={items}
labelText="Choose some items"
helpText="This is the help text"
optionTemplate={(item) => <div>{item}</div>}
selectedItemTemplate={(selectedItem) => (
<div>
{selectedItem}
<span aria-hidden="true">✓</span>
</div>
)}
/> For more complex scenarios where you might want to create a custom input that turns text into pills (like after pressing a comma or enter), although there isn't a direct component in Paste for this specific pattern, you can compose one using available components. Based on the guidance provided for a similar use case, you can use a combination of For more details on the Multi-select Combobox and other components, you can visit the Paste documentation: Multi-select Combobox Unfortunately, there isn't a direct code snippet provided for exactly replicating the described behavior (text turning into pills on comma or enter press within the input field), but the Multi-select Combobox component and the guidance on composing custom inputs with Let me know if you have any questions! Thanks! I also did a search, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:
|
Beta Was this translation helpful? Give feedback.
Hi @rexatsegment after discussing with the team, we encourage you to submit a dependency request for this component variant, we think it might be a good addition to the system.
Also, we're currently working on documenting and polishing a 'create' functionality for combobox, this functionality allows users to create custom labels as options in a Combobox. One of our engineers created this example that roughly shows how the functionality could work for your use case. This still in refinement you can follow its progress in this ticket.
Let me know if there is anything else I can help you with!