Skip to content
Ginga UI
Ginga UI
日本語

Getting started

  • Overview
  • Quick start
  • Theme generation
  • Custom rendering
  • All components

Forms

  • Button
  • Checkbox
  • Input
  • Radio
  • Questionnaire
  • SegmentedControl
  • Select
  • ComboBox
  • NumberField
  • SearchField
  • Slider
  • Switch
  • FormControl

Display

  • Accordion
  • Alert
  • AlertDialog
  • Badge
  • CodeBlock
  • Card
  • Dialog
  • Drawer
  • Image
  • List
  • Popover
  • Menu
  • Tooltip
  • Table
  • Tab
  • Toast
  • Trace

Typography

  • Heading
  • Paragraph

Navigation

  • Anchor

Layout

  • Box

Resources

  • Changelog
  • GitHub (opens in a new tab)

Logo: Twemoji (opens in a new tab) (CC-BY 4.0)

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).