DateInput
DateInput 구성 요소에 대한 문서 및 예. 범위 선택 및 직관적인 달력 상호 작용에 대한 지원이 포함되어 있습니다.
사용 시기
- 입력 상자를 클릭하면 팝업 달력에서 날짜를 선택할 수 있습니다.
기본
기본 사용 사례. 사용자는 패널에서 날짜를 선택하거나 입력할 수 있습니다.
astro
---
import DateInput from '@/components/data-entry/DateInput.astro';
---
<DateInput id="start-date" label="Single Date" placeholder="Select a date..." class="max-w-xs" /> 범위 선택기
range 속성으로 범위 선택기 유형을 설정합니다.
astro
---
import DateInput from '@/components/data-entry/DateInput.astro';
---
<DateInput id="date-range" label="Date Range" placeholder="Select a date range..." range={true} class="max-w-xs" /> 비활성화됨
DatePicker의 비활성화된 상태입니다.
astro
---
import DateInput from '@/components/data-entry/DateInput.astro';
---
<DateInput id="dt-disabled" label="Disabled" placeholder="Disabled..." disabled class="max-w-xs" /> 상태
오류가 있는 DatePicker에 상태를 추가합니다. 오류 또는 경고일 수 있습니다.
Please select a valid date
astro
---
import DateInput from '@/components/data-entry/DateInput.astro';
---
<DateInput id="dt-error" label="Error State" placeholder="Select a date..." error="Please select a valid date" class="max-w-xs" /> 사용자 지정
사용자 지정 렌더링 및 형식 지정.
astro
---
import DateInput from '@/components/data-entry/DateInput.astro';
---
<DateInput
id="dt-custom"
label="Custom Locale & Icon"
placeholder="Sélectionnez une date..."
locale="fr-FR"
icon="MapPin"
class="max-w-xs"
/> 속성
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| range | Enables date range selection mode. | boolean | false |
| locale | The locale used for calendar rendering and date formatting. | string | '' |
| icon | The icon to display inside the input. | IconName | 'Calendar' |
| label | Label text shown above the input. | string | '' |
| error | Indicates an error state or displays an error message | string | boolean | |
| success | Indicates a success state or displays a success message | string | boolean | |
| disabled | Disables the component | boolean | false |