@hashicorp/react-tabs

中文文档
8.2.0发布于 2024/07/06MPL-2.0近 30 天下载 5484

Display content in a tabbed interface

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录4 节
  1. Example Usage
  2. Component Props
  3. Tabs
  4. Tab

Tabs

Tabs will render arbitrary tabbed content based on Tab items passed as children.

Example Usage

<Tabs>
  <Tab heading="First Tab">
    <p>First tab content</p>
  </Tab>
  <Tab heading="Second Tab">
    <p>Second tab content</p>
  </Tab>
  <Tab heading="Third Tab">
    <p>Third tab content</p>
  </Tab>
</Tabs>

Component Props

Tabs

NameTypeDescriptionRequired
childrenReact.ReactNodeTab components to render.true
defaultTabIdxnumberIf set, the tab with the specified ID will be active by default. If not set or if the ID does not match, it will default to 0false
centeredbooleanIf true, the tabs are centered in their container, rather than left-alignedfalse
fullWidthBorderbooleanIf true, the border line underneath the tabs expands to the full width of the container, rather than being slightly padded from the edgesfalse

Tab

NameTypeDescriptionRequired
headingstringTitle of the tabtrue
groupstringA unique identifier for a tab 'group' that, when active, all Tabs with this id will become active when one is selected. Note it's necessary to wrap the page with TabProvider for this feature to function.false
childrenReact.ReactNodeContent that should render when the associated tab is active.false

版本与发布记录

@hashicorp/react-tabs 共发布 77 个版本,首次发布于 2019/11/21;过去 12 个月发布了 0 个版本。

版本发布日期距今
8.2.0latest2024/07/062 年前
8.2.0-canary-20240624195037canary2024/06/252 年前
8.1.02023/12/122 年前
8.0.02023/05/033 年前
8.0.0-canary-202305022105272023/05/033 年前
8.0.0-canary-202305012139262023/05/023 年前

其他发布通道:next → 6.0.2-alpha.65,canary → 8.2.0-canary-20240624195037。

关于 @hashicorp/react-tabs 的常见问题

@hashicorp/react-tabs 是什么?

Display content in a tabbed interface注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @hashicorp/react-tabs?

在项目目录运行 npm install @hashicorp/react-tabs,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16.x)、@hashicorp/mktg-global-styles(>=3.x)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@hashicorp/react-tabs 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/hashicorp__react-tabs 是否存在。

@hashicorp/react-tabs 可以商用吗?

@hashicorp/react-tabs 使用 MPL-2.0 许可。弱 Copyleft:可以商用,也可以和闭源代码一起使用;但如果分发时修改了 MPL 授权的文件,这些文件的修改需以 MPL 开源。以上为概括,不构成法律意见,请以许可原文为准。

@hashicorp/react-tabs 的下载量有多少?

根据 npm 官方下载统计,@hashicorp/react-tabs 在 2026/10/18 – 2026/11/16 这 30 天内被下载 5,484 次,日均约 183 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@hashicorp/react-tabs 还在维护吗?

最新版本 8.2.0 发布于 2024/07/06(2 年前);至今共发布 77 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/11/21。作者已将其标记为弃用,新项目建议寻找替代方案。