✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

CodeBlock


The code component can be used to display code easily within a website. Put in a multiline string with the correct spacing and specify and language to show the desired code.
def fib(n):
    if n <= 1:
        return n
    else:
        return(fib(n-1) + fib(n-2)),
            
rx.code_block(
    """def fib(n):
    if n <= 1:
        return n
    else:
        return(fib(n-1) + fib(n-2))""",
    language="python",
    show_line_numbers=True,
)

CodeBlock


A code block.


  • Base Event Triggers

Code


Used to display inline code.


  • No props for Code.

  • Base Event Triggers

← BadgeDivider →

Copyright © 2023 Pynecone, Inc.