UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

34 lines (33 loc) 1.31 kB
import { BoxProps } from '@mui/material/Box'; import { CodeLanguageType } from './components/types'; import { ICodeViewer } from './components/CodeViewer/CodeViewer'; /** The props type of [[`ICodeSnippet`]]. */ export interface ICodeSnippet extends BoxProps, Omit<ICodeViewer, 'copyButtonHidden'> { /** * The preview code to show in the code snippet, optional value, if has value, will show it first. */ previewCode?: string; /** * Supported languages, optional value. * ``` * type CodeLanguageType = "html" | "text" | "txt" | "xml" | "js" | "json" | "jsx" | "tsx" * ``` * @default tsx */ language?: CodeLanguageType; /** * Whether to show the copy button inside the highlighted code, optional value. * @default false */ showCopyInCode?: boolean; /** * If available, will show the code sandbox button, and the function is it's callback, optionally value, */ onOpenInSandbox?: () => void; } /** * CodeSnippet component, used to show the code preview * @param {ICodeSnippet} props - provides the properties fo React component * @return {CodeSnippetComponent} - provides the react component to be ingested **/ export declare const CodeSnippet: (props: ICodeSnippet) => import("react/jsx-runtime").JSX.Element;