Skip to Content
UI Components/Cupertino UI/Cupertino TextField

Cupertino TextField

Single-line iOS-style text input with customizable styling

Framework

View in WebF Go

Download WebF Go to preview this component on devices and desktop.

Installation

Install
1npm install @openwebf/react-cupertino-ui

Usage

TextField.tsx
1import { useState } from 'react';
2import { FlutterCupertinoInput } from '@openwebf/react-cupertino-ui';
3
4export function TextFieldExample() {
5  const [value, setValue] = useState('');
6
7  return (
8    <FlutterCupertinoInput
9      val={value}
10      placeholder="Enter text…"
11      clearable
12      onInput={(e) => setValue(e.detail)}
13    />
14  );
15}

API Reference

Props (React)

NameTypeDefaultDescription
valstring-Current text value.
placeholderstring-Placeholder when empty.
typestringtextKeyboard type: text/password/number/tel/email/url.
clearablebooleanfalseShow clear button while editing.
onInput(event: CustomEvent<string>) => void-Fires on value changes (`event.detail`).
onSubmit(event: CustomEvent<string>) => void-Fires on submit/done (`event.detail`).

Methods (React ref)

NameTypeDefaultDescription
focus()() => void-Focus the input.
blur()() => void-Blur the input.
clear()() => void-Clear the value (fires `clear`).
Full type definitions: npm package docs.