Loading Depth Study
Preparing your workspace
A component is a reusable piece of UI with its own structure, logic, and behavior.
React applications are built from components. A component is usually a JavaScript function that returns JSX. Components can be small, such as a Button or Avatar, or larger, such as a CoursePage. Good component design keeps responsibilities clear and encourages reuse. Components should usually be named using PascalCase. A component can receive data through props and can manage its own state when necessary.
A learning dashboard can contain reusable Sidebar, CourseCard, ProgressBar, NotificationBell, and UserMenu components.
function ProgressBar({ value }) {
return (
<div>
<p>{value}% complete</p>
<progress value={value} max="100" />
</div>
);
}
export default function App() {
return <ProgressBar value={70} />;
}The page displays a progress indicator showing 70% completion.