Skip to content

Floating Label Input

InputWeb + NativeMIT
View in Storybook

Label sits inside the field at rest, floats up + shrinks on focus or when filled.

bun add @otfdashkit/ui

Preview

Floating Label Input
Loading Storybook preview…

Code

import { FloatingLabelInput } from '@otfdashkit/ui'

export function Example() {
  const args = {
    label: 'Email',
  }
  return (
    <div className="w-[360px]">
      <FloatingLabelInput {...args} />
    </div>
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.

Props

Props declared in the FloatingLabelInput source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
labelrequiredstringLabel that floats up when focused or filled.
errorstringInline error text shown below the input.
hintstringHelper text shown below the input when there's no error.
wrapperClassNamestringWrap the field + label + helper text in this className for layout.