pitsi/ui
HomeDocsComponentsAnimationsBlocksTemplates
1
1
Sections
  • Get Started
  • Components
  • Animations
  • MCP Server
  • Forms
  • Changelog
Get Started
  • Installation
  • CLI
  • llms.txt
Components
  • Accordion
  • Alert Dialog
  • Alert
  • Aspect Ratio
  • Avatar
  • Badge
  • Breadcrumb
  • Button Group
  • Button
  • Calendar
  • Card
  • Carousel
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • Container
  • Context Menu
  • Data Table
  • Date Picker
  • Dialog
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • Flex
  • Form
  • Grid
  • Hover Card
  • Input Group
  • Input OTP
  • Input
  • Item
  • Kbd
  • Label
  • Menubar
  • Native Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Radio Group
  • Resizable
  • Responsive
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spacer
  • Spinner
  • Squircle
  • Switch
  • Table
  • Tabs
  • Textarea
  • Theme Toggle
  • Toggle Group
  • Toggle
  • Tooltip
  • Typography
  • Unicorn Wrapper
Animations
  • Background Image Parallax
  • Blend Mode Cursor
  • Card Swipe Carousel
  • Cards Parallax
  • Cursor Hover Mask
  • Floating Image Gallery
  • Mouse Hover Gallery
  • Nav Menu
  • Parallax Scroll
  • Perspective Carousel
  • Perspective Section Transition
  • Scroll Expand
  • Scroll Fade
  • Scroll Scale
  • Slide Down
  • Slide Up
  • Smooth Parallax Scroll
  • Smooth Scroll
  • Sticky Footer
  • Text Along Path
  • Text Gradient Opacity
  • Text Parallax
  • Transforms 3d
  • Zoom Parallax
General

Resources, guides, and helpful links.

Documentation
Introduction
Installation
CLI
llms.txt
Next.js
Vite
Laravel
React Router
Pages
Home
Docs
Components
Animations
Blocks
Templates
Templates
Application Shell
Calendar
Dashboard
Forms
Modalbox
Profile Headers
Section Headers
Table Header
Connect
GitHub
Twitter
Get Started
Changelog
Legal
Privacy
Terms
Blocks

Larger composed sections for building pages.

Application Shell
Calendar
Dashboard
Forms
Modalbox
Profile Headers
Section Headers
Table Header
Category Filter
Comment List
Incentives
Order Confirmation
Order History
Order Summaries
Order Tracking
Product List
Product Overview
Product Review
Refund Form
Refund Overview
Refund Status
Shopping Cart
404 Page
About Us Page
Blog Details
Career Pages
Coming Soon Page
Contactus Page
Legal Pages
Login Page
Maintenance Page
Otp
Pricing Page
About Us Section
Blogs News
Clients
Contact Form
Cta
Faq
Features
Footer
Gallery
Hero Section
How It Works
Integration
Portfolio
Pricing Plans
Stats
Team
Testimonial
Components

Copy and paste UI components into your apps.

Accordion
Alert Dialog
Alert
Aspect Ratio
Avatar
Badge
Breadcrumb
Button Group
Button
Calendar
Card
Carousel
Checkbox
Collapsible
Combobox
Command
Container
Context Menu
Data Table
Date Picker
Dialog
Drawer
Dropdown Menu
Empty
Field
Flex
Form
Grid
Hover Card
Input Group
Input OTP
Input
Item
Kbd
Label
Menubar
Native Select
Navigation Menu
Pagination
Popover
Progress
Radio Group
Resizable
Responsive
Scroll Area
Segmented Control
Select
Separator
Sheet
Sidebar
Skeleton
Slider
Sonner
Spacer
Spinner
Squircle
Switch
Table
Tabs
Textarea
Theme Toggle
Toggle Group
Toggle
Tooltip
Typography
Unicorn Wrapper
Animations

Beautiful animations and effects for your UI.

Background Image Parallax
Blend Mode Cursor
Card Swipe Carousel
Cards Parallax
Cursor Hover Mask
Floating Image Gallery
Mouse Hover Gallery
Nav Menu
Parallax Scroll
Perspective Carousel
Perspective Section Transition
Scroll Expand
Scroll Fade
Scroll Scale
Slide Down
Slide Up
Smooth Parallax Scroll
Smooth Scroll
Sticky Footer
Text Along Path
Text Gradient Opacity
Text Parallax
Transforms 3d
Zoom Parallax
Sign In

Squircle

PreviousNext

An SVG filter component for creating squircle (superellipse) shapes using CSS filters.

Powered by
Skiper UI

Installation

pnpm dlx pitsi@latest add squircle

Usage

