Chakra UI: How can i add tabs in a select options?

Viewed 182

I'm trying to add tabs in a select option but it is not working. I want select as given in the photo so that i can change tabs and select options of my choice

enter image description here

  <Select
      borderLeftRadius={'5px'}
      borderRightRadius={'none'}
      bgColor={'#0C0C0C'}
      border={'none'}
      color={'white'}
      _focusVisible={{
        boxShadow: 'none',
      }}
    >
  <option value="option1" className="select">

    <Tabs>
      <TabList>
          <Tab bg={'red'}>One</Tab>
          <Tab bg={'blue'} >One</Tab>
      </TabList>

      <TabPanels>
        <TabPanel>
          <p>one!</p>
        </TabPanel>
        <TabPanel>
          <p>one!</p>
        </TabPanel>

      </TabPanels>
    </Tabs>

  </option>
 
</Select>
1 Answers

The select component uses the default select tag from html tags, maybe using the Popover component from Chakra UI components will be better for your case:

https://chakra-ui.com/docs/components/popover

There you can custom the Popover content as you wish. Hope it helped :D

Related