Progress
Progress primitive
Install
npx ui8kit add progressPulls in: kit-progress, recipes, utils
Preview
Code
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add progress<!-- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. -->
<!-- Progress: Progress + recipe progress. -->
<script lang="ts">
import type { ComponentProps, Snippet } from "svelte";
import Prim from "../kit/ui/progress/Progress.svelte";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
let { "size": v_size, "variant": v_variant, class: className, children, ...rest }: ComponentProps<typeof Prim> & { "size"?: string | number; "variant"?: string | number; class?: string; children?: Snippet } = $props();
const cls = $derived(cn(rc("progress", { "size": v_size, "variant": v_variant }), className));
</script>
<Prim class={cls} {...rest}>{@render children?.()}</Prim>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdnnpx ui8kit add progress// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
import type { ComponentProps } from "react";
import { Progress as Prim } from "../kit/ui/progress/progress";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
export type ProgressProps = Omit<ComponentProps<typeof Prim>, "tag" | "size" | "variant"> & { "size"?: string | number; "variant"?: string | number; className?: string };
/** Progress: Progress + recipe progress. */
export function Progress({ "size": v_size, "variant": v_variant, className, ...rest }: ProgressProps) {
return <Prim className={cn(rc("progress", { "size": v_size, "variant": v_variant }), className)} {...rest} />;
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdnnpx ui8kit add progress<!-- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. -->
<!-- Progress: Progress + recipe progress. -->
<script setup lang="ts">
import { computed, useAttrs } from "vue";
import Prim from "../kit/ui/progress/Progress.vue";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
defineOptions({ name: "Progress", inheritAttrs: false });
const props = defineProps<{ "size"?: string | number; "variant"?: string | number }>();
const attrs = useAttrs();
const rest = computed(() => {
const { class: _class, ...r } = attrs;
return r;
});
const cls = computed(() => cn(rc("progress", { "size": props["size"], "variant": props["variant"] }), attrs.class as string | undefined));
const tagValue = computed(() => "");
</script>
<template>
<Prim :class="cls" v-bind="rest"><slot /></Prim>
</template>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdnnpx ui8kit add progress// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
import { splitProps, type ComponentProps } from "solid-js";
import { Progress as Prim } from "../kit/ui/progress/progress.solid";
import { cn } from "../kit/utils";
import { rc } from "./recipes";
export type ProgressProps = Omit<ComponentProps<typeof Prim>, "tag" | "class" | "className" | "size" | "variant"> & { "size"?: string | number; "variant"?: string | number; class?: string; className?: string };
/** Progress: Progress + recipe progress. */
export function Progress(props: ProgressProps) {
const [local, rest] = splitProps(props, ["size", "variant", "class", "className"]);
return <Prim class={cn(rc("progress", { "size": local["size"], "variant": local["variant"] }), local.class ?? local.className)} {...rest} />;
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdnnpx ui8kit add progress// Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
package compose
import "github.com/ui8kit/codegen/generated/templ/ui/progress"
// ProgressProps: Progress: Progress + recipe progress.
type ProgressProps struct {
Size string
Variant string
progress.ProgressProps
}
func progressInner(p ProgressProps) progress.ProgressProps {
in := p.ProgressProps
in.Class = Join(Rc("progress", map[string]string{"size": p.Size, "variant": p.Variant}), p.ProgressProps.Class)
return in
}
// Progress renders Progress with the composition classes.
templ Progress(p ProgressProps) {
@progress.Progress(progressInner(p)) {
{ children... }
}
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdnnpx ui8kit add progress{# Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. #}
{# Progress: Progress + recipe progress. Params: size, variant, class, attrs + the params of Progress. #}
{% include 'ui/progress/Progress.html.twig' with compose_props('Progress', _context) only %}Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdnnpx ui8kit add progress{* Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT. *}
{* Progress: Progress + recipe progress. *}
{parameters
string $class = '',
?string $value = null,
?string $max = null,
?string $ariaLabel = null,
array $attrs = [],
string $children = '',
$size = null,
$variant = null,
}
{include '../ui/progress/Progress.latte', ...\CodegenX\Compose\Latte\Compose::props('Progress', ['class' => $class, 'value' => $value, 'max' => $max, 'ariaLabel' => $ariaLabel, 'attrs' => $attrs, 'children' => $children, 'size' => $size, 'variant' => $variant])}Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdnnpx ui8kit add progress{#- Code generated by packages/kit-compose/src/build.ts from src/map.ts + variants/. DO NOT EDIT.
Progress: Progress + recipe progress. Props (p): Size, Variant, Class, Attrs + the props of Progress. -#}
{%- with p = compose_props('Progress', p) %}{% include 'ui/progress/progress.html.j2' %}{% endwith %}Props
Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.
Progress renders a native progress element; children are the fallback text.
No props.