SandpackPreset interface

Defines a single preset that can be used to create a sandbox.


export interface SandpackPreset 


dependencies?Record<string, string>(Optional) The dependencies that will be added to the sandbox, just like in package.json.
files?Record<string, string>(Optional) The files that will be added to the sandbox (read-only). The key is the name of the file, and the value is the contents of the file.
initialSnippetContent?string(Optional) The initial content of the editable snippet.
labelstring | JSX.ElementThe label of the preset, displayed in the sandpack button dropdown.
metastringThe meta string that will be used to identify the preset from the fenced code block. e.g. "live react"
namestringThe name of the preset - use this to reference the preset from the defaultPreset field.
sandpackTemplateSandpackProviderProps['template']The sandpack template that will be used to create the sandbox. e.g. "react", "react-ts", "vanilla".
sandpackThemeSandpackProviderProps['theme']The sandpack theme that will be used to create the sandbox. e.g. "light", "dark".
snippetFileNamestringThe name of the file that will be created in the sandbox. e.g. "/App.js".
snippetLanguage?string(Optional) The language used in the editable snippet. e.g. "jsx", "tsx", etc.