BetaPublic beta — Read the release notes
Documentation

Code Block

Syntax-highlighted code display with copy button and line numbers.

Package
@solidiom/code-block
Version
0.6.0
Status
experimental

Generated from the package's public source.

API

Codecomponent

                        Code(props: CodeProps): Element
                      

Props

class?
string
language?
string — Programming language identifier.
style?
string | CSSProperties

children: Element

View source

CodePropsinterface

Props

class?
string
language?
string — Programming language identifier.
style?
string | CSSProperties

children: Element

View source

CopyButtoncomponent

                        CopyButton(props: CopyButtonProps): Element
                      

Props

class?
string
code
string — The code text to copy.
style?
string | CSSProperties

children: Element

View source

CopyButtonPropsinterface

Props

class?
string
code
string — The code text to copy.
style?
string | CSSProperties

children: Element

View source

Headercomponent

                        Header(props: HeaderProps): Element
                      

Props

class?
string
style?
string | CSSProperties

children: Element

View source

HeaderPropsinterface

Props

class?
string
style?
string | CSSProperties

children: Element

View source

Languagecomponent

                        Language(props: LanguageProps): Element
                      

Props

class?
string
language?
string — The language label to display.
style?
string | CSSProperties

children: Element

View source

LanguagePropsinterface

Props

class?
string
language?
string — The language label to display.
style?
string | CSSProperties

children: Element

View source

LineNumberscomponent

                        LineNumbers(props: LineNumbersProps): Element
                      

Props

class?
string
code
string — The source code to derive line numbers from.
highlightLines?
number[] — Line numbers to highlight.
style?
string | CSSProperties

children: Element

View source

LineNumbersPropsinterface

Props

class?
string
code
string — The source code to derive line numbers from.
highlightLines?
number[] — Line numbers to highlight.
style?
string | CSSProperties

children: Element

View source

Precomponent

                        Pre(props: PreProps): Element
                      

Props

class?
string
style?
string | CSSProperties

children: Element

View source

PrePropsinterface

Props

class?
string
style?
string | CSSProperties

children: Element

View source

Rootcomponent

                        Root(props: RootProps): Element
                      

Props

class?
string
code
string — The source code to display.
highlightLines?
number[] — Line numbers to highlight.
language?
string — Programming language identifier.
showLineNumbers?
boolean — Whether to show line numbers.
style?
string | CSSProperties

children: Element

View source

RootPropsinterface

Props

class?
string
code
string — The source code to display.
highlightLines?
number[] — Line numbers to highlight.
language?
string — Programming language identifier.
showLineNumbers?
boolean — Whether to show line numbers.
style?
string | CSSProperties

children: Element

View source