Components
Helper

Helper

The Helper component is used to provide additional information or assistance related to a form element. It can display text, error messages, or suffix content to help users understand or interact with the form element.

Props

NameTypeDefaultDescription
childrenReactElementThe form element for which the helper content is provided.
textstring | ReactElementAdditional text or content to display alongside the form element. It can be used to provide guidance or context.
errorstring | ReactElementAn error message to display if there is an issue with the form element. It helps users understand and address errors.
suffixstring | ReactElementAdditional content to be appended to the form element. It can be used for adding icons or extra information.

Try It

import { Helper, Input } from '@kloktun/uikit'

export default function HelperExample() {
  return (
    <div className="flex flex-col gap-4">
      <Helper text="Please enter your username">
        <Input placeholder="Username" />
      </Helper>
      <Helper error="Username is required">
        <Input placeholder="Username" />
      </Helper>
      <Helper text="Enter your email" suffix="0/30">
        <Input placeholder="Email" />
      </Helper>
    </div>
  );
}