1.0.4 โ€ข Published 5 months ago

borderly v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

Borderly

A lightweight React component that helps you visualize and debug your layout by adding outlines to all elements on your page with a single click.

Features

  • ๐ŸŽฏ One-click element outline visualization
  • ๐ŸŽจ Customizable outline color
  • ๐Ÿงน Auto-cleanup on component unmount
  • ๐Ÿ“ฑ Responsive floating button
  • ๐Ÿ”„ Toggle functionality
  • ๐ŸŽญ Built-in TypeScript support

Installation

npm install borderly
# or
yarn add borderly
# or
pnpm add borderly

Usage

  1. Import the Borderly component:
import Borderly from 'borderly';
  1. Add it to your React application:
function App() {
  return (
    <div>
      <Borderly />
      {/* Your other components */}
    </div>
  );
}

Customizing the outline color

You can customize the outline color by passing the outlineColor prop:

<Borderly outlineColor="#ff0000" />

Props

PropTypeDefaultDescription
outlineColorstring"tomato"The color of the outline applied to elements
outlineColorstring"yellow"The color of the outline applied to elements
outlineColorstring"green"The color of the outline applied to elements
outlineColorstring"red"The color of the outline applied to elements

How It Works

Borderly adds a floating button to your application that, when clicked, dynamically injects a style element into your document's head. This style element adds a 1px solid outline to all elements on the page, making it easy to visualize your layout structure.

The outline can be toggled on and off with the button, and the style element is automatically cleaned up when the component unmounts.

Requirements

  • React 16.8+ (Hooks support)
  • TypeScript (optional but supported)

Styling

Borderly uses Tailwind CSS classes for styling the toggle button. If you're not using Tailwind in your project, make sure to include the necessary styles or override them using your own CSS.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT ยฉ Abhay Chauhan

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.

1.0.1

5 months ago

1.0.4

5 months ago

0.0.1

6 months ago