Skip to main content

StarkInput

Displays an input field for STRK/USD amount, with an option to convert between STRK and USD.

StarkInput Example

Importโ€‹

import { StarkInput } from "~~/components/scaffold-stark";

Usageโ€‹

const [starkAmount, setStarkAmount] = useState("");

<StarkInput value={starkAmount} onChange={amount => setStarkAmount(amount)} />;

Propsโ€‹

PropTypeDefault ValueDescription
valuestringundefinedYou can enter STRK quantity or USD quantity, but value will always be stored in STRK.
onChangefunctionundefinedA callback invoked when the amount in the StarkInput changes.
placeholder (optional)stringundefinedThe string that will be rendered when there is no input value.
name (optional)stringundefinedHelps identify the data being sent if StarkInput is submitted into a form.
disabled (optional)booleanfalseWhen set to true, changes input background color and border to have disabled styling.