Skip to main content

Loader

import { Loader } from "@/components";

👉 View in Storybook


Usage​

Basic Loader​

<Loader loading={true} size="md" />

Loader with Text​

<Loader loading={true} size="md" text="Loading data..." />

Small and Large Loaders​

<Loader loading={true} size="sm" text="Small Loader" />
<Loader loading={true} size="lg" text="Large Loader" />

Conditional Rendering​

The Loader will not render if loading is set to false:

<Loader loading={false} />

Props​

PropTypeDefaultDescription
loadingbooleanfalseControls whether the loader is visible.
textstring (optional)undefinedText displayed beside the loader icon.
iconstring (optional)"tawuniya-small"Icon displayed inside the loader.
size"sm" | "md" | "lg" (from loaderVariants)"md"Defines the size of the loader.
classNamestring (optional)undefinedCustom Tailwind CSS classes to override default styles.

Usage​

Basic Loader​

<Loader loading={true} size="md" />

Loader with Text​

<Loader loading={true} size="md" text="Loading data..." />

Custom Icon​

<Loader
loading={true}
size="md"
icon="custom-loader-icon"
text="Loading data..."
/>