Documentation
Forms
Input
Captures short text, email, password, search, or numeric values.
01
See it in context
Preview
Use lowercase letters, numbers, and hyphens only.
02
Copy a working example
Usage
---
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>import { Field, Input } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div style={{ display: 'grid', gap: '0.75rem', maxWidth: '20rem' }}>
<Field>
<label htmlFor="ex-input-small">Small input</label>
<Input id="ex-input-small" name="small-input" placeholder="Small" size="sm" />
</Field>
<Field>
<label htmlFor="ex-input-email">Email</label>
<Input id="ex-input-email" name="email" placeholder="you@example.com" type="email" />
</Field>
<Field>
<label htmlFor="ex-input-large">Large input</label>
<Input id="ex-input-large" name="large-input" placeholder="Large" size="lg" />
</Field>
<Field>
<label htmlFor="ex-input-disabled">Disabled input</label>
<Input id="ex-input-disabled" name="disabled-input" disabled placeholder="Disabled" />
</Field>
<Field>
<label htmlFor="ex-input-invalid">Workspace slug</label>
<Input
aria-describedby="ex-input-invalid-error"
aria-invalid="true"
id="ex-input-invalid"
name="workspace-slug"
defaultValue="lumen docs"
/>
<p id="ex-input-invalid-error">Use lowercase letters, numbers, and hyphens only.</p>
</Field>
</div>
</>
)import { Field, Input } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div style={{ display: 'grid', gap: '0.75rem', maxWidth: '20rem' }}>
<Field>
<label htmlFor="ex-input-small">Small input</label>
<Input id="ex-input-small" name="small-input" placeholder="Small" size="sm" />
</Field>
<Field>
<label htmlFor="ex-input-email">Email</label>
<Input id="ex-input-email" name="email" placeholder="you@example.com" type="email" />
</Field>
<Field>
<label htmlFor="ex-input-large">Large input</label>
<Input id="ex-input-large" name="large-input" placeholder="Large" size="lg" />
</Field>
<Field>
<label htmlFor="ex-input-disabled">Disabled input</label>
<Input id="ex-input-disabled" name="disabled-input" disabled placeholder="Disabled" />
</Field>
<Field>
<label htmlFor="ex-input-invalid">Workspace slug</label>
<Input
aria-describedby="ex-input-invalid-error"
aria-invalid="true"
id="ex-input-invalid"
name="workspace-slug"
defaultValue="lumen docs"
/>
<p id="ex-input-invalid-error">Use lowercase letters, numbers, and hyphens only.</p>
</Field>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div style="display: grid; gap: 0.75rem; max-width: 20rem;">
<lumen-field>
<label for="ex-input-small">Small input</label>
<lumen-input id="ex-input-small" name="small-input" placeholder="Small" size="sm"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-email">Email</label>
<lumen-input id="ex-input-email" name="email" placeholder="you@example.com" type="email"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-large">Large input</label>
<lumen-input id="ex-input-large" name="large-input" placeholder="Large" size="lg"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-disabled">Disabled input</label>
<lumen-input id="ex-input-disabled" name="disabled-input" disabled placeholder="Disabled"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-invalid">Workspace slug</label>
<lumen-input
aria-describedby="ex-input-invalid-error"
aria-invalid="true"
id="ex-input-invalid"
name="workspace-slug"
value="lumen docs"></lumen-input>
<p id="ex-input-invalid-error">Use lowercase letters, numbers, and hyphens only.</p>
</lumen-field>
</div><script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div style="display: grid; gap: 0.75rem; max-width: 20rem;">
<lumen-field>
<label for="ex-input-small">Small input</label>
<lumen-input id="ex-input-small" name="small-input" placeholder="Small" size="sm"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-email">Email</label>
<lumen-input id="ex-input-email" name="email" placeholder="you@example.com" type="email"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-large">Large input</label>
<lumen-input id="ex-input-large" name="large-input" placeholder="Large" size="lg"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-disabled">Disabled input</label>
<lumen-input id="ex-input-disabled" name="disabled-input" disabled placeholder="Disabled"></lumen-input>
</lumen-field>
<lumen-field>
<label for="ex-input-invalid">Workspace slug</label>
<lumen-input
aria-describedby="ex-input-invalid-error"
aria-invalid="true"
id="ex-input-invalid"
name="workspace-slug"
value="lumen docs"></lumen-input>
<p id="ex-input-invalid-error">Use lowercase letters, numbers, and hyphens only.</p>
</lumen-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.
pnpm add @santi020k/lumen-astropnpm add @santi020k/lumen-astrolumen add Inputlumen add Inputpnpm add @santi020k/lumen-reactpnpm add @santi020k/lumen-reactlumen add Input --target reactlumen add Input --target reactpnpm add @santi020k/lumen-elementspnpm add @santi020k/lumen-elementslumen add Input --target elementslumen add Input --target elementsAPI 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.
| Attribute | Values | Default | Description |
|---|---|---|---|
| type | HTML input type | "text" | Sets the native input type. |
| size | "default" | "sm" | "lg" | "default" | Controls the field height and font size. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |