To install the @callstack/rspress-theme
package, use your package manager of choice.
For example, with npm:
npm install @callstack/rspress-theme
Or with yarn:
yarn add @callstack/rspress-theme
To use the rspress-theme
package, you need to add the plugin to the Rspress configuration in the plugin section. You can also import components through named imports like Announcement
. These components can be used in your .mdx
files or added to the layout as described in the guide.
In your rspress.config.ts
file, import pluginCallstackTheme
from @callstack/rspress-theme/plugin
and add it to the plugins array:
import { defineConfig } from '@rspress/shared'
import { pluginCallstackTheme } from '@callstack/rspress-theme/plugin'
export default defineConfig({
plugins: [
pluginCallstackTheme(),
// other plugins
],
})
You can import components from the theme as named imports:
import { Announcement } from '@callstack/rspress-theme'
// Use the component in your code