wagerfield/onno is one of the design-focused repositories TopGit tracks, currently at 107 stars, written primarily in TypeScript. Tiny (596B) utility for composing class variants using clsx
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Define variant names and the classes to be applied to them using the variants config option:
const button = onno({
variants: {
// This `boolean` variant is applied when `disabled === true`
disabled: "access denied", // Classes can be defined as a `string`
// This `boolean` variant is applied when `hidden === true`
hidden: ["barely", "visible"], // Classes can also be a `string[]`
// This `enum` variant is applied when `size === "sm" || "lg"`
size: {
sm: ["pretty", "small"], // Here we are using a `string[]` class list
lg: "really large", // ...and here we are using a `string` class list
},
},
})
button() // ""
button({}) // ""
button({ size: "sm" }) // "pretty small"
button({ disabled: true }) // "access denied"
button({ hidden: true, size: "lg" }) // "barely visible really large"
Note that you cannot use className as a variant key since it is reserved for applying additional classes:
const button = onno({
variants: {
className: "not allowed", // Error: "className" cannot be used as a variant name
},
})
Defaults
Default variants can be set using the defaults config option:
Note that inferred OnnoProps also include the className option alongside the variants:
export type ButtonClassNameType = ButtonProps["className"] // clsx.ClassValue
By default all variants inferred by OnnoProps are optional. To require one or more variants, pass a union of required variant keys as the second argument to the OnnoProps generic type:
import { onno, type OnnoProps } from "onno"
export const button = onno({
variants: {
disabled: "not allowed",
intent: {
primary: "super punchy",
secondary: "quite bland",
},
size: {
sm: "pretty small",
lg: "really large",
},
},
})
// Require both the `intent` and `size` variants
export type ButtonProps = OnnoProps<typeof button, "intent" | "size">
// Error: Property 'intent' is missing in type '{ size: "md" }'
const buttonProps: ButtonProps = { size: "md" }
Tailwind CSS
If you are using the Tailwind CSS VSCode extension, add the following configuration to your workspace .vscode/settings.json file:
The most recent commit recorded on wagerfield/onno was 2.7 years ago, based on the GitHub push timestamp. The repository has 0 forks — one of the better signals of community interest.
How many stars does wagerfield/onno have?
wagerfield/onno has 107 GitHub stars — refresh the page for the live number, or check github.com/wagerfield/onno. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is wagerfield/onno written in?
wagerfield/onno is written primarily in TypeScript. GitHub's language field is based on the largest share of bytes in the default branch.
What license does wagerfield/onno use?
wagerfield/onno is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
What topics is wagerfield/onno associated with?
GitHub's repository topics for wagerfield/onno: "clsx", "css", "tailwindcss", "theme". TopGit's editorial category is UI / UX.
Where can I see wagerfield/onno in action?
The project maintains a homepage at https://onnojs.com. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about wagerfield/onno?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/wagerfield/onno is the definitive source.
Read full README in the tab above.
Want a second opinion on onno?
Ask an AI that can read this page — one click and you get its take on onno.