Components › Components
Demos show your theme.
Progress
A native progress bar; without a value, it shows work in progress.
Usage #
tscl
@import uiProgress from './progress.tscl'
<div class="demo">
<uiProgress [value]="40" label="Upload" />
<uiProgress label="Loading" />
</div>
<style scoped>
:scope {
display: grid;
gap: 12px;
padding: 24px;
border: 1px solid var(--ui-border);
border-radius: var(--ui-radius);
background: var(--ui-bg);
color: var(--ui-fg);
}
</style>Source #
Copy it next to your components as progress.tscl.
tscl
{{-- Progress: a native <progress>. Without a value it is indeterminate (still working, amount unknown). --}}
@input value: number | null = null
@input max: number = 100
@input label: string = ''
<progress [max]="max" [value]="value" [aria-label]="label || null" data-part="progress"></progress>
<style scoped>
@layer theme, base, components, utilities;
@layer components {
:where(:scope) {
width: 100%;
height: 8px;
border: 0;
border-radius: 999px;
overflow: hidden;
background: var(--ui-muted-bg);
accent-color: var(--ui-accent);
appearance: none;
}
:where(:scope)::-webkit-progress-bar {
background: var(--ui-muted-bg);
}
:where(:scope)::-webkit-progress-value {
background: var(--ui-accent);
border-radius: 999px;
}
:where(:scope)::-moz-progress-bar {
background: var(--ui-accent);
border-radius: 999px;
}
}
</style>Styling #
- On the root:
class,style,id,aria-*anddata-*written on the tag land on its root element;classandstylemerge with its own. - Selectors:
data-partnamesprogress. - Your rules win: every rule here has zero specificity (
:where()) and sits in@layer components, so your own CSS and Tailwind utilities override it.
Needs #
- theme.css, once per project