Skip to main content

Interface: SandpackOptions

Properties

activeFile

Optional activeFile: string

Use this to set a file as active by default in the editor component. It defaults to the main file from a given template.

Defined in

sandpack-react/src/types.ts:96


autorun

Optional autorun: boolean

Defined in

sandpack-react/src/types.ts:133


bundlerURL

Optional bundlerURL: string

Defined in

sandpack-react/src/types.ts:143


classes

Optional classes: Record<string, string>

Defined in

sandpack-react/src/types.ts:100


closableTabs

Optional closableTabs: boolean

Defined in

sandpack-react/src/types.ts:109


codeEditor

Optional codeEditor: SandpackCodeOptions

Defined in

sandpack-react/src/types.ts:112


editorHeight

Optional editorHeight: Height<string | number>

Defined in

sandpack-react/src/types.ts:99


editorWidthPercentage

Optional editorWidthPercentage: number

Defined in

sandpack-react/src/types.ts:98


externalResources

Optional externalResources: string[]

Defined in

sandpack-react/src/types.ts:147


fileResolver

Optional fileResolver: FileResolver

Defined in

sandpack-react/src/types.ts:146


id

Optional id: string

By default, Sandpack generates a random value to use as an id. Use this to override this value if you need predictable values.

Defined in

sandpack-react/src/types.ts:141


initMode

Optional initMode: SandpackInitMode

This provides a way to control how some components are going to be initialized on the page. The CodeEditor and the Preview components are quite expensive and might overload the memory usage, so this gives a certain control of when to initialize them.

Defined in

sandpack-react/src/types.ts:131


initModeObserverOptions

Optional initModeObserverOptions: IntersectionObserverInit

Defined in

sandpack-react/src/types.ts:132


logLevel

Optional logLevel: SandpackLogLevel

Defined in

sandpack-react/src/types.ts:142


readOnly

Optional readOnly: boolean

This disables editing of content by the user in all files.

Defined in

sandpack-react/src/types.ts:117


recompileDelay

Optional recompileDelay: number

Defined in

sandpack-react/src/types.ts:135


recompileMode

Optional recompileMode: "immediate" | "delayed"

Defined in

sandpack-react/src/types.ts:134


showConsole

Optional showConsole: boolean

Defined in

sandpack-react/src/types.ts:108


showConsoleButton

Optional showConsoleButton: boolean

Defined in

sandpack-react/src/types.ts:107


showInlineErrors

Optional showInlineErrors: boolean

Defined in

sandpack-react/src/types.ts:104


showLineNumbers

Optional showLineNumbers: boolean

Defined in

sandpack-react/src/types.ts:103


showNavigator

Optional showNavigator: boolean

Defined in

sandpack-react/src/types.ts:102


showReadOnly

Optional showReadOnly: boolean

Controls the visibility of Read-only label, which will only appears when readOnly is true

Defined in

sandpack-react/src/types.ts:123


showRefreshButton

Optional showRefreshButton: boolean

Defined in

sandpack-react/src/types.ts:105


showTabs

Optional showTabs: boolean

Defined in

sandpack-react/src/types.ts:106


skipEval

Optional skipEval: boolean

Defined in

sandpack-react/src/types.ts:145


startRoute

Optional startRoute: string

Defined in

sandpack-react/src/types.ts:144


visibleFiles

Optional visibleFiles: string[]

List of files that will be visible for the user interacts with. It defaults to the main file from a given template.

Defined in

sandpack-react/src/types.ts:90


wrapContent

Optional wrapContent: boolean

Defined in

sandpack-react/src/types.ts:110