---
title: Input hints
description: 'The keyboard, Enter key and autofill attributes that agree for a kind of value.'
order: 13
---

import { HelperResults } from '@/components/primitive-example/helper-results';
import { inputHints } from '@ecopages/radiant-ui/helpers';

# Input hints

<p class="docs-lede">The keyboard, Enter key and autofill attributes that agree for a kind of value.</p>

Reach for it for a sign-in, one-time code, search or address field that a phone fills in. The helpers are pure: no DOM at import time or in the call path, so they run on the server and in tests. Each result below is computed when the page is built, by running the call shown.

## Import

```ts
import { inputHints, type InputHintKind, type InputHints, type EnterKeyHint } from '@ecopages/radiant-ui/helpers';
```

## Hints

`inputHints(kind, { enter })` returns `inputmode`, `enterkeyhint`, `autocomplete`, `autocapitalize`, `autocorrect` and `spellcheck`, named as in HTML, for `email`, `url`, `tel`, `one-time-code`, `numeric`, `decimal`, `search`, `name`, `username`, `postal-code`, `current-password` and `new-password`. It leaves out what a kind has no value for, turns off autocorrect and spell checking, and capitalizes only `name` (by word) and `postal-code` (by character). `enter` sets the Enter key label; `search` defaults to `search`. It never sets `type`, `pattern` or validation: spread the result on the input and keep those yours.

```tsx
<RuiInput type="email" name="email" {...inputHints('email', { enter: 'next' })} />
```

<HelperResults
	rows={[
		{ code: "inputHints('email')", result: inputHints('email') },
		{ code: "inputHints('one-time-code', { enter: 'done' })", result: inputHints('one-time-code', { enter: 'done' }) },
		{ code: "inputHints('search')", result: inputHints('search') },
		{ code: "inputHints('new-password')", result: inputHints('new-password') },
	]}
/>
