 Search
components/badge: Badge components/button: Button components/checkbox: Checkbox components/input: Input components/popover: Popover components/typography: Typography plugins/plugin-nf: Nerd Font Plugin plugins/theme-catppuccin: Catppuccin Theme plugins/theme-nord: Nord Theme plugins/theme-gruvbox: Gruvbox Theme start/ascii-boxes: ASCII Boxes start/changelog: Changelog start/changelog: ## 0.0.5 start/changelog: ## 0.0.4 start/changelog: ## 0.0.3 start/changelog: ## 0.0.2 start/changelog: ## 0.0.1 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/nextjs: Next.js installation/vite: Vite start/theming: Theming start/theming: ## CSS Variables start/theming: ### Font Styles start/theming: ### Colors start/theming: ### Light & Dark start/theming: ## Theme Plugins installation/astro: Astro installation/astro: ## Scoping installation/astro: ### Frontmatter Imports installation/astro: ### <style> tag installation/astro: ### Full Library Import 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

Input

Displays an input

<input placeholder="Type something" />

Import

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

Usage

<input />

Examples

Sizing

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

Box Borders

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

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

<label box-="round contain:!top">
  <div clas="row">
      <span is-="badge" variant-="background0">Username</span>
  </div>
  <input placeholder="johndoe123" />
</label>
<div contenteditable box-="round">
  content editable div
</div>
input {
  background-color: var(--background0);
}
body {
  display: flex;
  flex-direction: column;
  gap: 1lh;
}
.row {
  display: flex;
}

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"] { /* ... */ }