Input
A text input field. Supports various types (text, email, password, etc.).
View in Storybook (opens in a new tab)
Installation
import { Input } from "@ginga-ui/core";Basic usage
A simple text input field.
input.tsx
input.module.css
import { Input } from "@ginga-ui/core";
import styles from "./input.module.css";
export function BasicExample() {
return (
<Input
className={styles.basicInput}
aria-label="Text"
placeholder="Enter text..."
/>
);
}Input types
Input fields of various types, such as email, password, and number.
input.tsx
input.module.css
import { Input } from "@ginga-ui/core";
import styles from "./input.module.css";
export function TypesExample() {
return (
<div className={styles.typeList}>
<Input type="text" aria-label="Text" placeholder="Text" />
<Input
type="email"
aria-label="Email address"
placeholder="Email address"
/>
<Input type="password" aria-label="Password" placeholder="Password" />
<Input type="number" aria-label="Number" placeholder="Number" />
</div>
);
}Disabled
A disabled input field.
input.tsx
input.module.css
import { Input } from "@ginga-ui/core";
import styles from "./input.module.css";
export function DisabledExample() {
return (
<Input
className={styles.disabledInput}
disabled
aria-label="Disabled input field"
placeholder="Disabled input field"
/>
);
}With initial value
An input field with an initial value.
input.tsx
input.module.css
import { Input } from "@ginga-ui/core";
import styles from "./input.module.css";
export function WithValueExample() {
return (
<Input
className={styles.valueInput}
aria-label="Default value example"
defaultValue="This field has a default value"
/>
);
}Props
Input
Accepts the props of React Aria's Input (opens in a new tab).