@domphy/ui
v0.1.41
Published
Domphy UI
Readme
@domphy/ui
Ready-made patches for Domphy.
@domphy/ui includes @domphy/core and @domphy/theme, and provides patches for buttons, inputs, dialogs, menus, tabs, tooltips, and more.
Install
npm install @domphy/uiQuick Example
import { ElementNode } from "@domphy/core"
import { themeApply } from "@domphy/theme"
import { button, tooltip } from "@domphy/ui"
themeApply()
const App = {
div: [
{
button: "Save",
$: [
button({ color: "primary" }),
tooltip({ content: "Save changes" }),
],
},
],
dataTheme: "light",
}
new ElementNode(App).render(document.body)What A Patch Is
A patch returns a PartialElement and merges into a native element.
It does not create a wrapper component or own a separate DOM boundary.
{
button: "Save",
$: [button()],
}Customization
Most customization should happen in one of these ways:
- pass patch props
- use
dataToneordataSizecontext - override inline on the element
- copy the patch into your app and create your own variant
CDN
<script src="https://unpkg.com/@domphy/ui/dist/core-theme-ui.global.js"></script>
<script>
const { core, theme, ui } = Domphy
</script>