날짜 입력
Calendar를 팝오버로 열어 날짜를 선택하는 입력 컴포넌트입니다.
DateInput은 입력 형태의 트리거, Popover, Calendar를 결합합니다. 날짜를 선택하면 값이 갱신되며, 달력은 바깥을 클릭하거나 Escape를 누를 때 닫힙니다. mode="range"를 지정하면 두 달을 나란히 보며 시작일과 종료일을 고를 수 있습니다.
Selected: 11/13/2026
Overview
Machine-readable contract from Component Spec.
component: date-inputexport: DateInputversion: 1tokens.visual: inputattributes: data-refineui=date-input
Anatomy
| Part | data-refineui |
|---|---|
| root | date-input |
Variants
| Axis | Values |
|---|---|
| mode | single, range |
States
| Scope | Category | Values |
|---|---|---|
| component | pseudo | focus-visible |
| component | component | selection: placeholder, value |
| component | component | validation: error, success |
| component | availability | disabled |
| component | environment | dir |
Accessibility
| Slot | Element | Native | Labeling |
|---|---|---|---|
| date-input | button | true | accessibleName: required |
Keyboard
| Key | Action | Native |
|---|---|---|
| Enter | activate | true |
| Space | activate | true |
Focus
| Section | Property | Value |
|---|---|---|
| visual | required | true |
| visual | selector | :focus-visible |
Layout
| Property | Value |
|---|---|
| direction | logical |
| rtl | true |
Variant
Select a recipe variant — preview and Recipe → Tokens update together.
Selected: 11/13/2026
Recipe → Tokens
Slot bindings for mode="single" — declared in DateInput/style → Input tokens.
| Slot | Variant | Property | Trace | Semantic | Light → foundation | Dark → foundation | Recipe class |
|---|---|---|---|---|---|---|---|
| root | — | text | input.text | foregroundPrimary | primaryBlack | neutralWhite | text-refineui-alias-foreground-primary placeholder:text-refineui-alias-foreground-placeholder |
| root | — | placeholder | input.placeholder | foregroundPlaceholder | neutral450 | neutral500 | placeholder:text-refineui-alias-foreground-placeholder |
| root | — | background | input.background | backgroundPrimary | neutralWhite | neutral900 | bg-refineui-alias-background-primary |
| root | — | disabledBackground | input.disabledBackground | backgroundSurfaceDisabled | neutral150 | neutral850 | bg-refineui-alias-background-surface-disabled |
| root | — | border.default | input.border.default | borderDefault | neutral300 | neutral650 | border-refineui-thin border-refineui-alias-border-default |
| root | — | border.focus | input.border.focus | borderFocus | neutral750 | neutral350 | border-refineui-thin border-refineui-alias-border-strong |
| root | — | border.error | input.border.error | borderError | red500 | red500 | border-refineui-thin border-refineui-alias-border-error |
| root | — | border.success | input.border.success | borderSuccess | green500 | green500 | border-refineui-thin border-refineui-alias-border-success |
| root | — | border.disabled | input.border.disabled | borderDisabled | neutral250 | neutral700 | border-refineui-thin border-refineui-alias-border-disabled |
Component token trace
All paths in token-trace-v2.json prefixed with input.
| Trace | Semantic | Light foundation | Dark foundation | Light | Dark |
|---|---|---|---|---|---|
| input.background | backgroundPrimary | neutralWhite | neutral900 | #FFFFFF | #1A1A1A |
| input.border.default | borderDefault | neutral300 | neutral650 | #DBDBDB | #5B5B5B |
| input.border.disabled | borderDisabled | neutral250 | neutral700 | #E0E0E0 | #404040 |
| input.border.error | borderError | red500 | red500 | #FF6969 | #FF6969 |
| input.border.focus | borderFocus | neutral750 | neutral350 | #333333 | #D8D8D8 |
| input.border.success | borderSuccess | green500 | green500 | #26B12D | #26B12D |
| input.disabledBackground | backgroundSurfaceDisabled | neutral150 | neutral850 | #F0F0F0 | #222222 |
| input.placeholder | foregroundPlaceholder | neutral450 | neutral500 | #BBBBBB | #A4A4A4 |
| input.text | foregroundPrimary | primaryBlack | neutralWhite | #212121 | #FFFFFF |
npm install @refineui/react @refineui/tokens yarn add @refineui/react @refineui/tokens pnpm add @refineui/react @refineui/tokens bun add @refineui/react @refineui/tokens 사용법
섹션 제목: “사용법”import { useState } from "react";import { DateInput } from "@refineui/react"; const [date, setDate] = useState<Date>(); <DateInput value={date} onValueChange={setDate} placeholder="배송 날짜 선택" locale="ko-KR" weekStartsOn={1} fullWidth/>; 비제어 방식에는 defaultValue를 사용하세요. size="xs" | "sm" | "md" | "lg" | "xl"는 Input과 같은 컨트롤 높이, 여백, 타이포그래피를 사용하며, 상위 Field의 크기도 상속합니다. Input처럼 error, success, disabled 상태를 전달할 수 있습니다.
API 레퍼런스
섹션 제목: “API 레퍼런스”| Prop | Default | Type | Description |
|---|---|---|---|
| mode | "single" | "single" | "range" | 단일 날짜 또는 두 달에 걸친 시작/종료 범위를 선택합니다. |
| value | — | Date | 제어형 선택 날짜입니다. |
| defaultValue | — | Date | 비제어 방식의 초기 날짜입니다. |
| onValueChange | — | (value: Date) => void | 날짜 선택 후 호출됩니다. |
| rangeStart / rangeEnd | — | Date | 제어형 범위입니다 (range 모드). |
| defaultRangeStart / defaultRangeEnd | — | Date | 비제어 range 모드의 초기 범위입니다. |
| onRangeChange | — | (start?: Date, end?: Date) => void | 범위가 바뀔 때 호출됩니다. 두 번째 날짜를 고르기 전까지 end는 undefined입니다. |
| placeholder | "Select date" / "Select date range" | string | 날짜를 선택하기 전 표시할 문구입니다. |
| locale | 브라우저 locale | string | 선택 날짜 표시에 사용할 locale입니다. |
| weekStartsOn | 0 | 0 | 1 | 일요일 또는 월요일부터 한 주를 시작합니다. |
| size | "lg" | "xs" | "sm" | "md" | "lg" | "xl" | Input과 동일한 컨트롤 크기입니다. |
| fullWidth | false | boolean | 트리거가 컨테이너 너비를 채우도록 합니다. |
| error / success / disabled | false | boolean | 입력 상태와 사용 가능 여부입니다. |