 Search
guides/style-guide: Style Guide guides/style-guide: ## Box Model guides/style-guide: ## Text plugins/plugin-dev: Developing Plugins plugins/plugin-dev: ### Style Layers components/input: Input components/input: ## Import components/input: ## Usage components/input: ### box- components/input: ### size- components/input: ### Extending plugins/plugin-nf: Nerd Font Plugin plugins/plugin-nf: ## Installation plugins/plugin-nf: ## Install a Nerd Font plugins/plugin-nf: ### Static Font plugins/plugin-nf: ### CDN plugins/plugin-nf: ## Components plugins/plugin-nf: ### <details> plugins/plugin-nf: ### Badge plugins/plugin-nf: #### cap- components/badge: Badge components/badge: ## Import components/badge: ## Usage components/badge: ### variant- components/badge: ### Styling components/badge: ### Extending components/badge: ## Scope start/ascii-boxes: ASCII Boxes start/ascii-boxes: ## Usage start/ascii-boxes: ## Border Types start/ascii-boxes: ## Containment start/ascii-boxes: ## Custom Properties start/ascii-boxes: ### --box-border-color start/ascii-boxes: ### --box-rounded-radius start/ascii-boxes: ### --box-border-width start/ascii-boxes: ### --box-double-border-width plugins/theme-nord: Nord Theme plugins/theme-nord: ## Installation plugins/theme-nord: ## Components plugins/theme-nord: ### Typography plugins/theme-nord: ### Badge plugins/theme-nord: ### Button plugins/theme-nord: ## CSS Variables components/button: Button components/button: ## Import components/button: ## Usage components/button: ### box- components/button: ### variant- components/button: ### size- components/button: ### disabled components/button: ### Styling components/button: ### Extending components/button: ## Scope plugins/theme-catppuccin: Catppuccin Theme plugins/theme-catppuccin: ## Installation plugins/theme-catppuccin: ## Flavors plugins/theme-catppuccin: ## Components plugins/theme-catppuccin: ### Typography plugins/theme-catppuccin: ### Badge plugins/theme-catppuccin: ### Button plugins/theme-catppuccin: ## CSS Variables plugins/theme-gruvbox: Gruvbox Theme plugins/theme-gruvbox: ## Installation plugins/theme-gruvbox: ## Variants plugins/theme-gruvbox: ## Components plugins/theme-gruvbox: ### Typography plugins/theme-gruvbox: ### Badge plugins/theme-gruvbox: ### Button plugins/theme-gruvbox: ## CSS Variables components/typography: Typography components/typography: ## Import components/typography: ## Usage components/typography: ### <h1>-<h6> components/typography: ### <p> components/typography: ### <blockquote> components/typography: ### <ol> components/typography: ### <ul> components/typography: #### <ul> Markers components/typography: ### [is-="typography-block"] components/typography: ## Scope start/intro: Introduction start/intro: ## Features start/installation: Installation start/installation: ## Installation start/installation: ## ESM Imports start/installation: ## CDN Imports start/installation: ## Full Library Import start/plugins: Plugins start/plugins: ## Official Plugins start/plugins: ### Themes start/plugins: ## Community Plugins start/theming: Theming start/theming: ## CSS Variables start/theming: ### Font Styles start/theming: ### Colors start/theming: ### Light & Dark start/theming: ## Theme Plugins start/tuis-vs-guis: TUIs vs GUIs start/tuis-vs-guis: ## Monospace Fonts start/tuis-vs-guis: ## Character Cells

Installation

It is highly recommended that you use CSS Imports with WebTUI

It’s possible to use ESM imports or CDN imports

WebTUI is a Pure CSS Library meaning you will still have to write some CSS

Installation

Install the base WebTUI package with your preferred package manager

bun i @webtui/css
npm i @webtui/css
yarn add @webtui/css
pnpm install @webtui/css

In your global CSS file, define the order of layers using the @layer at-rule [MDN Reference] before importing the base stylesheet

@layer base, utils, components;

@import "@webtui/css/base.css";

Import the desired utilities, components, and themes after importing the base stylesheet

@layer base, utils, components;

@import "@webtui/css/base.css";

/* Utils */
@import "@webtui/css/utils/box.css"; /*[!code ++]*/

/* Components */
@import "@webtui/css/components/button.css"; /*[!code ++]*/
@import "@webtui/css/components/typography.css"; /*[!code ++]*/

Add some HTML

<h1>Hello World</h1>
<h2>Hi world</h2>
<h3>Hi</h3>

<button>Normal button</button>

<button box-="square">Square button</button>

<div box-="square">
  <h1>Hi mom</h1>
  <h2>I'm in a box</h2>
</div>

You should see a significant upgrade from standard HTML styles

 installation-html.png

installation-html.png

If you want to add a pre-built color theme, check out the Plugins section

ESM Imports

Stylesheets can be imported via ESM if your bundler supports it

import "@webtui/css/components/button.css";

type Props = {
  /* ... */
};

export default function Button(props: Props) {
  return <button>{props.children}</button>;
}

CDN Imports

Stylesheets can be imported with <link> served via CDN

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@webtui/css/dist/base.css"
/>

To import a specific version, add @<version> to the CDN URL after /@webtui/css

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@webtui/[email protected]/dist/base.css"
/>

Although not recommended, the latest version of WebTUI can be imported via the @latest tag

Important: You must define the order of layers before importing any styles from WebTUI

<style>
  @layer base, utils, components;
</style>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@webtui/[email protected]/dist/base.css"
/>
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@webtui/[email protected]/dist/components/button.css"
/>
<!-- ... -->

All available stylesheets on the CDN are viewable via JSDelivr

Full Library Import

Import the entire library by importing the package directly, after defining the order of layers

@layer base, utils, components;

@import "@webtui/css";

ESM Imports are almost identical to CSS imports

import "@webtui/css";

For the CDN, import /dist/full.css instead of the base path

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@webtui/css/dist/full.css"
/>