Components
The components of the UI and where to import them from.
Every module is imported by its folder, like vuesho/ui/components/card. The components work as in Fumadocs UI, with slots in place of React nodes: a prop like the title of Card takes text, and the slot of the same name takes other content.
<script setup lang="ts">
import { Card, Cards } from "vuesho/ui/components/card";
</script>
<template>
<Cards>
<Card title="Quick Start" href="/quick-start">Create your first site.</Card>
<Card title="Theme" href="/theme">Change the UI of your site.</Card>
</Cards>
</template>Markdown Components
A page uses these by name, without an import: vuesho/components exports them, see Components. Under vuesho/ui/components/:
callout:Callout, a box for a note or warning, withCalloutContainer,CalloutTitleandCalloutDescriptionto build your own.card:CardsandCard, a grid of links to other pages.codeblock:CodeBlockandPre, the frame of a code block with its title and copy button, andCodeBlockTabsfor code blocks in tabs. The slotactionsofCodeBlockadds controls before the copy button.heading:Heading, a heading with an anchor link.tabs:TabsandTab, content in tabs, withTabsList,TabsTriggerandTabsContentfor full control.steps:StepsandStep, numbered steps.accordion:AccordionsandAccordion, sections that expand.files:Files,FolderandFile, a file tree.image-zoom:ImageZoom, an image that opens full size on click.type-table:TypeTable, a table of the properties of a type.
vuesho/ui/twoslash has Popup, PopupTrigger and PopupContent, the popups of Twoslash.
The elements Markdown renders, like links, images, headings, code blocks and tables, are styled by the components of vuesho/ui/mdx, which vuesho/components exports by the names of the elements: a, img, h1 to h6, pre and table.
Other Components
Import these yourself, in a custom page or a page's <script setup>, or export them from your components module:
banner:Banner, a bar at the top of the page. With anid, the reader can close it.inline-toc:InlineTOC, a table of contents inside the page that expands.github-info:GithubInfo, a link to a repository with its stars and forks. It fetches them in the browser once it is mounted. To fetch them on the server, with a token, callfetchRepositoryInfo()in a data route and pass its value asinfo.dynamic-codeblock:DynamicCodeBlock, a code block highlighted in the browser, for code that isn't in your Markdown.
Layout Parts
The parts the layouts are made of, for a layout of your own:
vuesho/ui/layouts/<name>/page:DocsPage,DocsTitle,DocsDescription,DocsBody,EditOnGitHubandPageLastUpdate, the parts of a page in each docs layout.vuesho/ui/layouts/shared/page-actions:MarkdownCopyButtonandViewOptionsPopover, the actions of a page.vuesho/ui/layouts/home/not-found:DefaultNotFound, the content of the not found page.vuesho/ui/components/sidebar/base:SidebarProvider,SidebarContent,SidebarItem,SidebarFolderand the other parts of a sidebar.vuesho/ui/components/sidebar/page-tree:createPageTreeRenderer(), which renders a page tree with the sidebar parts.vuesho/ui/components/sidebar/tabs:getSidebarTabs(), the tabs of the root folders of a page tree, andsidebar/tabs/dropdownwithSidebarTabsDropdownto switch between them.vuesho/ui/components/toc:TOCProviderandTOCScrollArea, the table of contents, with its items in three styles:toc/default,toc/clerkandtoc/block.
Search
vuesho/ui/provider/base:RootProvider, the root component of the UI, which gives its components the search, the color mode and the language switch.vuesho/ui/components/dialog/search-default: the default search dialog.vuesho/ui/components/dialog/search-algolia: a search dialog for Algolia.vuesho/ui/components/dialog/search-orama: a search dialog for Orama Cloud.vuesho/ui/components/dialog/search:SearchDialog,SearchDialogInput,SearchDialogListand the other parts, to build your own dialog.
See Search to use the Algolia and Orama dialogs.
Primitives
The building blocks of the components above, styled on Reka UI. Under vuesho/ui/components/ui/:
button:buttonVariants(), the classes of a button byvariantandsize.accordion,collapsible,popoverandtabs: the Reka UI components of the same names, styled.
vuesho/ui/primitives/drawer is the drawer the glass layout opens its sidebar in, and vuesho/ui/utils/cn exports cn() to join class names.