@cyrene/ui
v1.0.0-beta.0
Published
EXPERIMENTAL — API may change in 1.x minors (see docs/architecture/adr-002-publish-set.md). Themeable UI component library for Cyrene
Readme
@cyrene/ui Standard & Architecture
This package provides a reference implementation for high-performance UI components built on Cyrene.
Core Principles
- Signal-First: Internal state must use
createSignalordefineStore. Avoid localletvariables for reactive values. - Prop Transparency: Components should spread
...restprops to root elements when appropriate to allow for standard HTML attributes (id, class, etc.). - Zero-Wrapper Policy: Use
<Fragment>or return raw DOM nodes to avoid "Div Soup" and maintain layout performance. - Themeable: All styles should use CSS Variables defined in
@cyrene/ui/theme.
Example Component Template
import { h, onMount } from "@cyrene/core";
import { useStyles } from "../hooks/useStyles";
export function StandardButton(props) {
const { label, onClick, ...rest } = props;
const styles = useStyles();
onMount(() => {
console.log("Button mounted");
});
return () => (
h("button", {
class: styles.button,
onclick: onClick,
...rest
}, label)
);
}CSS Strategy
We use Scoped Styles generated by the Cyrene Compiler. Avoid global CSS whenever possible.
Tokens are managed via ThemeProvider.
