Forms
Input
Captures short text, email, password, search, or numeric values.
01
See it and copy it
Framework example
Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
Use lowercase letters, numbers, and hyphens only.
Framework usage
Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens andui-* class contract.---
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" visualSize="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" visualSize="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" visualSize="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" visualSize="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" visualSize="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" visualSize="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>02
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 | number | native default | Sets the native input width in characters. |
| visualSize, visual-size | "default" | "sm" | "lg" | "default" | Controls field height and font size. Use visualSize in Astro/React and visual-size in Elements. |
| 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. |