Fetching latest headlines…
Rattribute.js
NORTH AMERICA
πŸ‡ΊπŸ‡Έ United Statesβ€’July 6, 2026

Rattribute.js

1 views0 likes0 comments
Originally published byDev.to

Rattribute.js allows you to define different HTML attributes for different viewport widths using simple data-* attributes. Whether you need to change classes, targets, ARIA attributes, or any other HTML attribute, Rattribute.js updates your elements automatically as the browser size changes β€” without writing responsive JavaScript.

This is a brand new project that I started a few days ago!

GitHub logo williamtroup / Rattribute.js

❓ A lightweight JavaScript library for automatically changing HTML element attributes based on responsive screen sizes.

Rattribute.js

Tweet npm nuget license discussions Welcome coded by William Troup

❓ Rattribute.js allows you to define different HTML attributes for different viewport widths using simple data-* attributes. Whether you need to change classes, targets, ARIA attributes, or any other HTML attribute, Rattribute.js updates your elements automatically as the browser size changes β€” without writing responsive JavaScript.

v1.3.1



What features does Rattribute.js have?

  • πŸš€ Zero dependencies and lightweight.
  • πŸ“ Written in TypeScript with excellent editor support.
  • πŸ“± Responsive breakpoints matching Bootstrap (xs–xxl), plus custom sizes.
  • πŸ”„ Automatically detects new DOM elements.
  • βš™οΈ Public API for manual control.
  • 🎯 Ignore specific elements when needed.
  • 🧩 Set attribute values directly or from function calls.


What browsers are supported?

Rattribute.js works in all modern browsers, including:

  • Google Chrome
  • Microsoft Edge
  • Mozilla Firefox
  • Safari
  • Opera


What are the most recent changes?

To see a list of all the most recent changes, click here.

How do I install Rattribute.js?

You…

Comments (0)

Sign in to join the discussion

Be the first to comment!