CSS Artart-componentsimplemented3 demos

ArtGeminiInput

ArtGeminiInput renders the ArtGeminiInput CSS-art scene as a reusable React component.

Import@duskmoon-dev/art-components
1API sections
17documented props
1behavior scenarios
Key API
sizestylevaluedefaultValueonChangeplaceholder

Usage

When to use

  • Use it when a page needs a reusable DuskMoon visual asset rendered from CSS rather than an image.
  • Keep it decorative unless the illustration carries information that must be announced.

Implementation notes

StylesheetImport @duskmoon-dev/art-components/styles.css once before rendering art components.
StateStart with default props for static examples, then switch to controlled props when state must be shared.
SizingUse the size prop and CSS custom properties to adapt the scene without replacing markup.
Native textareaAuto-growth uses field-sizing: content with rows=1 by default. Name the textarea through textareaProps or an associated label. Actions are consumer-owned; use button props for callbacks or an explicit submit type. Parent disabled disables the field and both buttons.

Features

CSS-art wrapper

Renders the matching @duskmoon-dev/css-art scene through a typed React component.

Accessible decoration

Defaults to decorative output while allowing aria labels and roles when the scene carries meaning.

Primary API surface

ArtGeminiInput is most often configured through `size`, `style`, `value`, `defaultValue`.

Covered behavior

Renders textarea controls and action buttons

Feature Demos

Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.

Preview

Basic usage

authored

Import ArtGeminiInput and the art component stylesheet before rendering the CSS art scene.

Source
import "@duskmoon-dev/art-components/styles.css";
import { ArtGeminiInput } from "@duskmoon-dev/art-components";

export function Example() {
  return (<ArtGeminiInput
  size="lg"
  placeholder="Ask DuskMoon"
  defaultValue="Pure CSS art"
  textareaProps={{ "aria-label": "Message" }}
/>);
}
Preview

Accessible art

authored

Use ArtGeminiInput as decorative output by default, or pass accessible labeling when the scene is meaningful.

Source
import "@duskmoon-dev/art-components/styles.css";
import { ArtGeminiInput } from "@duskmoon-dev/art-components";

export function AccessibleArt() {
  return (<ArtGeminiInput
  size="lg"
  placeholder="Ask DuskMoon"
  defaultValue="Pure CSS art"
  textareaProps={{ "aria-label": "Message" }}
  decorative={false}
  aria-label="Art Gemini Input illustration"
/>);
}
Preview

No message submitted

Native form and field states

authored

Type multiline text and use Send to submit the native form. Read-only text stays selectable; the disabled field and actions cannot activate.

Source
import { useState } from "react";
import { ArtGeminiInput } from "@duskmoon-dev/art-components";
import "@duskmoon-dev/art-components/styles.css";

export function MessageForm() {
  const [value, setValue] = useState("");
  const [submitted, setSubmitted] = useState("");
  const [count, setCount] = useState(0);
  return (
    <>
      <form onSubmit={(event) => {
        event.preventDefault();
        setSubmitted(value);
        setCount((previous) => previous + 1);
      }}>
        <ArtGeminiInput size="sm" name="message" required
          value={value} onChange={(event) => setValue(event.currentTarget.value)}
          textareaProps={{ "aria-label": "Message to send" }}
          afterButtonProps={{ type: "submit" }} />
        <p role="status">Submitted {count}: {submitted}</p>
      </form>
      <ArtGeminiInput size="sm" readOnly after={null}
        beforeButtonProps={{ "aria-label": "Read-only add", disabled: true }}
        defaultValue="Read-only example"
        textareaProps={{ "aria-label": "Read-only message" }} />
      <ArtGeminiInput size="sm" disabled defaultValue="Disabled example"
        textareaProps={{ "aria-label": "Disabled message" }}
        beforeButtonProps={{ "aria-label": "Disabled add" }}
        afterButtonProps={{ "aria-label": "Disabled send" }} />
    </>
  );
}

API

The API reference below lists every parsed exported type or interface for ArtGeminiInput. Start with `size`, `style`, `value`, `defaultValue` for common usage.

Types: packages/art-components/src/index.tsxScenarios: packages/art-components/tests/art-components.test.tsx
ArtGeminiInputPropsinterface extends Omit< BaseArtProps, "children" | "onChange" | "defaultValue" | "style" >
PropTypeRequiredDescription
sizeArtSizeNosize configures ArtGeminiInput.
styleArtStyleNostyle configures ArtGeminiInput.
valueComponentProps<"textarea">["value"]Novalue configures ArtGeminiInput.
defaultValueComponentProps<"textarea">["defaultValue"]NodefaultValue configures ArtGeminiInput.
onChangeComponentProps<"textarea">["onChange"]NoonChange configures ArtGeminiInput.
placeholderstringNoplaceholder configures ArtGeminiInput.
namestringNoname configures ArtGeminiInput.
rowsnumberNorows configures ArtGeminiInput.
disabledbooleanNodisabled configures ArtGeminiInput.
readOnlybooleanNoreadOnly configures ArtGeminiInput.
requiredbooleanNorequired configures ArtGeminiInput.
fieldClassNamestringNofieldClassName configures ArtGeminiInput.
textareaPropsOmit<NotextareaProps configures ArtGeminiInput.
beforeReactNodeNobefore configures ArtGeminiInput.
afterReactNodeNoafter configures ArtGeminiInput.
beforeButtonPropsGeminiButtonPropsNobeforeButtonProps configures ArtGeminiInput.
afterButtonPropsGeminiButtonPropsNoafterButtonProps configures ArtGeminiInput.