Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chakra-ui/tabs

Package Overview
Dependencies
Maintainers
4
Versions
460
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/tabs

Accessible Tabs component for React and Chakra UI

  • 1.0.0-next.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
201K
decreased by-57.98%
Maintainers
4
Weekly downloads
 
Created

What is @chakra-ui/tabs?

@chakra-ui/tabs is a component library for creating tabbed interfaces in React applications. It provides a set of accessible and customizable tab components that can be used to organize content into separate views, making it easier for users to navigate through different sections of an application.

What are @chakra-ui/tabs's main functionalities?

Basic Tabs

This code demonstrates how to create a basic tabbed interface with three tabs, each containing different content.

```jsx
import { Tabs, TabList, TabPanels, Tab, TabPanel } from '@chakra-ui/tabs';

function BasicTabs() {
  return (
    <Tabs>
      <TabList>
        <Tab>Tab 1</Tab>
        <Tab>Tab 2</Tab>
        <Tab>Tab 3</Tab>
      </TabList>

      <TabPanels>
        <TabPanel>
          <p>Content for Tab 1</p>
        </TabPanel>
        <TabPanel>
          <p>Content for Tab 2</p>
        </TabPanel>
        <TabPanel>
          <p>Content for Tab 3</p>
        </TabPanel>
      </TabPanels>
    </Tabs>
  );
}
```

Vertical Tabs

This code demonstrates how to create a vertical tabbed interface, where the tabs are aligned vertically instead of horizontally.

```jsx
import { Tabs, TabList, TabPanels, Tab, TabPanel } from '@chakra-ui/tabs';

function VerticalTabs() {
  return (
    <Tabs orientation="vertical">
      <TabList>
        <Tab>Tab 1</Tab>
        <Tab>Tab 2</Tab>
        <Tab>Tab 3</Tab>
      </TabList>

      <TabPanels>
        <TabPanel>
          <p>Content for Tab 1</p>
        </TabPanel>
        <TabPanel>
          <p>Content for Tab 2</p>
        </TabPanel>
        <TabPanel>
          <p>Content for Tab 3</p>
        </TabPanel>
      </TabPanels>
    </Tabs>
  );
}
```

Custom Tab Styling

This code demonstrates how to apply custom styles to the tabs and their content, including changing the background color and text color of the selected tab.

```jsx
import { Tabs, TabList, TabPanels, Tab, TabPanel } from '@chakra-ui/tabs';
import { Box } from '@chakra-ui/react';

function CustomStyledTabs() {
  return (
    <Tabs>
      <TabList>
        <Tab _selected={{ color: 'white', bg: 'blue.500' }}>Tab 1</Tab>
        <Tab _selected={{ color: 'white', bg: 'blue.500' }}>Tab 2</Tab>
        <Tab _selected={{ color: 'white', bg: 'blue.500' }}>Tab 3</Tab>
      </TabList>

      <TabPanels>
        <TabPanel>
          <Box p={4} bg="gray.100">Content for Tab 1</Box>
        </TabPanel>
        <TabPanel>
          <Box p={4} bg="gray.100">Content for Tab 2</Box>
        </TabPanel>
        <TabPanel>
          <Box p={4} bg="gray.100">Content for Tab 3</Box>
        </TabPanel>
      </TabPanels>
    </Tabs>
  );
}
```

Other packages similar to @chakra-ui/tabs

Keywords

FAQs

Package last updated on 15 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc