Skip to content

Input

Accepts text input from users.
import { Input } from "stylus-ui/Input";
export default () => <Input />;

When displaying an input in a space-constrained location, you can pass small.

import { Input } from "stylus-ui/Input";
export default () => <Input small />;

When displaying an error message, pass error to highlight the input in red.

import { Input } from "stylus-ui/Input";
export default () => <Input error />;

Most inputs should also provide a label for accessibility. Import <Label>.

import { Input } from "stylus-ui/Input";
import { Label } from "stylus-ui/Label";
export default () => (
<Label className="flex flex-col gap-2">
Email address
<Input type="email" />
</Label>
);

Placeholder text may be used to provide an example of input to the user.

import { Input } from "stylus-ui/Input";
import { Label } from "stylus-ui/Label";
export default () => (
<Label className="flex flex-col gap-2">
Email address
<Input type="email" placeholder="alan@scribehow.com" />
</Label>
);
import { Input } from "stylus-ui/Input";
import { Label } from "stylus-ui/Label";
export default () => (
<Label className="flex flex-col gap-2">
Email address
<Input type="email" placeholder="alan@scribehow.com" disabled />
</Label>
);

Inherits properties from HTMLInputElement.

Prop
Type
Default
className string
error boolean false
small boolean false
theme "light""dark" "light"