Develop ultra fast with Prismane 🎉

NativeDateField

NativeDateField displays a native date field.

Import

import { NativeDateField } from "@prismane/core";

Usage

<NativeDateField name="date" />

Controlled

function Demo() {
  const [value, setValue] = useState("");

  return (
    <NativeDateField
      name="date"
      value={value}
      onChange={(e) => setValue(e.target.value)}
    />
  );
}

With Icon

<NativeDateField name="date" icon={<GearSix />} />

With Addon

<NativeDateField
  name="date"
  addons={<Field.Addon position="left">Date</Field.Addon>}
/>

NativeDateField Variants

function Demo() {
  const [date, setDate] = useState("");

  return (
    <>
      <NativeDateField
        variant="outlined"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
      <NativeDateField
        variant="filled"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
      <NativeDateField
        variant="underlined"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
      <NativeDateField
        variant="unstyled"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
    </>
  );
}

NativeDateField Sizes

function Demo() {
  const [date, setDate] = useState("");

  return (
    <Flex direction="column" gap={fr(2)}>
      <NativeDateField
        size="xs"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
      <NativeDateField
        size="sm"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
      <NativeDateField
        size="base"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
      <NativeDateField
        size="md"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(e.target.value)}
      />
      <NativeDateField
        size="lg"
        placeholder="Default Field"
        label="Default Field:"
        value={date}
        onChange={(e) => setDate(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.