17 Replies
Hi @pearbender. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To create a wiki-style page using Nuxt UI (specifically with Nuxt UI Pro), you can leverage the UPage component for a grid layout with optional left and right columns—ideal for documentation or wiki-like layouts. Here’s a basic example of how you can structure such a page:
Key points:
- The
UPage
component provides the main layout.
- Use the right
slot for a table of contents (UContentToc
), which is common in wiki pages.
- The main content is rendered with ContentRenderer
.
- You can add navigation or other components in the left
slot if needed.
This setup assumes you are using Nuxt Content for your markdown-based content, which is a common approach for wiki/documentation sites. For more advanced features, explore additional Nuxt UI Pro components like UContentNavigation
for navigation trees and UContentSurround
for prev/next navigation links.
For more details and examples, see the UPage documentation and Nuxt Content installation guide for setting up your content structure and rendering logic.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai Like i want a title, then a few different sections analogous to h2
Let me check the knowledge base for you again. One moment! :books:
----------------------
To create a wiki-style page with a title and several sections (like h2 headings) using Nuxt UI Pro and Nuxt Content, you can use the UPage, UPageHeader, and UPageBody components. Your markdown content will be rendered with proper heading styles automatically when using ContentRenderer, thanks to Nuxt UI Pro’s typography integration.
Here’s a typical setup:
How it works:
- The page title and description are shown in the header.
- Your markdown file (e.g.,
content/wiki/my-page.md
) should use #
for the main title and ##
for sections:
- When rendered, Nuxt UI Pro will style the headings (h1
, h2
, etc.) beautifully and consistently, with no extra configuration needed if you use ContentRenderer and have Nuxt UI Pro installed and configured for typographyUsage.
If you want to customize the appearance of headings, you can do so in your app.config.ts
using the uiPro.prose
optionsH1.
This approach gives you a clean, wiki-style layout with a title and multiple sections, leveraging Nuxt Content and Nuxt UI Pro components.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai i don't literally want to render markdown. i want to style the page with components
Let me check the knowledge base for you again. One moment! :books:
----------------------
If you want to create a wiki-style page using Nuxt UI Pro components (not rendering markdown), you can compose your page using components like
UPage
, UPageHeader
, UPageBody
, and UPageSection
. This gives you full control over the structure and styling, while still achieving a documentation/wiki look.
Here’s an example of how you can structure such a page:
- UPage
provides the main layout grid.
- UPageHeader
displays the page title and description.
- Each UPageSection
acts like an H2 section, with its own title and description, and you can place any content or further components inside.
You can further customize each section with icons, headlines, or even use UPageFeature
for feature highlights. This approach gives you a clean, component-driven wiki/documentation layout without relying on markdown rendering, fully leveraging Nuxt UI Pro’s design system and flexibility PageSection PageHeader PageBody Page.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
why is everything ceneted
@kapa.ai why is everything centered
Let me check the knowledge base for you again. One moment! :books:
----------------------
The centering of content in Nuxt UI Pro components like UPage, UPageHeader, UPageBody, and UPageSection is determined by their default theme and slot classes. According to the documentation, many of these components use flexbox and grid layouts with classes that align and justify content centrally, especially on smaller screens.
For example, the UPage component's default layout is a centered single column if no left or right slots are provided. UPageHeader and UPageSection also use classes that center text and content by default, particularly in their vertical orientation or on mobile devices. This is intentional to provide a clean, readable layout out of the box, but you can override these styles using the ui prop or by customizing the theme in your app.config.ts Page PageHeader PageSection.
If you want to left-align content, you can:
- Use the horizontal orientation variant where available (e.g., for UPageSection or UPageHeader).
- Override the default slot or container classes via the ui prop or by customizing your theme in app.config.ts.
This flexibility allows you to adapt the layout to your specific needs.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai can you show me how to customize app.config.ts for this
Let me check the knowledge base for you again. One moment! :books:
----------------------
Certainly! To customize the alignment and other styles of Nuxt UI Pro components like UPage, UPageHeader, and UPageSection, you can override their slot classes in your
app.config.ts
file. This allows you to control layout details such as alignment.
For example, to left-align the content in UPageHeader
and UPageSection
, you can update their slot classes as follows:
This configuration will override the default centering and apply left alignment to the relevant slots. You can further adjust other slots or add/remove utility classes as needed for your design.
For more details on available slots and their default classes, refer to the UPageHeader theme and UPageSection theme documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai it didn't seem to do anything
Let me check the knowledge base for you again. One moment! :books:
----------------------
I'm sorry for the confusion. Based on the knowledge sources, customizing alignment for components like
UPageHeader
and UPageSection
is done by overriding their slot classes in app.config.ts
. However, the documentation does not explicitly state that adding text-left
or removing text-center
from the slot classes will always override the default alignment, especially if the component's internal structure or parent containers enforce centering via flex/grid utilities.
If your changes in app.config.ts
did not have any effect, it may be because:
- The slot you are overriding is not responsible for the alignment you want to change.
- The component's layout uses flex/grid properties that override text alignment.
- There may be a need to override additional or different slots, or use the ui
prop directly on the component for higher priority.
The knowledge sources do not provide a detailed troubleshooting guide for this scenario, nor do they list all possible slot names or their exact effects on alignment. If the documented approach does not work, you may need to inspect the component's rendered HTML and classes to identify which slot or container controls the alignment, and override that specifically.
For reference, here is how the documentation suggests overriding slot classes in app.config.ts
:
But if this does not work, the knowledge sources do not provide further troubleshooting steps or alternative methods. You may need to use the ui
prop directly on the component as a workaround, as this has higher priority over global configuration Config.
If you need more granular control, inspecting the component's structure in your browser's dev tools may help identify the correct slot or class to override. Unfortunately, the knowledge sources do not contain enough information to provide a more specific solution.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@779279431419559947> Kapa.ai is still learning and improving, please let me know how I did by reacting below.