Toolwind Corner Shape provides simple utilities for applying corner shapes to elements in Tailwind CSS.
npm install @toolwind/corner-shape




Tailwind CSS plugin that adds first-class utilities for the CSS corner-shape property and its per-corner longhands (e.g. corner-top-left-shape). It supports static keywords like round, scoop, bevel, notch, square, squircle, as well as the functional value superellipse(.
You can install the plugin via npm:
``bash`
npm install @toolwind/corner-shape # or pnpm, yarn, bun
Tailwind CSS ≥ v4.0.0` | ||
Tailwind CSS < v4.0.0
|
This plugin leverages the new CSS corner-shape property, which allows you to control the shape of element corners using both standard keywords as well as functional values.
Because this property is not yet supported in all browsers, consider it forward-looking, though it is safe to use as it degrades gracefully. The utilities generated by this plugin map directly to the corner-shape property and its per-corner longhands.
For example:
`html`…`css`
.corner-squircle {
corner-shape: squircle;
}
View this example on Tailwind Play
- All corners at once: corner-{shape}corner-t-{shape}
- Physical edges (two corners at a time):
- → top-left and top-rightcorner-r-{shape}
- → top-right and bottom-rightcorner-b-{shape}
- → bottom-right and bottom-leftcorner-l-{shape}
- → top-left and bottom-leftcorner-tl-{shape}
- Physical single corners:
- , corner-tr-{shape}, corner-br-{shape}, corner-bl-{shape}corner-s-{shape}
- Logical edges (writing-direction aware):
- → start-start and end-startcorner-e-{shape}
- → start-end and end-endcorner-ss-{shape}
- Logical single corners:
- , corner-se-{shape}, corner-ee-{shape}, corner-es-{shape}
Supported static shapes: round, scoop, bevel, notch, square, squircle
`html`
Use Tailwind’s modifier syntax (/) to pass a superellipse( parameter:
- .corner-superellipse/50.corner-t-superellipse/32
- .corner-tr-superellipse/e
- .corner-s-superellipse/-pi
-
Accepted values are:
- a number (e.g. 2, 0.5, -1)e
- one of the constants: , pi, infinity (optionally negative: -e, -pi, -infinity)
Examples:
`html`
Notes:
- Values are passed through as-is to superellipse(. Do not include units.s
- Logical shorthands (, e, ss, se, ee, es) adapt with writing direction.
| Keyword | Description | Equivalent |
|----------|-----------------------------------------------------------------------------|------------|
| bevel | Defines a straight, diagonal corner, which is neither convex nor concave. | superellipse(0) |superellipse(-infinity)
| notch | Defines a 90-degree concave square corner. | |border-radius
| round | Defines a convex ordinary ellipse; the standard rounded corner created by without corner-shape. This is the default (initial) value. | superellipse(1) |superellipse(-1)
| scoop | Defines a concave ordinary ellipse. | |border-radius
| square | Defines a 90-degree convex square corner; the default shape when no (or border-radius: 0) is applied. | superellipse(infinity) |superellipse(2)
| squircle | Defines a “squircle”, a convex curve in between round and square. | |
- All corners
- corner-{shape}corner-superellipse/{value}
- corner-{t|r|b|l}-{shape}
- Edges (physical)
- corner-{t|r|b|l}-superellipse/{value}
- corner-{tl|tr|br|bl}-{shape}
- Corners (physical)
- corner-{tl|tr|br|bl}-superellipse/{value}
- corner-s-{shape}
- Edges (logical)
- , corner-e-{shape}corner-{s|e}-superellipse/{value}
- corner-{ss|se|ee|es}-{shape}
- Corners (logical)
- corner-{ss|se|ee|es}-superellipse/{value}
-
Where {shape} is one of round, scoop, bevel, notch, square, squircle.
All standard Tailwind variants work:
`html`
This plugin emits the corner-shape and corner-*-shape properties. Support for these properties varies by browser and may change over time. Consider providing design fallbacks (e.g. border-radius) where necessary.
- MDN: corner-shape
- Understanding CSS corner-shape and the power of the superellipse
---
I hope you find @toolwind/corner-shape a valuable addition to your projects. If you have any issues or suggestions, don't hesitate to open an issue or pull request.
If you liked this, you might also like my other Tailwind CSS plugins:
* tailwindcss-multi: Group utilities together by variant
* tailwindcss-signals: Apply styles based on parent or ancestor state, a state-driven alterative to groups
* tailwindcss-members: Apply styles based on child or descendant state, the inverse of groups
* tailwindcss-mixins: Construct reusable & aliased sets of utilities inline
* tailwindcss-selector-patterns: Dynamic CSS selector patterns
* tailwindcss-js: Effortless build-time JS script injection
* tailwindcss-directional-shadows: Supercharge your shadow utilities with added directional support (includes directional shadow-border` utilities too)
* tailwindcss-default-shades: Default shades for simpler color utility classes
* tailwind-lerp-colors: Expand your color horizons and take the fuss out of generating new—or expanding existing—color palettes