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:94


autorun

Optional autorun: boolean

Defined in

sandpack-react/src/types.ts:129


bundlerURL

Optional bundlerURL: string

Defined in

sandpack-react/src/types.ts:139


classes

Optional classes: Record<string, string>

Defined in

sandpack-react/src/types.ts:98


closableTabs

Optional closableTabs: boolean

Defined in

sandpack-react/src/types.ts:105


codeEditor

Optional codeEditor: SandpackCodeOptions

Defined in

sandpack-react/src/types.ts:108


editorHeight

Optional editorHeight: Height<string | number>

Defined in

sandpack-react/src/types.ts:97


editorWidthPercentage

Optional editorWidthPercentage: number

Defined in

sandpack-react/src/types.ts:96


externalResources

Optional externalResources: string[]

Defined in

sandpack-react/src/types.ts:143


fileResolver

Optional fileResolver: FileResolver

Defined in

sandpack-react/src/types.ts:142


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:137


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:127


initModeObserverOptions

Optional initModeObserverOptions: IntersectionObserverInit

Defined in

sandpack-react/src/types.ts:128


logLevel

Optional logLevel: SandpackLogLevel

Defined in

sandpack-react/src/types.ts:138


readOnly

Optional readOnly: boolean

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

Defined in

sandpack-react/src/types.ts:113


recompileDelay

Optional recompileDelay: number

Defined in

sandpack-react/src/types.ts:131


recompileMode

Optional recompileMode: "immediate" | "delayed"

Defined in

sandpack-react/src/types.ts:130


showInlineErrors

Optional showInlineErrors: boolean

Defined in

sandpack-react/src/types.ts:102


showLineNumbers

Optional showLineNumbers: boolean

Defined in

sandpack-react/src/types.ts:101


showNavigator

Optional showNavigator: boolean

Defined in

sandpack-react/src/types.ts:100


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:119


showRefreshButton

Optional showRefreshButton: boolean

Defined in

sandpack-react/src/types.ts:103


showTabs

Optional showTabs: boolean

Defined in

sandpack-react/src/types.ts:104


skipEval

Optional skipEval: boolean

Defined in

sandpack-react/src/types.ts:141


startRoute

Optional startRoute: string

Defined in

sandpack-react/src/types.ts:140


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:88


wrapContent

Optional wrapContent: boolean

Defined in

sandpack-react/src/types.ts:106