Skip to content

UI Components Alpha

Word count
441 words
Reading time
3 minutes

🛑 This package is in Alpha stage.

This package is still in the Alpha stage, and it is not recommended to use it in production. The API may change in the future, and there may be bugs in the current version. Please use it with caution.

🚧 Constructing

Nice to meet you! But sorry, this page is still under construction. If you don’t find the information you are interested in, you can first find the content you are interested in in the navigation in the sidebar to start reading.

How to use

🙋 Before install

Currently @nolebase/ui is still under development, and will be used by other Nolebase Integrations components now (such as vitepress-plugin-git-changelog). And those components and integrations of Nolebase Integrations will configure the needed options and settings to bundle and transform the underlying dependencies.

Therefore, if you would ever want to install @nolebase/ui as one of your dependencies, you would need to configure a few configurations before proceeding:

1. Additional configurations for Vite

1.1 For users who imported <NuLazyTeleportRiveCanvas /> component

Since <NuLazyTeleportRiveCanvas /> depends on @rive-app/canvas. If you also use Vite as your bundler, you will need to add the following configurations to your vite.config.ts file like this:

typescript
import { 
defineConfig
} from 'vite'
export default
defineConfig
(() => {
return {
optimizeDeps
: {
include
: [
// Add this line to your vite.config.ts's optimizeDeps.include array // '@nolebase/ui-rive-canvas > @rive-app/canvas', ], }, } })

For more information about why configure this, please refer to the Dep Optimization Options | Vite documentation.

If you are using VitePress, and imported components relies on VitePress, you will need to add the following configurations to your vite.config.ts file like this:

typescript
import { 
defineConfig
} from 'vite'
export default
defineConfig
(() => {
return {
ssr
: {
noExternal
: [
// Add this line to your vite.config.ts's ssr.noExternal array // '@nolebase/ui', ], }, } })

For more information about why configure this, please refer to the Server-Side Rendering | Vite documentation.

Installation

You can install @nolebase/ui as one of your Vue or VitePress project dependencies with the following command:

shell
pnpm add @nolebase/ui -D
shell
npm install @nolebase/ui -D
shell
yarn add @nolebase/ui -D

Contributors

Changelog

Layout Switch

Adjust the layout style of VitePress to adapt to different reading needs and screens.

Expand all
The sidebar and content area occupy the entire width of the screen.
Expand sidebar with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Expand all with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Original width
The original layout width of VitePress

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.

Spotlight

Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.

ONOn
Turn on Spotlight.
OFFOff
Turn off Spotlight.

Spotlight Styles

Adjust the styles of Spotlight.

Under
Add a solid background color underneath the hovering element to highlight where the cursor is currently hovering.
Aside
Add a fixed line with solid color aside the hovering element to highlight where the cursor is currently hovering.