Sandpack Themes
All themes
See all themes available on @codesandbox/sandpack-themes and how you can use it
Sandpack Theme Builder
Design and customize your own theme, among other Sandpack presets.
The overall style can be set through the theme prop. Sandpack offers a set of predefined options, but individual values can be passed to customize the style of your Sandpack instance. Besides the included themes, you can also consume a set of themes from @codesandbox/sandpack-themes, an open-source package that contains many other themes compatible with Sandpack.
Try it out (17 total):
import { amethyst } from "@codesandbox/sandpack-themes"; <Sandpack theme={amethyst} />;
Custom Theme
You can also pass a partial theme object that overrides properties in the default theme, which is light.
Editable example
import { Sandpack } from "@codesandbox/sandpack-react"; export default function App() { return ( <Sandpack theme={{ colors: { accent: "rebeccapurple", }, syntax: { tag: "#006400", string: "rgb(255, 165, 0)", plain: "tomato", }, }} /> ); }
Preview