Get @meonode/ui up and running in your React project. This guide covers installation, setup, and your first component.
While @meonode/ui supports JavaScript, TypeScript is strongly recommended for full autocomplete and type safety.
Install @meonode/ui with your preferred package manager:
npm install @meonode/ui react react-dom
yarn add @meonode/ui react react-dom
This installs the core library along with React peer dependencies.
Configure your application entry point to use MeoNode's rendering system. The render() function from
@meonode/ui/client mounts your component tree to the DOM.
Example: src/index.ts
import { StrictMode } from 'react' import { Node, render } from '@meonode/ui/client' import { Wrapper } from '@src/components/Wrapper' import Routes from '@src/routes' import '@src/assets/global.css' // Compose your app with context providers, theming, routing const App = Node(StrictMode, { children: Wrapper({ children: Routes() }), }) // Mount to DOM render(App, document.getElementById('root')!)
Node(StrictMode, { children: ... })
Creates a MeoNode wrapper around React's StrictMode. The children prop embeds your app component tree.
render(App, rootElement)
Mounts the node tree to the specified DOM element. This replaces ReactDOM.createRoot() and handles the rendering
lifecycle.
Create a simple UI to verify your setup:
Example: src/App.ts
import { Div, H1, Button } from '@meonode/ui' import { useEffect } from 'react' const App = () => { useEffect(() => { console.log('App mounted') }, []) return Div({ padding: '40px', backgroundColor: 'whitesmoke', minHeight: '100dvh', minWidth: '100dvw', children: [ H1('Hello, MeoNode!', { fontSize: '2.5rem', color: 'rebeccapurple', marginBottom: '20px', }), Button('Click Me', { padding: '12px 24px', backgroundColor: 'dodgerblue', color: 'white', borderRadius: '8px', cursor: 'pointer', onClick: () => alert('MeoNode is awesome!'), }), ], }).render() } export default App
Run your dev server—you should see a purple heading and a blue button. Click it to confirm event handlers work.
With @meonode/ui installed, explore these guides to build production UIs:
On this page