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

@contentful/f36-tabs

Package Overview
Dependencies
Maintainers
4
Versions
343
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-tabs

Forma 36: Tabs component

  • 4.72.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
decreased by-15.03%
Maintainers
4
Weekly downloads
 
Created
Source

title: 'Tabs' slug: /components/tabs/ github: 'https://github.com/contentful/forma-36/tree/main/packages/components/tabs' storybook: 'https://f36-storybook.contentful.com/?path=/story/components-tabs' typescript: ./src/Tabs.tsx,./src/Tab.tsx,./src/TabPanel.tsx,./src/TabList.tsx

Tabs is a component that makes navigating between sections of related content possible, displaying one section at a time.

Use Tabs if the content can be separated into sections that make sense as standalone pieces of information. Be aware that the users will not see all the content at the same time. Make sure the first section is the most relevant one.

Import

import { Tabs } from '@contentful/f36-components';
// or
import { Tabs } from '@contentful/f36-tabs';

Examples

Basic

With divider

By default, Tabs has no divider, but you can add it by providing variant prop to the Tabs.List

With vertical divider:

With horizontal divider:

With default open tab

With disabled tab

Controlled Tabs

By default, Tabs is an uncontrolled component, but you can make it controlled by providing currentTab and onTabChange props.

Controlled Tabs with always mounted Tabs.Panel

By default, Tabs.Panel is unmounted, if it's not an active tab. But you can make it always mounted by passing the forceMount prop. Keep in mind that you have to provide additional styles to hide not active Tabs.Panel.

Props (API reference)

Tabs

Tab

TabPanel

TabList

Content guidelines

  • every Tab should have concise copy
  • all content within a Tab should be related to it's label
  • to ensure an optimal cognitive load for users, do not use more than six (6) Tabs at any given time

FAQs

Package last updated on 09 Oct 2024

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