Components/Forms/Input · Textarea
COMPONENT05.05

Input · Textarea

Native text controls in shadcn geometry — input plus textarea. Focus rings follow --ring; errors via aria-invalid.


INSTALL

1pnpm dlx @sayagodev/mo add form

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/form.css";

EXAMPLES

Input
With label & hint
Your API key is encrypted and stored securely.
Disabled
This field is currently disabled.
Required
This field must be filled out.
Invalid state
This field contains validation errors.
Label with badge
Two-column fields
Full form
We'll never share your email with anyone.
Search + buttons
Inline search
Joined group states
This field contains validation errors.
Textarea
Textarea + button
Textarea disabled
Textarea in field
Enter your message below.
Textarea invalid
Please enter a valid message.
File
Select a picture to upload.

USAGE

1<div data-field>2  <label for="id">Label</label>3  <input id="id" />4  <small data-hint>Hint</small>5  <small class="error">Error</small>   <!-- shows on aria-invalid="true" -->6</div>

API

NAMEKINDDESCRIPTION
[data-field]attributeField wrapper: column layout, gap, error wiring
aria-invalid="true"attributeReveals .error, destructive border/ring
:user-invalidattributeNative validation styling hook
fieldset.groupelementJoined controls: prefix addon + inputs/buttons
--mo-input-radiustokenShared by input/select/taginput

FILES

src/css/form.css
Install:mo add form

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--background--border--destructive--foreground--input--muted--muted-foreground--primary--primary-foreground--radius--ring
Component hooks
--mo-field-gap--mo-input-padding-x--mo-input-radius--mo-slider-thumb-bg--mo-switch-thumb--mo-switch-width

Preview

Key expira en 12 días — rodala antes.

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.