Code Preview Tabs

A code preview tabs component that allows you to preview and switch between different code blocks.

Hello, world!

Installation

1. Follow the links to install required rlx packages

PackageTypeLink
@rlx-widgets/tabsWidget
@rlx-widgets/selectWidget
@rlx-components/shiki-code-blockComponent

2. Install the following dependencies

Loading...

bash

API Reference

Props list

PropTypeDefaultExampleDescription
preview--The preview to be displayed.
codestring | undefined-console.log("Hello, world!");The code to be highlighted.
variants--Allows multiple preview and code combinations.
langBundledLanguage-"tsx"Supported languagesFull list
classNames-Style the preview and code blocks.

variants prop is mutually exclusive with preview and code props. If variants is provided, preview and code are not required. Conversely, if variants is not present, then preview and code are required.