Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

guides

> 前端框架
Open source

A Guides component that can draw ruler and manage guidelines.

376 stars0 likes2 views
WebsiteGitHub

About

A Guides component that can draw ruler and manage guidelines.

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptangulareditorguidelinsguides

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

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