0.1.4 • Published 2 months ago

@html-polygon/react v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

HTML Polygon for React

HTML Polygon is a polygon element generator for the following web frameworks:

  • React ← this package
  • Vue 3

Visit the playground and complete documentation at the HTML Polygon website.

Install

# NPM
npm install @html-polygon/react

# Yarn
yarn add @html-polygon/react

# PNPM
pnpm add @html-polygon/react

Quick start

Import the component:

import { Polygon } from '@html-polygon/react'

Use the component:

<Polygon
  sides={5}
  style={{
    height: '300px',
    width: '300px',
  }}
>
  I have 5 sides.
</Polygon>

Complete documentation can be found at the HTML Polygon website.

Why?

There are lots of polygon building utilities out there. They all generate either embedded SVGs, or they use CSS clip paths to clip the shape of standard divs.

The thing they all have in common is their inability to reliably contain text that "flows" into the shape to fill the polygon.

This is where HTML Polygon differs. This component builds an HTML element that both looks like a polygon, and behaves like a polygon.

You can use HTML Polygen to emulate the effects of the proposed CSS Shapes property shape-inside.

0.1.4

2 months ago

0.1.3

3 months ago

0.1.2

6 months ago

0.0.10

11 months ago

0.0.11

10 months ago

0.0.12

10 months ago

0.0.13

10 months ago

0.0.14

10 months ago

0.1.0

9 months ago

0.1.1

7 months ago

0.0.15

10 months ago

0.0.16

10 months ago

0.0.17

9 months ago

0.0.9

11 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.4

12 months ago