Files
sigpro-ui/src/components/Label.js
natxocc 59e6d972a8
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
changed to new functions
2026-04-22 12:06:34 +02:00

19 lines
637 B
JavaScript

// components/Label.js
import { h } from "sigpro";
import { ui, val } from "../utils.js";
export const Label = (props) => {
const { children, value, floating = false, class: className, ...rest } = props;
if (floating) {
return h("label", { class: ui("floating-label", className), ...rest }, () => [
typeof children === 'function' ? children() : children,
value ? h("span", {}, val(value)) : null
]);
}
return h("label", { class: ui("label", className), ...rest }, () => [
value ? h("span", { class: "label-text" }, val(value)) : null,
typeof children === 'function' ? children() : children
]);
};