Repository navigation
Description
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:
- Hook source:
packages/core/src/hooks/useInputContainer.ts - Hook doc:
packages/core/src/hooks/useInputContainer.doc.mjs - Example blocks:
packages/cli/assets/templates/blocks/components/(add a<Name>.tsx+<Name>.doc.mjspair, for example underTextInput/). Existing hook examples to copy the shape from:Theme/useThemeHookUsageandPopover/PopoverHookUsage.
Acceptance criteria:
-
A template block names
useInputContainerinexampleFor(oralsoExampleFor) 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-contractsINV28 (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, oralsoExampleForwhen 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
docs(useInputContainer): add a search field wrapper example block
Sainath-Reddy7 commentedon Nov 5, 2026
Taking this one — PR: #10139 (same shape as the merged #9938: example block + both generated route artifacts).
Sainath-Reddy7 commentedon Nov 5, 2026
Withdrawing #10139 in favor of #9619, which was opened earlier and is further along. Thanks @MannXo!
docs(useInputContainer): add a search field wrapper example block (me…