charcell 0.1.0
mode

TextInput

one line of text, boxed or dense.

usage

example

code

import { TextInput } from 'charcell/react';

export function TextInputExample() {
  return (
    <TextInput placeholder="search highway 9" aria-label="search highway 9" />
  );
}

as text

at rest
┌──────────────────────┐
│ search highway 9     │
└──────────────────────┘
hover
┌──────────────────────┐
│ search highway 9     │
└──────────────────────┘

props

valuestring
The text, held by the consumer; pair it with onValueChange.
binds with v-model:value in vue, bind:value in svelte
onValueChange(value: string) => void
Called with the text on every change.
defaultValuestring
The text to start with, uncontrolled: the field owns it from there.
variant'boxed' | 'dense'= 'boxed'
boxed draws the ring around the field; dense is a bare one-row faint strip, 16px tall, which misses WCAG 2.5.8's 24px target; boxed meets it.
border'none' | 'single' | 'rounded' | 'heavy' | 'double'
The style of every side of the boxed field's ring: single, rounded, heavy, double or none.
borderX'none' | 'single' | 'rounded' | 'heavy' | 'double'
The style of the boxed field's ring's start and end sides, over border.
borderY'none' | 'single' | 'rounded' | 'heavy' | 'double'
The style of the boxed field's ring's top and bottom sides, over border.
borderTop'none' | 'single' | 'rounded' | 'heavy' | 'double'
The style of the boxed field's ring's top side, over borderY and border.
borderEnd'none' | 'single' | 'rounded' | 'heavy' | 'double'
The style of the boxed field's ring's end side, over borderX and border.
borderBottom'none' | 'single' | 'rounded' | 'heavy' | 'double'
The style of the boxed field's ring's bottom side, over borderY and border.
borderStart'none' | 'single' | 'rounded' | 'heavy' | 'double'
The style of the boxed field's ring's start side, over borderX and border.

it also takes any other attribute of its <input>.