百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

guides

> 前端框架
开源

一个可以绘制直尺和管理指导线的 Guides 组件。

376 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个可以绘制直尺和管理指导线的 Guides 组件。

Guides

A Guides component that can draw ruler and manage guidelines.

Demo /
API /
Ruler /
Main Project

⚙️ Installation

npm

bash
$ npm i @scena/guides

scripts

xml

How to use

typescript

import Guides from "@scena/guides";

const guides = new Guides(document.body, {
    type: "horizontal",
}).on("changeGuides", e => {
    console.log(e.guides);
});

let scrollX = 0;
let scrollY = 0;
window.addEventListener("resize", () => {
    guides.resize();
});

window.addEventListener("wheel", e => {
    scrollX += e.deltaX;
    scrollY += e.deltaY;

    guides.scrollGuides(scrollY);
    guides.scroll(scrollX);
});

Ruler Units

The default unit is px, and a line is drawn every 50px. If you want to use a different unit instead of the px unit, use it like this:

  • 1px (Default)
    • zoom: 1
    • unit: 50 (every 50px)
  • 1cm = 37.7952px
    • zoom: 37.7952
    • unit: 1 (every 1cm)
  • 1in = 96px = 2.54cm
    • zoom: 96
    • unit: 1 (every 1in)

See:

  • https://www.w3schools.com/cssref/css_units.asp
  • https://www.scaler.com/topics/css/css-units/

⚙️ Developments

The guides repo is managed as a monorepo with yarn.

bash
yarn config set registry https://registry.npmjs.org/

⭐️ Show Your Support

Please give a ⭐️ if this project helped you!

Contributing

If you have any questions or requests or want to contribute to guides or other packages, please write the issue or give me a Pull Request freely.

Bug Report

If you find a bug, please report to us opening a new Issue on GitHub.

License

This project is MIT licensed.

…

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptangulareditorguidelinsguides

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架