Files
Dare2/components_/InputClear.js
2026-03-25 02:03:59 +01:00

18 lines
421 B
JavaScript

import { $, html } from "sigpro";
$.component(
"c-input-clear",
(props) => {
return html`
<button
type="button"
class="btn btn-ghost btn-xs btn-circle opacity-50 hover:opacity-100"
?hidden=${() => !props.value() || props.value().length === 0}
@click=${() => props.value("")}>
<span class="icon-[lucide--x] size-4"></span>
</button>
`;
},
["value"],
);