changed to new functions
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s

This commit is contained in:
2026-04-22 12:06:34 +02:00
parent 5a5f593025
commit 59e6d972a8
125 changed files with 1934 additions and 2015 deletions

View File

@@ -39,7 +39,7 @@ Input supports all **daisyUI Input classes**:
</div>
```js
const { Input, Mount } = window;
const { Input, mount } = window;
const BasicDemo = () => {
const name = $("");
@@ -49,7 +49,7 @@ const BasicDemo = () => {
oninput: (e) => name(e.target.value)
});
};
Mount(BasicDemo, "#demo-basic");
mount(BasicDemo, "#demo-basic");
```
### With Icon
@@ -64,13 +64,13 @@ Wrap the input inside a `Div` with class `input` and add an icon as a sibling.
</div>
```js
const { InputLabel, Div, Icon, Mount } = window;
const { InputLabel, Div, Icon, mount } = window;
const IconDemo = () => {
const email = $("");
return Div({ class: "input input-bordered flex items-center gap-2" }, [
Icon("✉️"),
Tag("input", {
h("input", {
class: "grow",
type: "email",
value: email,
@@ -79,7 +79,7 @@ const IconDemo = () => {
})
]);
};
Mount(IconDemo, "#demo-icon");
mount(IconDemo, "#demo-icon");
```
### Password with Toggle
@@ -92,14 +92,14 @@ Mount(IconDemo, "#demo-icon");
</div>
```js
const { Input, Div, Icon, Swap, Mount } = window;
const { Input, Div, Icon, Swap, mount } = window;
const PasswordDemo = () => {
const password = $("");
const visible = $(false);
return Div({ class: "input input-bordered flex items-center gap-2" }, [
Icon("icon-[lucide--lock]"),
Tag("input", {
h("input", {
type: () => (visible() ? "text" : "password"),
value: password,
placeholder: "Password",
@@ -114,7 +114,7 @@ const PasswordDemo = () => {
})
]);
};
Mount(PasswordDemo, "#demo-password");
mount(PasswordDemo, "#demo-password");
```
### With Floating Label
@@ -129,7 +129,7 @@ Use a wrapper `Div` with class `floating-label`.
</div>
```js
const { Input, Div, Span, Mount } = window;
const { Input, Div, Span, mount } = window;
const LabelDemo = () => {
const email = $("");
@@ -143,7 +143,7 @@ const LabelDemo = () => {
})
]);
};
Mount(LabelDemo, "#demo-label");
mount(LabelDemo, "#demo-label");
```
### With Tooltip
@@ -158,7 +158,7 @@ Wrap the input with `Tooltip` component.
</div>
```js
const { Input, Tooltip, Mount } = window;
const { Input, Tooltip, mount } = window;
const TooltipDemo = () => {
const username = $("");
@@ -170,7 +170,7 @@ const TooltipDemo = () => {
})
]);
};
Mount(TooltipDemo, "#demo-tooltip");
mount(TooltipDemo, "#demo-tooltip");
```
### Error State
@@ -185,13 +185,13 @@ Add `input-error` class and show a validation message.
</div>
```js
const { Input, Div, Mount } = window;
const { Input, Div, mount } = window;
const ErrorDemo = () => {
const email = $("");
const isValid = () => email().includes("@");
return Div({ class: "flex flex-col gap-2" }, [
Tag("input", {
h("input", {
type: "email",
class: () => `input input-bordered ${email() && !isValid() ? "input-error" : ""}`,
value: email,
@@ -201,7 +201,7 @@ const ErrorDemo = () => {
() => email() && !isValid() ? Div({ class: "text-error text-sm" }, "Enter a valid email") : null
]);
};
Mount(ErrorDemo, "#demo-error");
mount(ErrorDemo, "#demo-error");
```
### Disabled State
@@ -214,12 +214,12 @@ Mount(ErrorDemo, "#demo-error");
</div>
```js
const { Input, Mount } = window;
const { Input, mount } = window;
const DisabledDemo = () => {
return Input({ value: "john.doe", disabled: true });
};
Mount(DisabledDemo, "#demo-disabled");
mount(DisabledDemo, "#demo-disabled");
```
### All Variants
@@ -232,7 +232,7 @@ Mount(DisabledDemo, "#demo-disabled");
</div>
```js
const { Input, Div, Mount } = window;
const { Input, Div, mount } = window;
const VariantsDemo = () => {
const text = $("");
@@ -250,5 +250,5 @@ const VariantsDemo = () => {
Input({ type: "date", value: $("2024-01-01") })
]);
};
Mount(VariantsDemo, "#demo-variants");
mount(VariantsDemo, "#demo-variants");
```