Expand description
§dioxus-docs-kit
Reusable documentation site shell and blog engine for Dioxus applications.
Provides a complete docs layout with sidebar navigation, search modal, page navigation, OpenAPI API reference pages, and mobile drawer. Also includes a full blog engine with post listing, tag filtering, search, reading time, and MDX rendering.
§Quick Start — Docs
ⓘ
use dioxus::prelude::*;
use dioxus_docs_kit::{DocsConfig, DocsRegistry, DocsContext, DocsLayout, DocsPageContent};
use std::sync::LazyLock;
static DOCS: LazyLock<DocsRegistry> = LazyLock::new(|| {
DocsConfig::new(include_str!("../docs/_nav.json"), doc_content_map())
.with_default_path("getting-started/introduction")
.build()
});§Quick Start — Blog
ⓘ
use dioxus::prelude::*;
use dioxus_docs_kit::{BlogConfig, BlogRegistry, BlogContext, BlogLayout, BlogList, BlogPostView};
use std::sync::LazyLock;
dioxus_docs_kit::blog_content_map!();
static BLOG: LazyLock<BlogRegistry> = LazyLock::new(|| {
BlogConfig::new(include_str!("../blog/_blog.json"), blog_content_map())
.with_posts_per_page(9)
.build()
});Re-exports§
pub use config::CodeThemeConfig;pub use config::DocsConfig;pub use config::ThemeConfig;pub use error::DocsKitError;pub use registry::DocsRegistry;pub use registry::ApiEndpointEntry;pub use registry::SearchEntry;pub use components::ActiveTab;pub use components::CopyPageButton;pub use components::CopyPageButton;pub use components::CurrentTheme;pub use components::DocsLayout;pub use components::DocsLayout;pub use components::DocsPageContent;pub use components::DocsPageContent;pub use components::DocsPageMeta;pub use components::DocsPageMeta;pub use components::DocsSidebar;pub use components::DocsSidebar;pub use components::DocsVariant;pub use components::DrawerOpen;pub use components::LayoutOffsets;pub use components::MobileDrawer;pub use components::MobileDrawer;pub use components::SearchButton;pub use components::SearchButton;pub use components::SearchModal;pub use components::SearchModal;pub use components::SearchOpen;pub use components::ThemeToggle;pub use components::ThemeToggle;pub use components::use_theme_provider;pub use hooks::DocsProviders;pub use hooks::use_docs_context;pub use hooks::use_docs_providers;pub use blog::hooks::ActiveTag;pub use blog::hooks::CurrentPage;pub use blog::types::Author;pub use blog::types::BlogFrontmatter;pub use blog::types::BlogPost;pub use blog::types::BlogSearchEntry;pub use blog::BlogConfig;pub use blog::BlogProviders;pub use blog::BlogRegistry;pub use blog::use_blog_providers;pub use components::AuthorInfo;pub use components::AuthorInfo;pub use components::BlogCard;pub use components::BlogCard;pub use components::BlogIndexMeta;pub use components::BlogIndexMeta;pub use components::BlogLayout;pub use components::BlogLayout;pub use components::BlogList;pub use components::BlogList;pub use components::BlogMobileDrawer;pub use components::BlogMobileDrawer;pub use components::BlogPostMeta;pub use components::BlogPostMeta;pub use components::BlogPostView;pub use components::BlogPostView;pub use components::BlogSearchButton;pub use components::BlogSearchButton;pub use components::BlogSearchModal;pub use components::BlogSearchModal;pub use components::BlogThemeToggle;pub use components::BlogThemeToggle;pub use components::ReadingProgressBar;pub use components::ReadingProgressBar;pub use components::ReadingTimeBadge;pub use components::ReadingTimeBadge;pub use components::RelatedPosts;pub use components::RelatedPosts;pub use components::TagFilter;pub use components::TagFilter;
Modules§
- blog
- Blog engine module for dioxus-docs-kit.
- components
- config
- Builder for constructing a
DocsRegistry. - error
- Error types for registry construction.
- hooks
- registry
- Documentation content registry.
- server
- Server-side (Axum) routes for crawler-facing endpoints.
Macros§
- blog_
content_ map - Generates a
blog_content_map()function that returns aHashMap<&'static str, &'static str>from the build-script output. - doc_
content_ map - Generates a
doc_content_map()function that returns aHashMap<&'static str, &'static str>from the build-script output.
Structs§
- ApiOperation
- API endpoint operation.
- ApiTag
- Tag metadata.
- Blog
Context - Navigation bridge for blog pages, decoupled from the consumer’s Route enum.
- Code
Theme - Syntax theme selection for
Code(). - Code
Theme Override - Reactive override for the syntax-highlighting theme used by rendered code blocks.
- Docs
Context - Navigation bridge that decouples library components from the consumer’s Route enum.
- Open
ApiSpec - Parsed OpenAPI specification.
- Parsed
Doc - Parsed documentation page with frontmatter and content.
- Source
Code - Source text to highlight at runtime.
- Theme
- A syntax-highlighting theme.
Enums§
- Http
Method - HTTP method.
- Language
- Tree-sitter grammar identifier.
Constants§
- DOCS_
KIT_ CSS - Precompiled stylesheet covering every class the kit’s components emit
(Tailwind utilities, DaisyUI dark/light themes, typography prose, and the
--dk-*token surface fromtheme.css).
Functions§
- Code
- Render syntax-highlighted source code.
- DocContent
- Render a list of DocNodes.
- DocTable
OfContents - Table of contents sidebar component with scroll tracking.
- Endpoint
Page - Full-page two-column layout for a single API endpoint.
- Mermaid
Diagram - Renders a mermaid diagram.
- extract_
headers - Extract headers from markdown content for table of contents.