Docs Components Primitives

LoadingIndicator

React example follows below.
ts
const loadingIndicatorFixture = {
id: "loading-indicator",
sizes: ["md", "lg"],
labelledSize: "lg",
labelledText: "Resolving tokens",
} satisfies {
id: string;
sizes: Array<"sm" | "md" | "lg">;
labelledSize: "sm" | "md" | "lg";
labelledText: string;
};
import { LoadingIndicator } from "@grassroot/ui-react";
export default function LoadingIndicatorDemo() {
return (
<div>
{loadingIndicatorFixture.sizes.map((size) => (
<LoadingIndicator key={size} size={size} />
))}
<LoadingIndicator
size={loadingIndicatorFixture.labelledSize}
label={loadingIndicatorFixture.labelledText}
/>
</div>
);
}
ts
<script setup lang="ts">
const loadingIndicatorFixture = {
id: "loading-indicator",
sizes: ["md", "lg"],
labelledSize: "lg",
labelledText: "Resolving tokens",
} satisfies {
id: string;
sizes: Array<"sm" | "md" | "lg">;
labelledSize: "sm" | "md" | "lg";
labelledText: string;
};
import { LoadingIndicator } from "@grassroot/ui-vue";
</script>
<template>
<div>
<LoadingIndicator v-for="size in loadingIndicatorFixture.sizes" :key="size" :size="size" />
<LoadingIndicator
:size="loadingIndicatorFixture.labelledSize"
:label="loadingIndicatorFixture.labelledText"
/>
</div>
</template>
ts
import { Component } from "@angular/core";
const loadingIndicatorFixture = {
id: "loading-indicator",
sizes: ["md", "lg"],
labelledSize: "lg",
labelledText: "Resolving tokens",
} satisfies {
id: string;
sizes: Array<"sm" | "md" | "lg">;
labelledSize: "sm" | "md" | "lg";
labelledText: string;
};
import { GrassrootLoadingIndicator } from "@grassroot/ui-angular";
@Component({
selector: "app-loading-indicator-demo",
standalone: true,
imports: [GrassrootLoadingIndicator],
template: `
<div>
@for (size of fixture.sizes; track size) {
<grassroot-loading-indicator [size]="size" />
}
<grassroot-loading-indicator [size]="fixture.labelledSize" [label]="fixture.labelledText" />
</div>
`,
})
export class LoadingIndicatorDemoComponent {
protected readonly fixture = loadingIndicatorFixture;
}
export default LoadingIndicatorDemoComponent;
ts
<script lang="ts">
import { LoadingIndicator } from "@grassroot/ui-svelte";
const loadingIndicatorFixture = {
id: "loading-indicator",
sizes: ["md", "lg"],
labelledSize: "lg",
labelledText: "Resolving tokens",
} satisfies {
id: string;
sizes: Array<"sm" | "md" | "lg">;
labelledSize: "sm" | "md" | "lg";
labelledText: string;
};
</script>
<div>
{#each loadingIndicatorFixture.sizes as size (size)}<LoadingIndicator
{size}
/>{/each}<LoadingIndicator
size={loadingIndicatorFixture.labelledSize}
label={loadingIndicatorFixture.labelledText}
/>
</div>
ts
/** @jsxImportSource solid-js */
import { For } from "solid-js";
const loadingIndicatorFixture = {
id: "loading-indicator",
sizes: ["md", "lg"],
labelledSize: "lg",
labelledText: "Resolving tokens",
} satisfies {
id: string;
sizes: Array<"sm" | "md" | "lg">;
labelledSize: "sm" | "md" | "lg";
labelledText: string;
};
import { LoadingIndicator } from "@grassroot/ui-solid";
export default function LoadingIndicatorDemo() {
return (
<div>
<For each={loadingIndicatorFixture.sizes}>{(size) => <LoadingIndicator size={size} />}</For>
<LoadingIndicator
size={loadingIndicatorFixture.labelledSize}
label={loadingIndicatorFixture.labelledText}
/>
</div>
);
}

Installation

API Reference

Import

import { LoadingIndicator } from "@grassroot/ui-react";

Props

Prop
Type
Default
Requirement
Description
size
"sm" | "md" | "lg" | undefined
"md"
optional
Diameter in px.
label
string | undefined
"Loading"
optional
Accessible label for assistive tech.
Prop
size
Type
"sm" | "md" | "lg" | undefined
Default
"md"
Requirement
optional
Description
Diameter in px.
Prop
label
Type
string | undefined
Default
"Loading"
Requirement
optional
Description
Accessible label for assistive tech.

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { LoadingIndicator } from "@grassroot/ui-vue";

Props

Prop
Type
Default
Requirement
size
"sm" | "md" | "lg" | undefined
"md"
optional
label
string | undefined
"Loading"
optional
Prop
size
Type
"sm" | "md" | "lg" | undefined
Default
"md"
Requirement
optional
Prop
label
Type
string | undefined
Default
"Loading"
Requirement
optional

Import

import { Component } from "@angular/core";
import { GrassrootLoadingIndicator } from "@grassroot/ui-angular";

Props

Prop
Type
Default
Requirement
size
"sm" | "md" | "lg"
"md"
optional
label
string
"Loading"
optional
Prop
size
Type
"sm" | "md" | "lg"
Default
"md"
Requirement
optional
Prop
label
Type
string
Default
"Loading"
Requirement
optional

Import

import { LoadingIndicator } from "@grassroot/ui-svelte";

Props

Prop
Type
Default
Requirement
size
"sm" | "md" | "lg"
"md"
optional
label
string
"Loading"
optional
Prop
size
Type
"sm" | "md" | "lg"
Default
"md"
Requirement
optional
Prop
label
Type
string
Default
"Loading"
Requirement
optional

Import

import { For } from "solid-js";
import { LoadingIndicator } from "@grassroot/ui-solid";

Props

Prop
Type
Default
Requirement
size
"sm" | "md" | "lg"
optional
label
string
optional
className
string
optional
Prop
size
Type
"sm" | "md" | "lg"
Default
Requirement
optional
Prop
label
Type
string
Default
Requirement
optional
Prop
className
Type
string
Default
Requirement
optional

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.