¥Progress
显示指示任务完成进度的指示器,通常以进度条的形式显示。
import * as React from "react";import { Progress } from "radix-ui";import "./styles.css";const ProgressDemo = () => {const [progress, setProgress] = React.useState(13);React.useEffect(() => {const timer = setTimeout(() => setProgress(66), 500);return () => clearTimeout(timer);}, []);return (<Progress.Root className="ProgressRoot" value={progress}><Progress.Indicator className="ProgressIndicator" style={{ transform: `translateX(-${100 - progress}%)` }} /></Progress.Root>);};export default ProgressDemo;
Provides context for assistive technology to read the progress of a task.
¥Installation
从命令行安装组件。
¥Install the component from your command line.
¥Anatomy
导入所有部分并将它们组合在一起。
¥Import all parts and piece them together.
¥Accessibility
遵循 progressbar
角色要求。
¥Adheres to the progressbar
role requirements.
¥API Reference
¥Root
包含所有进度条部分。
¥Contains all of the progress parts.
¥Indicator
用于可视化显示进度。它还使辅助技术能够轻松获取进展。
¥Used to show the progress visually. It also makes progress accessible to assistive technologies.