PinField
PinField displays a field that handles pins, allowing for easily typing in number combinations.Import
import { PinField } from "@prismane/core";
Usage
function Demo() { const [value, setValue] = useState(""); const handleChange = (e) => setValue(e.target.value); return <PinField value={value} onChange={handleChange} />; }
PinField Variants
function Demo() { const [pin, setPin] = useState(""); return ( <> <PinField variant="outlined" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> <PinField variant="filled" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> <PinField variant="underlined" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> <PinField variant="unstyled" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> </> ); }
PinField Sizes
function Demo() { const [pin, setPin] = useState(""); return ( <Flex direction="column" gap={fr(2)}> <PinField size="xs" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> <PinField size="sm" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> <PinField size="base" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> <PinField size="md" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> <PinField size="lg" placeholder="Default Field" label="Default Field:" value={pin} onChange={(e) => setPin(e.target.value)} /> </Flex> ); }
API
Please refer to the documentation below for a comprehensive overview of all the available props and classes for the mentioned components.
- -
PinField