-
Hi, Wanted to ask about the "jump to" search bar we have in the upper right top nav of console. Is this a component that we can reuse? The Console team wants to utilize the search ability to do non-exact search term matching, for instance: if several account SIDs had "123" in it, all of them would appear if you type "123" |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hey there, @pamelahu! 🚀 I'm Dosu, your friendly neighborhood bot here to help you tackle bugs, answer questions, and guide you on your journey to becoming a contributor while you wait for a human maintainer to chime in. I'm all about lending a helping hand, or circuit, in this case! 😄 I'm taking a quick look at your "jump to" search component question and will get back to you with a full answer shortly. Stay tuned! |
Beta Was this translation helpful? Give feedback.
-
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. For implementing a search functionality that allows for non-exact search term matching, like the "jump to" search bar in the upper right top nav of the console, you would want to use the Combobox component from Paste. The Combobox component supports typeahead/autocomplete functionality, which is suitable for scenarios where you want to display search results as users type, even if the search terms are not an exact match. Here's a basic example of how you might use the Combobox component to achieve this: import React from 'react';
import {Combobox} from '@twilio-paste/combobox';
const items = ['Account SID 12345', 'Account SID 12346', 'Account SID 67890'];
const Example = () => {
return (
<Combobox
items={items}
labelText="Search"
helpText="Type to search for an Account SID"
optionTemplate={(item) => <div>{item}</div>}
onInputValueChange={({inputValue}) => {
// You can implement your filtering logic here based on `inputValue`
}}
/>
);
}; This example demonstrates a basic setup. You would need to adapt the For more detailed information on how to use the Combobox component, including all its props and functionalities, please refer to the official Paste documentation for the Combobox component. Remember, the Combobox component is versatile and can be adapted to various search and selection needs, making it a good choice for implementing a feature similar to the "jump to" search bar in the console. 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.
-
Hey @pamelahu Dosu's response is correct, you can use the Combobox for searching functionalities as the ones you describe on your comment. |
Beta Was this translation helpful? Give feedback.
-
Are you looking for a component that includes the specific search/term-matching functionality @pamelahu ? Or just the Combobox component? |
Beta Was this translation helpful? Give feedback.
We unfortunately don't provide that functionality with Paste, but your engineer could reach out to the eng who created the Console search box or look at that code. The Paste Combobox is built on top of our Combobox Primitive, which comes from the Downshift library.