 Search
components/badge: Badge components/button: Button components/checkbox: Checkbox components/dialog: Dialog components/popover: Popover components/input: Input components/pre: Pre components/radio: Radio components/separator: Separator components/switch: Switch components/table: Table components/textarea: Textarea components/tooltip: Tooltip components/typography: Typography plugins/plugin-nf: Nerd Font Plugin plugins/theme-catppuccin: Catppuccin Theme plugins/theme-gruvbox: Gruvbox Theme plugins/theme-nord: Nord Theme plugins/theme-vitesse: Vitesse Theme start/changelog: Changelog start/ascii-boxes: ASCII Boxes start/intro: Introduction start/intro: ## Features start/plugins: Plugins start/plugins: ## Official Plugins start/plugins: ### Themes start/plugins: ## Community Plugins contributing/contributing: Contributing contributing/contributing: ## Local Development contributing/contributing: ## Issues contributing/contributing: ## Pull Requests contributing/style-guide: Style Guide contributing/style-guide: ## CSS Units contributing/style-guide: ## Selectors contributing/style-guide: ## Documentation plugins/plugin-dev: Developing Plugins plugins/plugin-dev: ### Style Layers start/tuis-vs-guis: TUIs vs GUIs start/tuis-vs-guis: ## Monospace Fonts start/tuis-vs-guis: ## Character Cells installation/vite: Vite installation/nextjs: Next.js start/theming: Theming start/theming: ## CSS Variables start/theming: ### Font Styles start/theming: ### Colors start/theming: ### Light & Dark start/theming: ## Theme Plugins start/theming: ### Using Multiple Theme Accents start/installation: Installation start/installation: ## Installation start/installation: ## Using CSS start/installation: ## Using ESM start/installation: ## Using a CDN start/installation: ## Full Library Import start/installation: ### CSS start/installation: ### ESM start/installation: ### CDN installation/astro: Astro installation/astro: ## Scoping installation/astro: ### Frontmatter Imports installation/astro: ### <style> tag installation/astro: ### Full Library Import

Input

Displays an input

1 <input placeholder="Type something" />

Import

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

Usage

<input />

Examples

Sizing

1
2 <input size-="small" placeholder="Small" />
3 <input placeholder="Default" />
4 <input size-="large" placeholder="Large" />
5
1
2 body {
3 display: flex;
4 flex-direction: column;
5 gap: 1lh;
6 }

Box Borders

The box- utility cannot be used directly on <input> elements because inputs don’t support pseudo-elements

Instead, wrap an <input> with a <label box-="*"> or use a contenteditable element

1 <label box-="round" shear-="top">
2 <div clas="row">
3 <span is-="badge" variant-="background0">Username</span>
4 </div>
5 <input placeholder="johndoe123" />
6 </label>
7 <div contenteditable box-="round">
8 content editable div
9 </div>
1
2 input {
3 background-color: var(--background0);
4 }
5 body {
6 display: flex;
7 flex-direction: column;
8 gap: 1lh;
9 }
10 .row {
11 display: flex;
12 }

Reference

Extending

To extend the Input stylesheet, define a CSS rule on the components layer

@layer components {
    input,
    [is-~="input"] {
        &[size-="thicc"] {
            height: 3lh;
            padding: 1lh 8ch;
        }

        /* ... */
    }
}

Scope

  • All elements with the is-~="input" selector
  • All <input> elements that are not of type button, submit, reset, checkbox, or radio
input,
[is-~="input"] { /* ... */ }