sigilUI

Code Tabs

Switch between related code examples in a tabbed panel.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { CodeTabs, CodePreview, CopyButton, TokenPreview, ThemeSwatch, ThemeSwitcher, PromptInput, ChatMessage, ChatThread, MessageComposer, ActivityTimeline, AuditLog, Changelog, VersionBadge, KeyboardKey } from "@sigil-ui/components";

Usage

<CodeTabs
    tabs={[
      { value: "npm",  label: "npm",  language: "bash", code: "npm install @sigil-ui/components" },
      { value: "pnpm", label: "pnpm", language: "bash", code: "pnpm add @sigil-ui/components" },
      { value: "yarn", label: "yarn", language: "bash", code: "yarn add @sigil-ui/components" },
    ]}
  />

Sub-components

This component includes the following parts:

  • <CodePreview>
  • <CopyButton>
  • <TokenPreview>
  • <ThemeSwatch>
  • <ThemeSwitcher>
  • <PromptInput>
  • <ChatMessage>
  • <ChatThread>
  • <MessageComposer>
  • <ActivityTimeline>
  • <AuditLog>
  • <Changelog>
  • <VersionBadge>
  • <KeyboardKey>

Props

PropTypeDefaultDescription
tabs (required)CodeTab[]—Tabs configuration.
defaultValuestring—Initial value when the component manages its own state.

Token integration

CSS VariablePurpose
--s-text-mutedText muted
--s-card-radiusCard radius
--s-borderBorder
--s-backgroundBackground
--s-radius-mdRadius md
--s-radius-smRadius sm
--s-textText
--s-primaryPrimary
--s-surfaceSurface
--s-primary-contrastPrimary contrast
--s-shadow-smShadow sm