Components / Foundations
InputBase
The native text-like <input> for Cynosure, and the only module allowed to render one. It is a foundation: no visual opinions, so composites style it.
Who uses itLink to "Who uses it"
TextField and SearchField. Field also pairs with it in its stories.
When to use it directlyLink to "When to use it directly"
Only when building a new text-entry composite that needs a native input.
Use a component instead when you want a text box: TextField for general text, SearchField for search, TextArea for multi-line.
UsageLink to "Usage"
tsx
import { InputBase } from "@arshad-shah/cynosure";
<InputBase className="my-input" name="email" invalid={hasError} />PropsLink to "Props"
It accepts every native input attribute, plus invalid.
| Prop | What it does | Type | Default |
|---|---|---|---|
invalid | Maps to aria-invalid. | boolean |
Generated from the type definitions in @arshad-shah/cynosure 0.5.0.
GuaranteesLink to "Guarantees"
invalidmaps toaria-invalid; when it is not set, the attribute is omitted.- The ref reaches the native
<input>. - No styling: composites add their own classes.
RelatedLink to "Related"
These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.