Hint
Ayuda que siempre se ve junto a un control: qué escribir y en qué formato. Un Field la escribe desde hint; suelta, dale un id y apunta el control hacia ella.
import { Hint } from '@sypnia/ui/react'
En esta página
Desde un Field y suelto
We send a POST here each time a row changes.
Every day at 03:00, in the project's time zone.
Código
import { Field, Hint, Input } from '@sypnia/ui/react';
// Usually a Field writes the hint for you. On its own, give it an id and point the control at it.
export default function Hints() {
return (
<div className="sy-stack">
<Field label="Webhook URL" hint="We send a POST here each time a row changes."><Input machine placeholder="https://" /></Field>
<div className="sy-field">
<label className="sy-field__label" htmlFor="cron">Schedule</label>
<Input id="cron" machine defaultValue="0 3 * * *" aria-describedby="cron-hint" />
<Hint id="cron-hint">Every day at 03:00, in the project's time zone.</Hint>
</div>
</div>
);
} Cuándo usarlo
Úsalo cuando
- Formatos y límites: «En minúsculas, por ejemplo orders».
- Consecuencias: «No se puede cambiar después».
No lo uses cuando
- Repetir la etiqueta con otras palabras.
- Explicaciones largas: enlaza a la documentación.
Para todos
- Únela con
aria-describedby, así se lee después de la etiqueta. - Sigue visible mientras la persona escribe, a diferencia de un texto de ejemplo.
Props
| Hint | Tipo | Por defecto |
|---|---|---|
id | string |