nano-ux
GitHub
Theme: Dark

nano-uxWrite less.Ship more.

nano-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.

npm install nano-ux
src/index.css
@import "nano-ux/theme.css";

:root {
  --color-brand: var(--theme-lime);
  --font-family: Georgia, serif;
}
src/index.tsx
import { createRoot } from "react-dom/client";
import { Button } from "nano-ux";

const App = () => <Button>Save</Button>;

createRoot(document.getElementById("root")).render(<App />);

Customize the theme

Adjust the controls to preview changes across the site. Copy the CSS into your stylesheet after importing nano-ux/theme.css.

0em
0.25rem
0.375rem
0.625rem
: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;
}

Colors

Choose the primary color. To switch between light and dark themes, press Shift + T or double click the page background.

Typography

The nano-ux theme styles HTML elements automatically.

  • Use h1 for the page title.
  • Use h2 for sections.
  • Use h3 for subsections.
  • Use p for body text.

Apply typo-lg to a container for larger body text.

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 size

Large scale with .typo-lg

Page title · 48–64 px

Section · 32–48 px

Subsection · 24–32 px

Body text · 17 px

Small print · 87.5% of the parent’s font size

Customize body text

Set 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;
}

Typography utilities

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>

Form

Form data (JSON)
{
  "full_name": "",
  "gender": "",
  "email": "",
  "password": "",
  "birth_date": "",
  "interests": [],
  "bio": "",
  "volume": 50,
  "accept_terms": false,
  "notifications": false
}

Feedback

Open the confirmation dialog

Press each button to see the toast or dialog

  • arc
  • comet
  • orbit
  • ring-in
  • ring-out
  • edge-travel
  • face-scan
  • infinity

Confirm action

Do you want to proceed?

Dashboard

Open this page on a computer to view the dashboard.