Sandbox

A live code execution environment and interactive evaluation container.

The Sandbox component provides a playground for executing generated TypeScript and JavaScript code safely in the browser.

console.log('Hello from Celestia Sandbox!')

Usage

tsx
import {  Sandbox,  SandboxHeader,  SandboxContent,} from "@celestia-project/ui"
export function MySandbox() {  return (    <Sandbox className="w-full max-w-md">      <SandboxHeader title="Live TS Execution" />      <SandboxContent code="console.log('Hello from Celestia Sandbox!')" />    </Sandbox>  )}

Props Reference

ComponentPropTypeDescription
SandboxHeadertitlestringHeader title of the sandbox container.
SandboxContentcodestringInitial executable code string.