Skip to Content
Vuesho

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.

src/components/NextSteps.vue
<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, with CalloutContainer, CalloutTitle and CalloutDescription to build your own.
  • card: Cards and Card, a grid of links to other pages.
  • codeblock: CodeBlock and Pre, the frame of a code block with its title and copy button, and CodeBlockTabs for code blocks in tabs. The slot actions of CodeBlock adds controls before the copy button.
  • heading: Heading, a heading with an anchor link.
  • tabs: Tabs and Tab, content in tabs, with TabsList, TabsTrigger and TabsContent for full control.
  • steps: Steps and Step, numbered steps.
  • accordion: Accordions and Accordion, sections that expand.
  • files: Files, Folder and File, 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 an id, 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, call fetchRepositoryInfo() in a data route and pass its value as info.
  • 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, EditOnGitHub and PageLastUpdate, the parts of a page in each docs layout.
  • vuesho/ui/layouts/shared/page-actions: MarkdownCopyButton and ViewOptionsPopover, 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, SidebarFolder and 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, and sidebar/tabs/dropdown with SidebarTabsDropdown to switch between them.
  • vuesho/ui/components/toc: TOCProvider and TOCScrollArea, the table of contents, with its items in three styles: toc/default, toc/clerk and toc/block.
  • 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, SearchDialogList and 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 by variant and size.
  • accordion, collapsible, popover and tabs: 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.