mirror of
https://github.com/home-assistant/frontend.git
synced 2025-10-06 18:29:42 +00:00
64 lines
2.0 KiB
TypeScript
64 lines
2.0 KiB
TypeScript
import type { TemplateResult } from "lit";
|
|
import { html, css, LitElement } from "lit";
|
|
import { customElement, property } from "lit/decorators";
|
|
import "../../../../src/components/ha-bar";
|
|
import "../../../../src/components/ha-card";
|
|
import "../../../../src/components/ha-circular-progress";
|
|
import "@material/web/progress/circular-progress";
|
|
import type { HomeAssistant } from "../../../../src/types";
|
|
|
|
@customElement("demo-components-ha-circular-progress")
|
|
export class DemoHaCircularProgress extends LitElement {
|
|
@property({ attribute: false }) hass!: HomeAssistant;
|
|
|
|
protected render(): TemplateResult {
|
|
return html`<ha-card header="Basic circular progress">
|
|
<div class="card-content">
|
|
<ha-circular-progress indeterminate></ha-circular-progress></div
|
|
></ha-card>
|
|
<ha-card header="Different circular progress sizes">
|
|
<div class="card-content">
|
|
<ha-circular-progress
|
|
indeterminate
|
|
size="tiny"
|
|
></ha-circular-progress>
|
|
<ha-circular-progress
|
|
indeterminate
|
|
size="small"
|
|
></ha-circular-progress>
|
|
<ha-circular-progress
|
|
indeterminate
|
|
size="medium"
|
|
></ha-circular-progress>
|
|
<ha-circular-progress
|
|
indeterminate
|
|
size="large"
|
|
></ha-circular-progress></div
|
|
></ha-card>
|
|
<ha-card header="Circular progress with an aria-label">
|
|
<div class="card-content">
|
|
<ha-circular-progress
|
|
indeterminate
|
|
aria-label="Doing something..."
|
|
></ha-circular-progress>
|
|
<ha-circular-progress
|
|
indeterminate
|
|
.ariaLabel=${"Doing something..."}
|
|
></ha-circular-progress></div
|
|
></ha-card>`;
|
|
}
|
|
|
|
static styles = css`
|
|
ha-card {
|
|
max-width: 600px;
|
|
margin: 24px auto;
|
|
}
|
|
`;
|
|
}
|
|
|
|
declare global {
|
|
interface HTMLElementTagNameMap {
|
|
"demo-components-ha-circular-progress": DemoHaCircularProgress;
|
|
}
|
|
}
|