Skip to content
Components / Documentation

Code tabs

Several versions of one sample in one frame: languages, frameworks or files.

@fabrials/ui
Loading state
import "./globals.css";import { ThemeProvider } from "@fabrials/ui"; export default function RootLayout({ children }) {  return (    <html lang="en" suppressHydrationWarning>      <body>        <ThemeProvider>{children}</ThemeProvider>      </body>    </html>  );}

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { CodeTabs } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
itemsCodeTab[]value, label and every CodePanel option except title.
defaultValue / value / onValueChangestringUncontrolled or controlled.
labelstringAccessible name of the tab list.

Behavior

Tabs follow the Tabs keyboard model. Copy takes the open tab.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.