SpinnerSwitch

On This Page

InstallationUsageBasic UsageDynamic FilterHow It WorksComponentsSquiCircleFilterStaticSquiCircleFilterPropsSquiCircleFilterExamplesCard with Squircle ShapeButton with Squircle ShapeImage with Squircle MaskNotes

The Squircle component provides an SVG filter that can be applied to any element to create smooth, squircle-shaped corners.

Basic Usage

import { SquiCircleFilterStatic } from "@/components/ui/squircle"
// Add the filter to your layout (only once)
<SquiCircleFilterStatic />
 
// Apply the filter to any element
<div
  className="bg-primary h-32 w-32"
  style={{ filter: "url(#SkiperSquiCircleFilterLayout)" }}
/>

Dynamic Filter

For adjustable squircle parameters:

import { SquiCircleFilter } from "@/components/ui/squircle"
<SquiCircleFilter
  blurValue={10}
  colorMatrixValue={20}
  alphaValue={-7}
/>
 
<div
  className="bg-primary h-32 w-32 rounded-2xl"
  style={{ filter: "url(#SquiCircleFilter)" }}
/>

How It Works

The Squircle effect is created using SVG filters:

  1. Gaussian Blur: Blurs the element edges
  2. Color Matrix: Enhances contrast to sharpen the blur into a smooth shape
  3. Blend: Combines the filtered result with the original element

The result is a smooth, organic shape that's somewhere between a circle and a square - a squircle!

Components

SquiCircleFilterStatic

A static filter with predefined values. Best for consistent squircle shapes across your application.

SquiCircleFilter

A customizable filter that accepts parameters for fine-tuning the squircle effect.

Props

SquiCircleFilter

PropTypeDefaultDescription
blurValuenumber10Amount of blur applied (0-50)
colorMatrixValuenumber20Contrast enhancement (1-50)
alphaValuenumber-7Alpha channel adjustment (-20 to 0)

Examples

Card with Squircle Shape

<SquiCircleFilterStatic />
 
<div
  className="bg-card p-6 shadow-lg"
  style={{ filter: "url(#SkiperSquiCircleFilterLayout)" }}
>
  <h3>Card Title</h3>
  <p>Card content with smooth squircle corners.</p>
</div>

Button with Squircle Shape

<button
  className="bg-primary text-primary-foreground px-6 py-3"
  style={{ filter: "url(#SkiperSquiCircleFilterLayout)" }}
>
  Click Me
</button>

Image with Squircle Mask

<img
  src="/image.jpg"
  alt="Squircle image"
  className="h-64 w-64 object-cover"
  style={{ filter: "url(#SkiperSquiCircleFilterLayout)" }}
/>

Notes

  • Add the filter component once in your layout or root component
  • Apply the filter to elements using the filter CSS property
  • The filter works best with elements that have a solid background
  • Adjust blurValue, colorMatrixValue, and alphaValue to fine-tune the squircle shape
  • Higher blurValue creates rounder shapes
  • Higher colorMatrixValue sharpens the edges
  • alphaValue controls the edge softness (more negative = softer edges)
"use client"

import React from "react"

// to use the filter just add this to your layout.tsx
// <SkiperSquiCircleFilterLayout/>
// {children}

// on element you need to add squicircle just add the filter id SkiperSquiCircleFilter
//<div style={{filter: "url(#SquiCircleFilter)"}}></div>

// thats it you can use the filter now no extra rerenders no complications just pure css filter

export const SquiCircleFilterStatic = () => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      className="absolute bottom-0 left-0"
      version="1.1"
    >
      <defs>
        <filter id="SkiperSquiCircleFilterLayout">
          <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
          <feColorMatrix
            in="blur"
            mode="matrix"
            values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 20 -7"
            result="goo"
          />
          <feBlend in="SourceGraphic" in2="goo" />
        </filter>
      </defs>
    </svg>
  )
}

const Skiper63 = () => {
  return (
    <div className="flex h-full w-full flex-col items-center justify-center">
      <SquiCircleFilter />
      <div
        className="bg-foreground rounded-2xl"
        style={{
          height: "200px",
          width: "300px",
          filter: "url(#SquiCircleFilter)",
        }}
      />
    </div>
  )
}

export { Skiper63 }

const SquiCircleFilter = () => {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      className="absolute bottom-0 left-0"
      version="1.1"
    >
      <defs>
        <filter id="SquiCircleFilter">
          <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
          <feColorMatrix
            in="blur"
            mode="matrix"
            values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 20 -7"
            result="goo"
          />
          <feBlend in="SourceGraphic" in2="goo" />
        </filter>
      </defs>
    </svg>
  )
}