Kewti Docs
Components

Kewti Input

A multilingual input component with Amharic transliteration, voice dictation, and controlled/uncontrolled support.

const InputExample = () => {
const [text, setText] = useState("");

return (
  <KewtiInput 
    className="w-full" 
    variant="input" 
    placeholder="Type in Amharic or English..." 
    value={text}
    showVoiceInput={true}
    onChange={(e) => setText(e.target.value)}
  />
);
};
render(<InputExample />);

Installation

npx kewti-cli add input

Usage

import { KewtiInput } from "@/kewti/ui"

Basic Input

<KewtiInput
  placeholder="Type a message..."
  onSend={(value) => console.log(value)}
/>

Textarea

<KewtiInput
  variant="textarea"
  placeholder="Write something..."
  onSend={(value) => console.log(value)}
/>

Controlled Component

const [message, setMessage] = useState("")

<KewtiInput
  value={message}
  onValueChange={setMessage}
/>

Amharic by Default

<KewtiInput  /> //Amharic Input
// for English
<KewtiInput defaultLanguage="en" />

Disable the Input

<KewtiInput disabled />

Hide VoiceInput

<KewtiInput showVoiceInput={false} />

Features

  • Toggle between Amharic and English input.
  • Real-time Amharic transliteration from Latin characters.
  • Multiple transliteration suggestions and homophone support.
  • Built-in voice dictation.
  • Supports both input and textarea variants.
  • Auto-resizing textarea.
  • Controlled and uncontrolled modes.
  • Compatible with React Hook Form and other form libraries.
  • Keyboard shortcuts for fast typing.

How to Write (Amharic Transliteration)

When Amharic mode is active, Latin keystrokes are automatically converted into Ge'ez script (Fidel).

1. Vowel Order Modifications

Type a consonant key followed by a vowel to change the Fidel order:

Fidel OrderModifying KeyExample (b + Key)Output
1st Order (G'eez)(Default / Consonant only)b
2nd Order (Ka'ib)ub + u
3rd Order (Salis)ib + i
4th Order (Rabi)ab + a
5th Order (Hamis)ieb + i + e
6th Order (Sadis)eb + e
7th Order (Sabi)ob + o

2. Consonant Mappings

KeyPrimaryAlternative Suggestions
b
c, ,
d
f
g
h, ,
j
k
l
m
n
p
q
r
s,
t, ,
v
w
x,
y
z

3. Punctuation Mappings

KeyAmharic PunctuationName
.Arat Neteb (Full Stop)
,Comma
;Semicolon
:Hulet Neteb (Colon)

4. Homophones & Phonetic Variants

Some letters in Amharic share identical or similar pronunciations. When typing these characters, KewtiInput automatically presents alternative homophones in the suggestion menu:

  • Ha variants:
  • Se variants:
  • Tse variants:
  • A variants:

Keyboard Shortcuts

ShortcutAction
SpaceAccept the selected transliteration
← → ↑ ↓Navigate transliteration suggestions
EnterAccept suggestion (when suggestions are visible)
EnterSend message (when no suggestions are visible)
Shift + EnterInsert a new line (textarea only)

Voice Dictation

Click the microphone icon to start dictation.

  • Uses the browser's Speech Recognition API.
  • Dictation language is Amharic (am-ET).
  • Speech is appended to the existing input.
  • Recording can be stopped at any time.

If speech recognition isn't supported by the browser, the microphone button is automatically hidden.


Props

PropTypeDefaultDescription
variant"input" | "textarea""input"Input variant to render.
valuestringControlled value.
onValueChange(value: string) => voidCalled whenever the value changes. Recommended for controlled state.
onChangeChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>Standard React change event.
onSend(value: string) => voidCalled when Enter is pressed (or Enter without Shift in textarea).
defaultLanguage"am" | "en""am"Initial input language.
placeholderstringPlaceholder text.
disabledbooleanfalseDisables editing, language switching, and voice input.
classNamestringAdditional classes for the outer container.
inputClassNamestringAdditional classes for the input or textarea.
styleReact.CSSPropertiesInline styles for the container.
onKeyDownKeyboardEventHandlerCustom keyboard event handler.
showVoiceInputbooleanfalseShows or hides voice input

All standard HTML input or textarea props are also supported.


Browser Support

Voice dictation relies on the browser's Speech Recognition API (SpeechRecognition or webkitSpeechRecognition).

Supported browsers include:

  • Chrome
  • Microsoft Edge
  • Other Chromium-based browsers

Browsers without speech recognition support automatically hide the microphone button.

On this page