Skip to content

docs(useInputContainer): add a minimal live example #9568

Closed

Description

@cixzhang

What: useInputContainer — Makes an input wrapper clickable: a click on a non-interactive part (an icon, the padding, a status indicator) focuses the inner input, while nested buttons and links keep their own behavior.

A good example shows: A custom search field wrapper with a leading search icon, padding, and a trailing Clear button. Clicking the icon or the padding puts focus in the input; clicking Clear empties the field without the wrapper taking over the click.

Where:

Acceptance criteria:

  • A template block names useInputContainer in exampleFor (or alsoExampleFor) and renders in the Examples section of the hook's docsite page.

  • The hook visibly drives the behavior: removing the hook call breaks what the example shows. Minimal code; no unrelated UI or styling.

  • Meets the rule architecture:knowledge-contracts INV28 (docs/architecture/knowledge-contracts.md), quoted here:

    INV28 — Every public hook has a minimal, runnable example that
    demonstrates it.
    A public hook is a hook that a package's committed API
    report lists. Its documentation includes at least one realistic, runnable
    example: a live template block that names the hook as its example target
    (exampleFor, or alsoExampleFor when the block also serves another page).
    The example:

    • shows the hook inside a component solving the use case its docs state;
    • imports the package's own code only through its public entry points;
    • covers the hook's main parameters and return values;
    • passes the docs build;
    • gets its visible behavior from the hook itself, so removing the hook breaks
      what the example shows; and
    • is minimal: only the code needed to show the use case, with no unrelated UI
      or styling.

    How a docs page selects and orders its example blocks belongs to
    architecture:template-authoring. A public hook without a conforming example
    is a docs gap, tracked as an issue in the repository's issue queue (DEC-16).

  • If the example adds a sandbox or docsite route, register it in the route list so the build passes.

Good first issue: start with CONTRIBUTING.md. For orientation, run astryx docs and astryx component --list from the repo root (the CLI is node packages/cli/clients/cli/bin/astryx.mjs). The hook's own tests next to its source show how it is called.

Filed by an AI agent on behalf of the maintainer, as part of a docs-coverage sweep.

Activity

  1. added a commit that references this issue on Nov 3, 2026
    c5aac90
  2. Sainath-Reddy7 commented on Nov 5, 2026

    @Sainath-Reddy7
    Contributor

    Taking this one — PR: #10139 (same shape as the merged #9938: example block + both generated route artifacts).

  3. Sainath-Reddy7 commented on Nov 5, 2026

    @Sainath-Reddy7
    Contributor

    Withdrawing #10139 in favor of #9619, which was opened earlier and is further along. Thanks @MannXo!

  4. added a commit that references this issue on Nov 5, 2026
    7b87e12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions