RepositoryTypeScriptCNChina
SylarLong

SylarLong/react-iztro

⭐A react component based on iztro to generate an astrolabe of Zi Wei Dou Shu. 基于iztro实现的紫微斗数星盘React组件。

536stars
112forks
2issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: astrolabe

#1 Repository of the week

1
TINIX TRENDING·Topic: natal-chart

#1 Repository of the week

1
TINIX TRENDING·Topic: ziwei

#1 Repository of the week

📦 react-iztro

基于 iztro 实现的react组件,用于生成一张紫微斗数星盘。

react component of iztro used to generate an astrolabe of Zi Wei Dou Shu.

npm npm GitHub GitHub code size in bytes Package Quality


功能

  • 展示完整紫微斗数星盘

    包含所有 主星,辅星,杂耀,四化,神煞,流耀 以及星耀的 亮度。高亮显示重要的星耀,比如 桃花星,解神,禄存 和 天马。

  • 合理的星耀分布

    用不同的颜色和字号来将 星耀,宫名,宫干 等分区域显示,解盘一目了然,直击重点。

  • 清晰的运限指示

    在宫位中明显的标示出 大限、小限、流年、流月、流日、流时 所在宫位,点击运限指示按钮以后会显示重排后的运限宫名以及运限四化,更加方便的使用叠宫技巧解盘。

  • 流耀显示

    展示出各个流派都需要的 流耀,可自行选择自己熟悉的流耀进行解盘。

  • 三方四正指示线

    在中宫会显示 三方四正 指示线,点击运限时指示线的指向会动态跟随选中的最小那个运限流动,比如同时选择 流年 和 流月,指示线会跟随 流月。

  • 强大的动态运限

    在 中宫 里,除了显示基本信息和三方四正线以外,还加入了可以调整运限的按钮组,可以非常方便的移动各个维度的运限。

  • 实用的飞星展示

    点击宫干,可以看到宫干飞化出去的四化(以星耀背景色表示,红色:禄,蓝色:权,绿色:科,黑色:忌)。宫干有自化的时候会在星耀前面显示一条代表四化的色条。

  • 简单易用的组件

    零配置快速集成到你的页面中,对于集成几乎没有学习成本。你可以根据自己的页面风格自行调整样式,或控制各个元素的显示与隐藏(通过覆盖默认样式)。

集成到页面中的界面如下图所示。你也可以直接访问官方的 紫微派 - 紫微斗数在线排盘 查看效果。

react-iztro

如果你觉得该组件对你有用,希望给个⭐️⭐️鼓励一下。

安装

npm install react-iztro -S

当然你也可以使用 yarn

yarn add react-iztro

使用

import {Iztrolabe} from "react-iztro"

function App() {
  return (
    <div className="App" style={{ width: 1024, margin: '50px auto', boxShadow: '0 0 25px rgba(0,0,0,0.25)'}}>
      <Iztrolabe 
        birthday="2003-10-12" 
        birthTime={1} 
        birthdayType="solar" 
        gender="male" 
        horoscopeDate={new Date()} // 新增参数,设置运限日期【可选,默认为当前时间】
        horoscopeHour={1}  // 新增参数,设置流时时辰的索引【可选,默认会获取 horoscopeDate 时间】
      />
    </div>
  );
}

export default App;

克隆到本地

如果你想将代码克隆到本地查看或者修改代码,可以fork本仓库到你自己的仓库里,然后用以下步骤进行

  1. 克隆代码
git clone https://github.com/SylarLong/react-iztro.git
  1. 安装依赖
npm install

或者

yarn
  1. 启动

    npm run storybook
    

    或者

    yarn storybook
    
  2. 预览

    打开浏览器,输入 http://localhost:6006 即可预览。

贡献

如果你想对本程序进行贡献,可以 fork 本仓库到你的仓库里进行改进,完成开发或者修复以后提交 pull request 到本仓库。

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
SylarLong/iztro

⭐支持多语言轻量级获取紫微斗数排盘信息的javascript开源库。This is a lightweight kit for generating astrolabes for Zi Wei Dou Shu (The Purple Star Astrology), an ancient Chinese astrology. It allows you to obtain your horoscope and personality analysis.

4.5k
Nov 24, 2026
RepositoryTypeScript
morphatic/astrologyjs

Astrological charting for JavaScript and TypeScript: natal, transit, synastry, composite and Davison charts from the Swiss Ephemeris via the Morphemeris API. ESM-only, runs in Node and the browser, bring your own API key.

159
Nov 1, 2026
RepositoryRust
vedika-io/xalen-ephemeris

Pure-Rust astronomical ephemeris for astrology — Vedic, Western, Chinese, and 9 world traditions

832
Nov 30, 2026
RepositoryPython
ml8s/liki

Liki Skill — Professional Astrology Skill for AI assistants. BaZi, Zi Wei Dou Shu, Liu Yao, QiMen, Feng Shui, date selection and Chinese naming, powered by a deterministic engine with traceable, verifiable readings. Works in Claude, Codex, Cursor and any MCP host. Free, MIT.

108
Nov 19, 2026
RepositoryPython
katelouie/stellium

A modern Python library for astrological chart calculation, visualization, reporting and data analysis. Built on the Swiss Ephemeris for astronomical accuracy.

77
Oct 13, 2026
RepositoryTypeScript
microsoft/vscode

Visual Studio Code

195.9k
Nov 30, 2026
RepositoryTypeScript
ant-design/ant-design

An enterprise-class UI design language and React UI library

100.5k
Dec 2, 2026
RepositoryTypeScript
twentyhq/twenty

The open alternative to Salesforce, designed for AI.

61.7k
Nov 30, 2026
RepositoryTypeScript
FlowiseAI/Flowise

Build AI Agents, Visually

55.6k
Aug 13, 2026