Motoko UI Released — Explore the components
Motoko UI

Input

A text field with Motoko surface styles, hover and focus borders.

Installation

pnpm dlx shadcn@latest add @motokoui/input

Usage

import { Search } from "lucide-react"
 
import { Input } from "@/components/ui/input"
 
export default function Example() {
  return (
    <Input
      label="Search"
      placeholder="Search…"
      icon={<Search />}
      classNameInput="max-w-sm"
      classNameLabel="text-base"
    />
  )
}

Props

PropTypeDescription
iconReact.ReactNodeLeading icon (left)
labelstringLabel above the field
minLengthnumberMinimum text length
maxLengthnumberMaximum text length
valuestringControlled value
placeholderstringPlaceholder text
disabledbooleanDisables the field
namestringForm field name
classNamestringClasses on the container
classNameInputstringClasses on the <input>
classNameLabelstringClasses on the <label>
onChangeChangeEventHandler<HTMLInputElement>Value change (for controlled value)