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 |