Meet Frontfriend.Your brand. Your rules. Your agents, connected.Explore what’s new
DocumentationDateinput

Dateinput

Lets users enter a date through individual date fields.

Interactive preview

Rendered from the shared Frontfriend stories with React Base, the same preview Studio shows. Styling comes from your Design System; the code below is native to Reka UI.

Installation

Complete project setup first. Your configuration must select vue/reka and include your Design System ID.

pnpm exec frontfriend download date-input -f vue --primitive reka

Review dependencies reported by the downloader and keep your source changes in version control.

Usage

<script setup lang="ts">
import { DateInput } from "@/components/ui/date-input";

const args = {
  "value": new Date(2026, 8, 22),
  "date": "2026-09-22",
} satisfies Partial<
  InstanceType<typeof DateInput> extends { $props: infer Props } ? Props : {}
> &
  Record<string, unknown>;
</script>

<template>
  <DateInput
    :model-value="new Date(args.date + 'T12:00:00')"
    @update:model-value="
      (next) => {
        if (next instanceof Date) args.date = next.toISOString().slice(0, 10);
      }
    "
  />
</template>

Props API

PropTypeRequiredDescription
valueDate | DateRangeNo
onChange(date: Date | DateRange) => voidYes
targetedValue"start" | "end"No

Behavior

  • Validate complete dates before emitting.
  • Arrow keys increment or decrement the active segment.
  • Left and right navigation advances between segments.

Examples

Default

<script setup lang="ts">
import { ref } from "vue";
import { DateInput } from "@/components/ui/date-input";

const args = {

} satisfies Partial<
  InstanceType<typeof DateInput> extends { $props: infer Props } ? Props : {}
> &
  Record<string, unknown>;
const value = ref(new Date());
</script>

<template>
  <DateInput v-model="value" />
</template>

With Value

<script setup lang="ts">
import { DateInput } from "@/components/ui/date-input";
import { reactive } from "vue";

const args = reactive(
  {
    "value": new Date(2026, 8, 22),
  } satisfies Partial<
    InstanceType<typeof DateInput> extends { $props: infer Props } ? Props : {}
  > &
    Record<string, unknown>,
);
</script>

<template>
  <DateInput v-model="args.value" />
</template>

Range

<script setup lang="ts">
import { DateInput } from "@/components/ui/date-input";
import { reactive } from "vue";

const args = reactive(
  {
    "value": { from: new Date(2026, 8, 1), to: new Date(2026, 8, 14) },
  } satisfies Partial<
    InstanceType<typeof DateInput> extends { $props: infer Props } ? Props : {}
  > &
    Record<string, unknown>,
);
</script>

<template>
  <div class="flex gap-2">
    <DateInput v-model="args.value" targeted-value="start" /><DateInput
      v-model="args.value"
      targeted-value="end"
    />
  </div>
</template>

API reference

Frontfriend-owned props. Native HTML and inherited primitive props remain documented by Reka UI.

Prop Type Default Description
class HTMLAttributes["class"] —
format DateInputFormat —
locale string —
modelValue DateInputValue —
targetedValue DateInputTarget —

Configuration determines the actual classes and available styling hooks. See Theming & component configuration before introducing a repeated local override.