Skip to content

Clarify shikiTheme and shikiThemes usage and theme preloading in latest version #25

@SikandarJODD

Description

@SikandarJODD

I’m a bit confused about the current usage of shikiTheme and would appreciate clearer documentation around it.

Previously, I was using shikiTheme like this:

<Streamdown
	{content}
	shikiTheme={mode.current === 'dark' ? 'github-dark-default' : 'github-light-default'}
	components={{ code: Code }}
	baseTheme="shadcn"
	{...restProps}
/>

However, in the latest version, shikiTheme no longer seems to work as expected.

For example, switching themes dynamically like this:

shikiTheme={mode.current === 'dark'
	? 'github-dark-default'
	: 'github-light-default'}

doesn’t seem to work in the latest version. I’m not sure if this is expected behavior, a breaking change, or if there’s a new recommended way to handle dynamic Shiki theme switching.

Image

Additionally, in v2 we had support for preloading themes, something like:

shikiPreloadThemes={["github-dark-default", "github-light-default"]}

It would be really helpful to have documentation covering:

  • The correct way to use shikiTheme now
  • How to use themes like vesper, github-light-default, and github-dark-default
  • Whether theme preloading is still supported, and if so, how to configure it

clearer docs here would really help users migrating from earlier versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions