New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cloudflare/component-tabs

Package Overview
Dependencies
Maintainers
0
Versions
723
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudflare/component-tabs

Cloudflare Tabs Component

6.0.57
latest
npm
Version published
Weekly downloads
6.5K
37.7%
Maintainers
0
Weekly downloads
 
Created
Source

@cloudflare/component-tabs

Cloudflare Tabs Component

Installation

Installation with yarn is recommended


$ yarn add @cloudflare/component-tabs

Usage

import React from 'react';
import { Tabs, TabsItem, TabsPanel } from '../../src';
import { createComponent } from '@cloudflare/style-container';

const Tab = createComponent(
  () => ({
    backgroundColor: '#FFFFF0'
  }),
  TabsItem
);

class TabsComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      active: 'one'
    };
  }

  handleTabChange(id) {
    this.setState({ active: id });
  }

  render() {
    return (
      <Tabs
        active={this.state.active}
        tabs={[
          { id: 'one', label: 'Tab One' },
          {
            id: 'two',
            label: 'Tab Two: Custom Header',
            component: Tab
          },
          { id: 'three', label: 'Tab Three' }
        ]}
        onChange={this.handleTabChange.bind(this)}
      >
        <TabsPanel id="one">
          <h1>Tab One</h1>
        </TabsPanel>

        <TabsPanel id="two">
          <h1>Tab Two</h1>
        </TabsPanel>

        <TabsPanel id="three">
          <h1>Tab Three</h1>
        </TabsPanel>
      </Tabs>
    );
  }
}

export default TabsComponent;

FAQs

Package last updated on 19 Mar 2025

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