SandpackPreset interface
Defines a single preset that can be used to create a sandbox.
Signature:
export interface SandpackPreset
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
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. | |
label | string | JSX.Element | The label of the preset, displayed in the sandpack button dropdown. | |
meta | string | The meta string that will be used to identify the preset from the fenced code block. e.g. "live react" | |
name | string | The name of the preset - use this to reference the preset from the defaultPreset field. | |
sandpackTemplate | SandpackProviderProps['template'] | The sandpack template that will be used to create the sandbox. e.g. "react", "react-ts", "vanilla". | |
sandpackTheme | SandpackProviderProps['theme'] | The sandpack theme that will be used to create the sandbox. e.g. "light", "dark". | |
snippetFileName | string | The 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. |