xyd 0.1.0-beta - Coming Soon

Customization
/
Theme API

Theme APIComing Soon

Learn how to use Theme API

While theme settings provide a quick way to customize your documentation, using the Theme API gives you more flexibility and programmable control.

This approach allows you to build upon the existing design while adding your own customizations, all while maintaining the core functionality of the default theme.

All built-in themes like poetry or opener are based on the default theme and use the Theme API.

Getting Started

To use Theme API you need to create .docs/theme/index.ts file:

for example:

Style Customization

Create an index.css file in your .docs/theme directory and import that to add custom styles:

You can add as many style file as you want. Also names of your imported styles are your own.

Overriding ComponentsComing Soon

Custom ComponentsComing Soon

Here's an example of how to add a custom component to your theme:

You can then use this component in your markdown:

or you can use a MDX syntax too:

If you not set name in customComponents function, it will convert PascalCase to kebab-case for markdown syntax.

SurfacesComing Soon

If you want to add your custom components into specific place inside docs, you can use surface:

if you still want to have this component available inside your content:

Built with

Show your support! Star us on GitHub ⭐️