shadcn-docs-nuxt

repository·main·Indexed 21 days ago

https://github.com/ztl-uwu/shadcn-docs-nuxt

A high-quality documentation template for Nuxt applications, built with Nuxt Content for content management and shadcn-vue for a modern UI design. Version 1.2.2 provides a pre-configured structure and a suite of UI components including Accordion, Alert, Avatar, Badge, Breadcrumb, Button, Card, Collapsible, and Command.

Tokens
65.3K
Snippets
261
Records
319
Agent score
66%

What's inside shadcn-docs-nuxt

  1. Introduction to shadcn-docs-nuxt

    main

    shadcn-docs-nuxt is a Nuxt-based documentation template built using Nuxt Content and shadcn-vue. It serves as a free, open-source alternative to premium documentation solutions like Docus and Nuxt UI Pro Docs.

    Key Features

    • Open Source: Completely free to use and customize.
    • Highly Customizable: Full control over configuration.
    • Rich Component Library: Includes a variety of specialized components for documentation (see /components/prose).
    • Mobile Support: Fully responsive design.
    • Indexed Search: Powered by Nuxt Content for efficient content discovery.
    • Compatibility: Compatible with components from Docus, Nuxt UI Pro Docs, and undocs.
  2. Overview of shadcn-docs-nuxt

    main

    shadcn-docs-nuxt is a documentation template for Nuxt built using Nuxt Content and shadcn-vue. It serves as a free, open-source alternative to premium documentation solutions like Docus or Nuxt UI Pro Docs.

    Key Features

    • Open Source: Free to use and customize.
    • Customizable: Fully configurable via the configuration API.
    • Rich Component Library: Includes specialized components for prose and documentation workflows.
    • Mobile Support: Responsive design out of the box.
    • Search: Built-in indexed searching powered by Nuxt Content.
    • Compatibility: Offers partial component compatibility with Docus, Nuxt UI Pro Docs, and undocs.
  3. Supported Markdown Prose Components

    main

    The shadcn-docs-nuxt project includes a suite of prose components designed to style standard Markdown elements. When writing content in Markdown files, the following elements are supported and styled via the prose engine:

    • Headings: # through ###### (H1 to H6).
    • Links: [Text](/path).
    • Blockquotes: > Text.
    • Horizontal Rules: ---.
    • Lists: Unordered (- Item) and Ordered (1. Item).
    • Paragraphs: Standard text blocks.
    • Text Styling: Strong (**text**) and Italic (_text_).
    • Tables: Standard Markdown pipe tables.
    • Code Blocks: Fenced code blocks (see specific documentation for advanced features).
    • Images: Standard Markdown image syntax.

    For more detailed information on specific complex components, refer to the dedicated guides for Code Blocks and Images and Embeds.

  4. Configure sidebar styles for folders

    main

    The sidebar.style property in _dir.yml determines how the folder and its children are rendered in the navigation. The available options are:

    • default: The standard sidebar layout.
    • tree: A tree-style hierarchical layout.
    • group: A grouped layout.

    The default value for this setting can be configured globally in the appConfig under the aside key.

    sidebar:
      style: group
  5. Alert component variants

    main

    The Alert component supports several semantic variants via the type property to convey different levels of importance or meaning:

    • info: Informational messages.
    • note: General notes or annotations.
    • success: Positive outcomes or successful actions.
    • example: Illustrative examples.
    • warning: Cautionary messages.
    • danger: Critical errors or dangerous actions.
    • secondary: A secondary visual style (distinct from semantic types).
    • default: The standard alert style.
    ::alert{type="info" icon="lucide:info"}
      An **info** alert.
    ::
    
    ::alert{type="success" icon="lucide:lightbulb"}
      A **success** alert.
    ::
    
    ::alert{type="danger" icon="lucide:circle-x"}
      A **danger** alert.
    ::
  6. Synchronize tab selection across multiple components

    main

    You can synchronize the active tab across different ::tabs instances by providing a matching sync string value. When two or more components share the same sync value, selecting a tab in one will automatically select the corresponding tab in the others.

    Example:

    # Scope 1
    ::tabs{variant="card" sync="my-scope"}
      ::div{label="Tab A"}
      ::
    ::
    
    # Scope 2
    ::tabs{variant="line" sync="my-scope"}
      ::div{label="Tab A"}
      ::
    ::
    ::tabs{variant="card" sync="your-scope-name"}
      ::div{label="Card Tab"}
      ### This is a card-style tab
      ::
    ::
    
    ::tabs{variant="line" sync="your-scope-name"}
      ::div{label="Card Tab"}
      ### This is a card-style tab
      ::
    ::
  7. Configure Sidebar Badges and Authors

    main

    You can enhance the sidebar and page headers with badges and author information.

    Appends badges to the end of the sidebar link. Each badge can have a value and a type (e.g., lime).

    Page Badges (badges)

    Displays badges at the bottom of the page title. Each badge can include a value, an icon (using Lucide syntax), a destination to, and a target (e.g., _blank).

    Authors (authors)

    Displays author information at the bottom of the page title. Each author object supports:

    • name: Display name
    • username: Username
    • avatar: URL to the avatar image
    • to: Link to the author's profile
    • target: Link target (e.g., _blank)
    # Sidebar Badges
    navBadges:
      - value: New
        type: lime
    
    # Page Badges
    badges:
      - value: Source
        icon: lucide:code
        to: https://github.com/ZTL-UwU/shadcn-docs-nuxt/blob/main/components/content/FileTree.vue
        target: _blank
    
    # Authors
    authors:
      - name: Tony Zhang
        username: ZTL-UwU
        avatar: https://www.github.com/ZTL-UwU.png
        to: https://github.com/ZTL-UwU
        target: _blank
  8. Configure sidebar styles in _dir.yml

    main

    The sidebar.style option allows you to control how the folder and its children are rendered in the sidebar. The available options are:

    • default: The standard sidebar layout.
    • tree: A tree-structured hierarchical layout.
    • group: A grouped layout.

    The global default for this setting can be configured in the appConfig under the aside section.

    sidebar:
      style: group
  9. Sync tab state across multiple components

    main

    You can synchronize the active tab state between different ::tabs instances by providing the same string value to the sync prop. When tabs share a sync scope, selecting a tab in one component will automatically select the corresponding tab in all other components within that same scope.

    Example: If two ::tabs components both have sync="my-scope", they will stay in sync.

    ::tabs{sync="scope1"}
      ::div{label="Tab A"}
      ::
    ::
    
    ::tabs{sync="scope1"}
      ::div{label="Tab A"}
      ::
    ::
  10. Configure Tabs variants

    main

    The ::tabs component supports several visual styles via the variant property:

    • separate (default): Standard tabbed interface.
    • card: Displays tabs in a card-like container.
    • line: A minimalist style with underlined active tabs.
    • combobox: Converts the tabs into a searchable dropdown menu, useful when there are many tabs.

    Example of a card-style tab:

    ::tabs{variant="card"}
      ::div{label="Card Tab"}
      ### Content
      ::
    ::
    ::tabs{variant="card"}
      ::div{label="Card Tab"}
      ### This is a card-style tab
      ::
      ::div{label="Tab 2" icon="lucide:atom"}
      This is Tab #2
      ::
    ::
  11. Use the Accordion component in MDC

    main

    The Accordion component allows you to create expandable/collapsible content sections. You can use it within Markdown Content (MDC) using the ::accordion and ::accordion-item components.

    By default, ::accordion-item auto-generates a value prop. If you want to control which item is open by default, you can manually assign unique value strings to items and pass them to the default-value prop of the ::accordion parent.

    To allow users to close an item that is currently open, add the collapsible prop to the ::accordion component.

    ::accordion{default-value="first-item" collapsible}
      ::accordion-item{value="first-item"}
        #title
        Is it accessible?
    
        #content
        Yes. It adheres to the WAI-ARIA design pattern.
      ::
    
      ::accordion-item
        #title
        Is it unstyled?
    
        #content
        Yes. It's unstyled by default.
      ::
    
      :accordion-item{title="Can it be animated?" content="Yes!"}
    ::
  12. Supported Markdown Syntax in shadcn-docs

    main

    The shadcn-docs prose components support standard Markdown syntax for content creation. This allows you to build rich documentation pages using common Markdown elements. Supported elements include:

    • Headings: # (H1) through ###### (H6).
    • Links: [Text](/path).
    • Blockquotes: > Quote text.
    • Code Blocks: Fenced code blocks using triple backticks.
    • Images: Standard Markdown image syntax.
    • Horizontal Rules: ---.
    • Lists: Unordered (- or *) and Ordered (1.).
    • Paragraphs: Standard text blocks.
    • Emphasis: Bold (**text**) and Italic (_text_).
    • Tables: GitHub Flavored Markdown tables.

    Note: For advanced styling of code blocks and images, refer to the specific component guides for code-blocks and images-and-embeds.

    # Heading 1
    
    This is a paragraph with **bold text** and _italic text_.
    
    - Item 1
    - Item 2
    
    [Link](/getting-started/introduction)
    
    | Key | Value |
    | --- | ---- |
    | 1   | Data |