Project Setup
Set up shared styles, imports, and optional themes for your Zenos app.
Once your first component works, set up the defaults that every page will share. This guide covers where styles belong, how to import components, and what to check before building more screens.
Complete Installation first. Keep the files your framework created and add the settings you need below.
Start with shared styles and imports, then check them in your app.
- Load shared stylesYour index.css
Tailwind + Zenos CSS → index.css
Load the package styles once, followed by your own rules.
- Use public importsYour components
UI package → components, layouts, and hooks
Use the package root. Installed recipes come from your local files.
- Check a real pageYour browser + terminal
Styles + keyboard + theme + build
Try the controls, check any theme changes, and build your app.
1. Keep styles in one place
Section titled “1. Keep styles in one place”Use index.css as the global stylesheet and keep all package CSS imports there. Your framework entry or root layout imports only this local file. The Installation examples show the path for each framework.
For Tailwind CSS v4, start src/index.css with these imports, then add shared rules and theme overrides:
@import "tailwindcss";@import "@zentara-co/zenos-ui/tailwind.css"; body { margin: 0; background: var(--background-default); color: var(--text-default);}Load that file once from your application entry:
import "./index.css";Remove any direct Zenos CSS import from .tsx files. Loading CSS globally also styles menus and dialogs that appear outside the component that opened them.
My app does not use Tailwind CSS
Replace the two Tailwind imports with the compiled stylesheet import at the top of index.css:
@import "@zentara-co/zenos-ui/styles.css";Keep your shared rules below that import. Tailwind is optional with this setup.
Troubleshoot IntelliSense
Section titled “Troubleshoot IntelliSense”Tailwind CSS IntelliSense discovers a Tailwind v4 project through a CSS file that imports Tailwind. Zenos’ tailwind.css entrypoint also exposes its theme and custom variants to the compiler and editor. Importing the compiled styles.css from a .tsx file does not provide that metadata.
If Zenos suggestions still do not appear:
- Confirm that
tailwindcssv4 is installed and configured in the application workspace, and the Tailwind CSS IntelliSense extension is enabled. - Confirm that
index.csscontains both@import "tailwindcss"and@import "@zentara-co/zenos-ui/tailwind.css", and that your application entry loads this CSS file. - In VS Code or Cursor, run Tailwind CSS: Show Output and confirm that
index.csswas detected as the project entrypoint.
If automatic detection fails, set the CSS entrypoint explicitly:
{ "tailwindCSS.experimental.configFile": "src/index.css"}Use your framework’s actual index.css path. For multiple entrypoints, follow the Tailwind CSS IntelliSense configuration guide. You do not need to add Zenos package source to Tailwind’s scan paths. Do not load the compiled styles.css and Tailwind-native tailwind.css entrypoints together.
2. Use the public imports
Section titled “2. Use the public imports”Components, layout helpers, hooks, and types come from the package root:
import { Button, Stack, type ButtonProps } from "@zentara-co/zenos-ui";Your editor can suggest props and report mistakes using the included TypeScript declarations. Use the component’s docs to see its supported props. Package src paths and repository files are private implementation details.
Recipes, such as Calendar or Data Table, are different: the CLI copies their source into your app. Import a recipe from the local path printed by the installer. See the CLI guide when you need one.
Bundle behavior
Section titled “Bundle behavior”Zenos publishes unbundled ES modules so your bundler can remove components and utilities that your application does not import. The JavaScript modules are side-effect free. Use named imports from the package root:
import { Button } from "@zentara-co/zenos-ui";CSS files are intentionally marked as side effects so an explicit stylesheet import is preserved. Load either the compiled @zentara-co/zenos-ui/styles.css entrypoint or the Tailwind-native @zentara-co/zenos-ui/tailwind.css entrypoint once; do not load both. Importing a component does not inject styles or change global browser state.
Check my TypeScript settings
Keep your framework’s generated configuration. In the config used by your app, enable strict checking if it is not already enabled:
{ "compilerOptions": { "strict": true }}Merge this setting into the existing file. Preserve its extends, JSX settings, environment types, aliases, plugins, and project references. Some projects keep app settings in tsconfig.app.json or an inherited config.
Use the React 19 types that match your React installation. Modern framework templates already configure module resolution and JSX; a Zenos-specific TypeScript preset is not needed.
Where should I put my own files?
For a small Vite app, start with the files you use:
src/├── App.tsx Your app's main component├── components/ Components shared across pages├── features/ Forms, data, and UI for each feature├── index.css Global styles and theme overrides└── main.tsx Existing React entry and index.css importKeep your framework’s route folders if it has them. Add folders when code needs a home; an empty folder for every possible concern is unnecessary.
In a monorepo, install Zenos in the app package that renders React. Keep feature-specific code beside that feature. See File Organization as your app grows.
Optional: customize the theme
Section titled “Optional: customize the theme”Zenos works with its default styles. Open the sections below if your app needs a theme switch or custom colors.
Add a light and dark theme switch
For a client-rendered React app, add this component to your header or settings page:
import { ThemeToggleButton } from "@zentara-co/zenos-ui"; export function ThemeControl() { return <ThemeToggleButton />;}The button changes the document theme and saves the preference under the storage key theme. Switch it, reload the page, and confirm the selected theme stays active.
For server-rendered apps, keep the root layout on the server and put interactive controls inside the framework’s client boundary. Apply the initial theme in the document head before the page is painted to avoid a flash. Follow Dark mode for the initialization script and useTheme for server-rendering considerations.
Use the same storage key in that script and every theme control. If your app already has a theme provider, pass its theme and onThemeChange values to ThemeToggleButton. That provider should apply the theme to the document and manage persistence.
Change the app’s colors
Add token overrides to the index.css file that loads after Zenos. A token is a named CSS variable used by multiple components:
:root { --background-default: #ffffff; --text-default: #171717; --border-default: rgb(23 23 23 / 10%);} :root.dark,:root[data-theme="dark"] { --background-default: #101010; --text-default: #f5f5f5; --border-default: rgb(255 255 255 / 12%);}These variables change the page colors used in step 1 and components that use those same roles. Other surfaces and button variants have their own tokens. See Theme customization and Colors for the full set.
Use tokens for changes shared across your app, and className or style for a local adjustment. Check text, borders, and focus indicators in both themes after changing colors.
Add an editable recipe
Preview a Calendar installation from your app’s folder. The CLI runs directly without a project installation:
pnpm dlx @zentara-co/zenos-cli add calendar --dry-runThe preview reports the planned changes without modifying your app. When the destination and dependencies look right, run:
pnpm dlx @zentara-co/zenos-cli add calendarThe CLI copies editable source and installs the recipe’s extra dependencies. Use the local import path in its output. See Calendar for examples and the CLI guide for destination and overwrite options.
3. Check a real page
Section titled “3. Check a real page”Use the Quick Start form or a page you have already built:
- Open the page: buttons, inputs, and page text should be styled.
- Use the keyboard: Tab between controls and check that focus is visible. Open a Select or Dialog and confirm its popup is styled too.
- If you added dark mode: switch themes and reload. The selected theme should remain active; check a second tab if you use shared persistence.
- Run your app’s checks: type-check and build with the scripts in your
package.json. If you installed a recipe, render it from its local path too.
If styles are missing, check the global import first. If a theme resets, check the storage key and which provider owns it. If an import fails, check the package installation and the documented export.
Continue with File Organization to organize your feature code, or Layout composition to build your next screen.