UI
@domphy/ui is the official patch library for Domphy.
It provides ready-made patches for common native elements such as buttons, dialogs, menus, tabs, inputs, and typography primitives.
A patch does not create a new element. It merges styles, attributes, hooks, and behavior into an existing element.
import { button, tooltip } from "@domphy/ui"
const submitButton = {
button: "Submit",
$: [
button({ color: "primary" }),
tooltip({ content: "Submit the form" }),
],
}
What UI Adds
@domphy/ui sits on top of @domphy/core and @domphy/theme.
@domphy/coreprovides the object model, rendering, and lifecycle@domphy/themeprovides tone, size, and spacing helpers@domphy/uipackages those pieces into reusable patches
Most patches are:
- native-element first
- context-aware with
dataToneanddataSize - small in prop surface
- customizable without rewriting the whole patch
Read Next
- Color And Tone for practical
role / tone / colorchoices in the UI layer - Dimension for sizing rules and patch size families
- Customization for how to override and adapt existing patches
- Creation for writing new patches correctly
- Patches when you want the catalog
If you already know the system and just want a component, jump straight to the Patches group in the sidebar.