Progress
Base UI Progress の progressbar semantics を使用します。有効な max と value を正規化し、value が未指定または無効な場合は indeterminate 状態を公開します。
@neumorphism-ui/progressプレビュー
Registry ビルド82%
テーマトークン12 / 16
データを待機中—
インストール
インストール: progress
npx shadcn@latest add @neumorphism-ui/progressCLI が npm 依存関係、base token、utils、コンポーネントソースを順番に処理します。
この Registry を初めて使う場合は、先に namespace の設定 を完了してください。
使い方
Import
Progress の import コード
import { Progress } from "@/components/ui/progress"Example
Progress の使用コード
<div className="grid gap-2">
<div id="upload-label" className="flex justify-between">
<span>ファイルのアップロード</span>
<span>72%</span>
</div>
<Progress value={72} max={100} aria-labelledby="upload-label" />
</div>API リファレンス
| コンポーネント | プロパティ | 型 | デフォルト | 説明 |
|---|---|---|---|---|
Progress | value | number | null | null | 0 から max の間に正規化される現在の進捗値です。 |
Progress | max | number | 100 | 0より大きい全体範囲です。無効な値の場合は100を使用します。 |
Progress | aria-label / aria-labelledby | string | — | 進行中のタスクを表すアクセシブルな名前です。 |
Progress | getValueLabel | (value, max) => string | — | 数値以外の説明が必要な場合に aria-valuetext を生成します。 |
アクセシビリティ
- 01
Progress には File upload のようにタスクを説明する aria-label または aria-labelledby が必要です。
- 02
表示中の percentage は progressbar と自動的には関連付かないため、label を明示的に関連付けてください。
- 03
null value は indeterminate 状態を表すため、完了 percentage のテキストを併記しないでください。