Standard scale
Page title · 28 px
Section · 22 px
Subsection · 18 px
Body text · 16 px
Small print · 87.5% of the parent’s font sizenano-ux is an opinionated UI kit built with React and Tailwind CSS.
Set your theme once with CSS variables,
then use it across HTML elements and React components.
@import "nano-ux/theme.css";
:root {
--color-brand: var(--theme-lime);
--font-family: Georgia, serif;
}import { createRoot } from "react-dom/client";
import { Button } from "nano-ux";
const App = () => <Button>Save</Button>;
createRoot(document.getElementById("root")).render(<App />);Adjust the controls to preview changes across the site. Copy the CSS into your stylesheet after importing nano-ux/theme.css.
:root {
--color-brand: initial;
--font-family: "Montserrat Variable", system-ui, sans-serif;
--tracking: 0em;
--spacing: 0.25rem;
--radius-control: 0.375rem;
--radius-card: 0.625rem;
}Choose the primary color. To switch between light and dark themes, press Shift + T or double clickdouble tap the page background.
The nano-ux theme styles HTML elements automatically.
h1 for the page title.h2 for sections.h3 for subsections.p for body text.Apply typo-lg to a container for larger body text.
Standard scale
Body text · 16 px
Small print · 87.5% of the parent’s font sizeLarge scale with .typo-lg
Body text · 17 px
Small print · 87.5% of the parent’s font sizeSet the font size and line height for body text. Use --content-spacing to set the gap after a text block when another element follows it.
:root {
--body-size: 1.125rem;
--body-line-height: 1.6;
--content-spacing: 0.75em;
}Add heading-hero to an h1 to scale its size with the viewport between 3rem and 5rem.
Add text-box-trim to trim space above the first line and below the last line in supporting browsers. You can use both classes on the same heading.
Apply prose to a paragraph or its container to limit its width to 60ch. This keeps long lines easier to read on wide screens.
<h1 class="heading-hero text-box-trim">Welcome</h1>
<p class="prose">A short introduction to the project.</p>Press each button to see the toast or dialog
arccometorbitring-inring-outedge-travelface-scaninfinityOpen this page on a computer to view the dashboard.