121
GitHub
Forms

Input

Captures short text, email, password, search, or numeric values.

FrameworksAstro · React · Elements

Registry commandlumen add Input

InteractionNative markup

01

See it in context

Preview

Use lowercase letters, numbers, and hyphens only.

02

Copy a working example

Usage

astro
---
import {
  Field,
  Input
} from '@santi020k/lumen-astro'
---

<div style="display: grid; gap: 0.75rem; max-width: 20rem;">
  <Field>
    <label for="ex-input-small">Small input</label>
    <Input id="ex-input-small" name="small-input" placeholder="Small" size="sm" />
  </Field>
  <Field>
    <label for="ex-input-email">Email</label>
    <Input id="ex-input-email" name="email" placeholder="you@example.com" type="email" />
  </Field>
  <Field>
    <label for="ex-input-large">Large input</label>
    <Input id="ex-input-large" name="large-input" placeholder="Large" size="lg" />
  </Field>
  <Field>
    <label for="ex-input-disabled">Disabled input</label>
    <Input id="ex-input-disabled" name="disabled-input" disabled placeholder="Disabled" />
  </Field>
  <Field>
    <label for="ex-input-invalid">Workspace slug</label>
    <Input
      aria-describedby="ex-input-invalid-error"
      aria-invalid="true"
      id="ex-input-invalid"
      name="workspace-slug"
      value="lumen docs"
    />
    <p id="ex-input-invalid-error">Use lowercase letters, numbers, and hyphens only.</p>
  </Field>
</div>
---
import {
  Field,
  Input
} from '@santi020k/lumen-astro'
---

<div style="display: grid; gap: 0.75rem; max-width: 20rem;">
  <Field>
    <label for="ex-input-small">Small input</label>
    <Input id="ex-input-small" name="small-input" placeholder="Small" size="sm" />
  </Field>
  <Field>
    <label for="ex-input-email">Email</label>
    <Input id="ex-input-email" name="email" placeholder="you@example.com" type="email" />
  </Field>
  <Field>
    <label for="ex-input-large">Large input</label>
    <Input id="ex-input-large" name="large-input" placeholder="Large" size="lg" />
  </Field>
  <Field>
    <label for="ex-input-disabled">Disabled input</label>
    <Input id="ex-input-disabled" name="disabled-input" disabled placeholder="Disabled" />
  </Field>
  <Field>
    <label for="ex-input-invalid">Workspace slug</label>
    <Input
      aria-describedby="ex-input-invalid-error"
      aria-invalid="true"
      id="ex-input-invalid"
      name="workspace-slug"
      value="lumen docs"
    />
    <p id="ex-input-invalid-error">Use lowercase letters, numbers, and hyphens only.</p>
  </Field>
</div>
03

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add Input
lumen add Input

API reference

Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

AttributeValuesDefaultDescription
typeHTML input type"text"Sets the native input type.
size"default" | "sm" | "lg""default"Controls the field height and font size.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.