Files
sigpro-ui/src/components/Label.js
natxocc 600c78510a
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
change utils location
2026-04-19 17:38:49 +02:00

19 lines
647 B
JavaScript

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