{"id":17677985,"url":"https://github.com/blazeui/blazeui","last_synced_at":"2026-02-26T06:24:32.195Z","repository":{"id":259195122,"uuid":"856846230","full_name":"blazeui/blazeui","owner":"blazeui","description":"Easy Tailwind components for Meteor Blaze","archived":false,"fork":false,"pushed_at":"2024-10-22T07:22:19.000Z","size":869,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T22:18:23.896Z","etag":null,"topics":["blaze","client","components","css","frontend","meteor","tailwind","ui","webapp"],"latest_commit_sha":null,"homepage":"https://blazeui.meteorapp.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blazeui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-13T10:12:00.000Z","updated_at":"2025-05-11T17:16:21.000Z","dependencies_parsed_at":"2024-10-23T12:01:33.321Z","dependency_job_id":null,"html_url":"https://github.com/blazeui/blazeui","commit_stats":null,"previous_names":["blazeui/blazeui"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blazeui%2Fblazeui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blazeui%2Fblazeui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blazeui%2Fblazeui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blazeui%2Fblazeui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blazeui","download_url":"https://codeload.github.com/blazeui/blazeui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253831017,"owners_count":21971009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blaze","client","components","css","frontend","meteor","tailwind","ui","webapp"],"created_at":"2024-10-24T08:03:19.105Z","updated_at":"2026-02-26T06:24:27.156Z","avatar_url":"https://github.com/blazeui.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![blazeui logo](./blazeui_wide.svg)\n\n# BlazeUI - Tailwind components for Meteor Blaze\n🔥 UI components for Meteor-Blaze and TailwindCSS 🔥\n\n\n[DEMO](https://blazeui.meteorapp.com/) | [core docs](https://blazeui.github.io/blazeui/api/core/) | [components docs](https://blazeui.github.io/blazeui/api/components/)\n| [markdown docs](https://blazeui.github.io/blazeui/api/markdown/)\n\n\u003c/div\u003e\n\n## About\n\nThis project is partially inspired by shacdn, radix-ui and headless ui and brings\na set of opinionated, yet flexibly changeable UI components on the table.\n\n- 🔥 awesome UI components out of the box\n- 🔥 simple to get started\n- 🔥 supports variants; allows for custom variants\n- 🔥 performant reactive attribute compilation\n- 🔥 register your own components\n- 🔥 builtin light/dark theme support\n\n\u003e BlazeUI is not related to https://www.blazeui.com/\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n## Table of Contents\n\n- [Getting started](#getting-started)\n  - [1. Add the package:](#1-add-the-package)\n  - [2. Install tailwind and a few other little helpers:](#2-install-tailwind-and-a-few-other-little-helpers)\n  - [3. Create config files](#3-create-config-files)\n  - [4. Import the library in your client code](#4-import-the-library-in-your-client-code)\n  - [5. Import the theme CSS](#5-import-the-theme-css)\n- [Usage](#usage)\n  - [Define custom variants](#define-custom-variants)\n  - [Register custom components](#register-custom-components)\n    - [1. Create a template](#1-create-a-template)\n- [Customizations](#customizations)\n  - [Create custom components](#create-custom-components)\n  - [Override components' default classes](#override-components-default-classes)\n  - [Share state between components](#share-state-between-components)\n- [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003csmall\u003egenerated with https://github.com/thlorenz/doctoc\u003c/small\u003e\n\n## Getting started\n\n### 1. Add the package:\n\n```shell\n$ meteor add blazeui:components\n```\n\n### 2. Install tailwind and a few other little helpers:\n\n```shell\n$ meteor npm install --save \\\n    tailwindcss \\\n    autoprefixer \\\n    postcss \\\n    postcss-load-config \\\n    class-variance-authority \\\n    tailwindcss-animate \\\n    clsx \\\n    tailwind-merge \\\n    @blazeui/theme-milkyway\n```\n\nThis looks like a lot, so let's see what these packages are for:\n\n- tailwindcss - the tailwind library\n- autoprefixer - required to \n- postcss - required to drop non-necessary css\n- postcss-load-config - required to load config from tailwind config\n- class-variance-authority - resolve variations of component styles\n- tailwindcss-animate - more animation tools for tailwind\n- clsx - assign classes with truthy/falsy values\n- tailwind-merge - deduplicate class names for components\n- @blazeui/theme-milkyway - the default blazeui theme\n\n### 3. Create config files\n\nYou need to provide a `tailwind.config.js` config file for your project.\n\nAs a staring point, you can use the config from the Milkyway theme:\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand to view the `tailwind.config.js`\u003c/summary\u003e\n\n```js\nconst { fontFamily } = require(\"tailwindcss/defaultTheme\")\nconst milkyway = require(\"@blazeui/theme-milkyway\")\n\n/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n  ...milkyway,\n  content: [\n    \"./imports/ui/**/*.{js,jsx,ts,tsx,html}\",\n    './client/*.{js,html}',\n    '.meteor/local/build/programs/web*/**/*.js',\n    './node_modules/@fortawesome/fontawesome-free/css/all.css',\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\nNext, you need a `postcss.config.js` config file. You can use this as a starter:\n\n```js\nmodule.exports = {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n  excludedMeteorPackages: []\n}\n```\n\n### 4. Import the library in your client code\n\nFor static import of all components, use:\n\n```js\nimport 'meteor/blazeui:components/all'\n```\n\nthis will instantly make all components available but\nalso increases the bundle size.\n\nIf you need to be careful about bundle size, you may use\nthe dynamic import way:\n\n```js\nconst { BlazeUI } = await import('meteor/jkuester:blazeui/core/BlazeUI.js')\nconst { Badge } = await import('meteor/jkuester:blazeui/components/badge/Badge.js')\n\nBlazeUI.register(Badge)\n```\n\n### 5. Import the theme CSS\n\nBlazeUI provides a default theme, which you can\nimport in `client/main.js` via\n\n```js\nimport '@blazeui/theme-milkyway/milkyway.css'\n```\n\nThis theme is zero config and looks great out of the box.\n\nYou also can also override the root variables\nTo do so, open your `client/main.css` (or .scss) file and provide\nthe root variables for the variants of the components:\n\n\u003cdetails\u003e\n\u003csummary\u003eExpand to view the main css file\u003c/summary\u003e\n\n```css\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n@layer base {\n    :root {\n        --background: 0 0% 100%;\n        --foreground: 222.2 47.4% 11.2%;\n\n        --muted: 210 40% 96.1%;\n        --muted-foreground: 215.4 16.3% 46.9%;\n\n        --popover: 0 0% 100%;\n        --popover-foreground: 222.2 47.4% 11.2%;\n\n        --border: 214.3 31.8% 91.4%;\n        --input: 214.3 31.8% 91.4%;\n\n        --card: 0 0% 100%;\n        --card-foreground: 222.2 47.4% 11.2%;\n\n        --primary: 222.2 47.4% 11.2%;\n        --primary-foreground: 210 40% 98%;\n\n        --secondary: 210 40% 96.1%;\n        --secondary-foreground: 222.2 47.4% 11.2%;\n\n        --accent: 210 40% 96.1%;\n        --accent-foreground: 222.2 47.4% 11.2%;\n\n        --destructive: 0 100% 50%;\n        --destructive-foreground: 210 40% 98%;\n\n        --ring: 215 20.2% 65.1%;\n\n        --radius: 0.5rem;\n    }\n\n    .dark {\n        --background: 224 71% 4%;\n        --foreground: 213 31% 91%;\n\n        --muted: 223 47% 11%;\n        --muted-foreground: 215.4 16.3% 56.9%;\n\n        --accent: 216 34% 17%;\n        --accent-foreground: 210 40% 98%;\n\n        --popover: 224 71% 4%;\n        --popover-foreground: 215 20.2% 65.1%;\n\n        --border: 216 34% 17%;\n        --input: 216 34% 17%;\n\n        --card: 224 71% 4%;\n        --card-foreground: 213 31% 91%;\n\n        --primary: 210 40% 98%;\n        --primary-foreground: 222.2 47.4% 1.2%;\n\n        --secondary: 222.2 47.4% 11.2%;\n        --secondary-foreground: 210 40% 98%;\n\n        --destructive: 0 63% 31%;\n        --destructive-foreground: 210 40% 98%;\n\n        --ring: 216 34% 17%;\n\n        --radius: 0.5rem;\n    }\n}\n\n@layer base {\n    * {\n        @apply border-border;\n    }\n    body {\n        @apply bg-background text-foreground;\n        font-feature-settings: \"rlig\" 1, \"calt\" 1;\n        font-family: Arial, Helvetica, sans-serif;\n    }\n}\n```\n\n\u003c/details\u003e\n\n## Usage\n\nAssuming your components are available you can use them by their respective names.\nEvery component allows for a content block:\n\n```handlebars\n{{#Badge id=\"main\" class=\"rounded-none\"}}\n I'm a default badge\n{{/Badge}}\n\n{{#Badge id=\"badge-1\" data-foo=\"bar\"}}\n    I'm a badge with custom attributes\n{{/Badge}}\n\n{{#Badge size=\"xl\"}}\n    I'm a badge with a custom variant!\n{{/Badge}}\n```\n\nFore more examples and recipes, view https://blazeui.meteorapp.com/components\n\n## Customizations\n\nBlazeUI is flexible at its core, enabling you fine-grained customization. \n\n### Define custom variants\n\nThe library comes with default variants for the components.\nIf that's not enough, you can easily extend variants:\n\n```js\nimport { BlazeUI, Badge } from 'meteor/jkuester:blazeui/static'\n\nBlazeUI.variants({\n  ctx: Badge,\n  type: 'size',\n  values: {\n    xs: \"text-xs\",\n    sm: \"text-sm\",\n    base: \"text-base\",\n    lg: \"text-lg p-2\",\n    xl: \"text-xl p-3\",\n  },\n  default: 'xs'\n})\n```\n\nYou can use this function also to change the `default` for an\nexisting variant or extend/override the variant itself.\n\n### Create custom components\n\nFirst, you need to have a template defined for your component:\n\n```handlebars\n\u003ctemplate name=\"Hello\"\u003e\n    \u003cdiv {{blazeui_atts}}\u003e\n        {{\u003e Template.contentBlock active=active}}\n    \u003c/div\u003e\n\u003c/template\u003e\n```\n\nIn your js, you can then register it like this:\n\n```js\nimport { ReactiveDict } from 'meteor/reactive-dict'\nimport { BlazeUI } from 'meteor/blazeui:core'\nimport './Hello.html'\n\nconst Hello = {\n  /**\n   * Required, must exactly match the name of the Template!\n   */\n  name: 'Hello',\n\n  /**\n   * Optional, the base class that is always applied.\n   * Can be overridden.\n   */\n  class: 'p-1 bg-primary text-primary-foreground transition-all ease-in-out',\n\n  /**\n   * Optional, a RactiveDict that can be used to manage internal\n   * state. You can also use a custom reactive data source as long\n   * as implements the methods of ReactiveDict (get, set, all etc.).\n   */\n  state: new ReactiveDict({ active: false }),\n\n  /**\n   * Optional function if you need to resolve attributes for the component\n   * with awareness of the state.\n   * Reactive: This method gets called, when props or state change.\n   *\n   * @param props {object} the object, returned by {Template.currentData()}\n   * @param state {object|undefined} present, when {state} is defined on the component.\n   * @param api {BlazeUI} the BlazeUI top-level api is always passed down to components.\n   * @return {{role: string, class: string}}\n   */\n  attributes ({ props, state, api }) {\n    const { class:className, ...rest } = props\n    const { merge } = api.styles()\n    const { active } = state\n\n    return  {\n      role: 'button',\n      class: merge(\n        Hello.class,\n        active ? 'text-4xl' : 'text-xs',\n        className\n      ),\n      ...rest\n    }\n  },\n  /**\n   * This is passed to the Template's `onCreated` method.\n   * Note, that state is only passed, when being defined on this\n   * component.\n   * @param state {object?}\n   */\n  onCreated ({ state }) {\n    const instance = this\n    instance.state = state\n  },\n  helpers: {\n    active() {\n      return Template.instance().state.get('active')\n    }\n  },\n  events: {\n    'click div' (e, t) {\n      // this results in 'attributes' being called right after\n      t.state.set('active', !t.state.get('active'))\n    }\n  }\n}\n\nBlazeUI.register(Hello)\n```\n\n### Override components' default classes\n\nYou can change any component's default styles by simply overriding its `class` property\nor its variants.\n\n### Share state between components\n\nBlazeUI is designed to relieve you from the burden of implementing state-sharing\nbetween components and their children.\n\nSometimes you can simply forward the state as props of the child, but\nthis quickly results in so-called \"prop-drilling\", where a re prop\nis passed down multiple levels of children.\n\nInstead you can use a context that parents share with their children.\n\nThe parent simply needs to use the `blazeui_contetx` helper to provide\nit to all children:\n\n```handlebars\n\u003ctemplate name=\"MyComponent\"\u003e\n  \u003cdiv {{blazeui_atts}}\u003e\n   {{\u003e Template.contentBlock context=(blazeui_context \"MyComponent\")}}\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003ctemplate name=\"MyComponenTrigger\"\u003e\n  \u003cbutton {{blazeui_atts}}\u003e\n    {{\u003e Template.contentBlock}}\n  \u003c/button\u003e\n\u003c/template\u003e\n```\n\nA child component can use this shared state via the `api`\nparameter in the `state` function:\n\n```js\nexport const MyComponent = {\n  name: 'MyComponent',\n  class: 'p-4 border rounded-md',\n  state: ({ instance }) =\u003e {\n    // attach state to the instance\n    // so the blazeui_context helper\n    // will pick it up.\n    // convention: it must be named \"state\"\n    // and exist as property of the instance\n    instance.state = new ReactiveDict({\n      active: false\n    })\n    return instance.state\n  },\n  attributes ({ props, state, api }) {\n    const { merge } = api.styles()\n    const active = state.get('active')\n    return {\n      data-active: active, // this also updates when children change the state\n      class: merge(MyComponent.class, props.class)\n    }\n  }\n}\n\nexport const MyComponentTrigger = {\n  name: 'MyComponentTrigger',\n  class: 'border bg-primary rounded-md font-semibold text-primary-foreground',\n  state: ({ instance, api }) =\u003e {\n    // this will automatically pick up the state from the parent\n    // no matter which level of depth this child is curently located.\n    const { useFromContext  } = api.state()\n    return useFromContext({ instance, key: 'MyComponentContext' })\n  },\n  events: {\n    'click button' (e, t) {\n      // toggle active\n      t.state.set({ active: !t.state.get('active') })\n    }\n  }\n}\n```\n\n\n\n## License\n\nMIT, see [license file](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblazeui%2Fblazeui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblazeui%2Fblazeui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblazeui%2Fblazeui/lists"}