### Install and Run Vue Basic Example Source: https://github.com/bejarcode/cornerkit/blob/main/packages/vue/examples/README.md Navigate to the example directory, install dependencies, and start the dev server. ```bash cd vue-basic npm install npm run dev ``` -------------------------------- ### Install and Run React Example Source: https://github.com/bejarcode/cornerkit/blob/main/packages/react/examples/README.md Instructions for navigating to the example directory, installing dependencies, and starting the development server. ```bash cd react-basic npm install npm run dev ``` -------------------------------- ### Install and Run Svelte Example Source: https://github.com/bejarcode/cornerkit/blob/main/packages/svelte/examples/README.md Instructions to navigate to an example directory, install dependencies, and start the development server. ```bash cd svelte-basic npm install npm run dev ``` -------------------------------- ### Install Dependencies and Verify Setup Source: https://github.com/bejarcode/cornerkit/blob/main/packages/core/CONTRIBUTING.md Install project dependencies using npm and verify the setup by running tests, building the production bundle, or checking TypeScript types. ```bash npm install npm test # Run unit tests npm run build # Build production bundle npm run type-check # Run TypeScript compiler ``` -------------------------------- ### Build and Run Vue Basic Example Locally Source: https://github.com/bejarcode/cornerkit/blob/main/packages/vue/examples/README.md Build the main package from packages/vue, then navigate to the example directory, install dependencies, and run the dev server. ```bash # From packages/vue npm run build # Then run the example cd examples/vue-basic npm install npm run dev ``` -------------------------------- ### Start Local HTTP Server with http-server Source: https://github.com/bejarcode/cornerkit/blob/main/website/README.md Navigate to the website directory and start a local HTTP server to view the demo. Ensure Node.js 16+ is installed. ```bash cd website npx http-server -p 8080 ``` -------------------------------- ### Build and Run Local Svelte Example Source: https://github.com/bejarcode/cornerkit/blob/main/packages/svelte/examples/README.md Steps to build the main package locally and then run a specific example, including installing its dependencies. ```bash # From packages/svelte npm run build # Then run the example cd examples/svelte-basic npm install npm run dev ``` -------------------------------- ### Build and Run Vanilla JS Example Source: https://github.com/bejarcode/cornerkit/blob/main/packages/core/examples/README.md Instructions to build the CornerKit core and run the vanilla JavaScript example locally. Ensure you have Node.js and npm installed. ```bash npm run build cd examples/vanilla-js open index.html # macOS # or xdg-open index.html # Linux # or simply open the file in your browser ``` -------------------------------- ### Clone and Setup cornerKit Repository Source: https://github.com/bejarcode/cornerkit/blob/main/CONTRIBUTING.md Steps to clone the cornerKit repository and set up the project locally. Ensure you have Node.js and Git installed. ```bash git clone https://github.com/YOUR_USERNAME/cornerkit.git cd cornerkit ``` ```bash git remote add upstream https://github.com/cornerkit/cornerkit.git ``` ```bash npm install ``` ```bash npm run dev ``` ```bash npm test ``` -------------------------------- ### Build and Run Svelte Examples Source: https://github.com/bejarcode/cornerkit/blob/main/packages/svelte/README.md Instructions for building the Svelte package and running the basic example. Ensure you build the package before running the example. ```bash # Build the package first npm run build # Run the basic example cd examples/svelte-basic npm install npm run dev ``` -------------------------------- ### Configuration Guide Source: https://github.com/bejarcode/cornerkit/blob/main/packages/core/README.md Detailed explanations and examples for configuring squircle properties like radius, smoothing, and borders. ```APIDOC ## Radius ### Description Controls the size of the corner curves in pixels. Larger values create more rounded corners. ### Usage Pass the `radius` property within the `config` object when calling `apply` or `update` methods. ### Examples ```javascript ck.apply('#element', { radius: 12 }); // Small (subtle) ck.apply('#element', { radius: 24 }); // Medium (standard) ck.apply('#element', { radius: 48 }); // Large (prominent) ``` ### Typical Ranges - **12-16px**: Buttons, inputs - **20-32px**: Cards, panels - **40-60px**: Hero sections, large cards ``` ```APIDOC ## Smoothing ### Description Controls the smoothness of the curve. A value of 0.0 results in sharp corners, while 1.0 results in a perfectly circular arc. The default value of 0.6 provides an iOS-standard curve. ### Usage Pass the `smoothing` property within the `config` object. ### Examples ```javascript ck.apply('#element', { smoothing: 0.0 }); // Square ck.apply('#element', { smoothing: 0.6 }); // iOS standard โญ ck.apply('#element', { smoothing: 0.85 }); // Figma default ck.apply('#element', { smoothing: 1.0 }); // Circular ``` ### Recommended Values - **0.6**: iOS 7+ standard (recommended) - **0.8**: Old CornerKit default - **0.85**: Figma default - **0.9-0.95**: Very smooth ``` ```APIDOC ## Border Support (v1.2.0+) ### Description CornerKit v1.2.0+ introduces SVG-based border rendering, offering enhanced capabilities over standard CSS borders. It eliminates anti-aliasing issues, supports various styles (solid, dashed, dotted, gradient), and integrates well with CSS frameworks. ### Usage Define the `border` object within the `config` object. It accepts `width`, `color`, `style`, `gradient`, and `dashArray` properties. #### Solid Border Example ```javascript ck.apply('#my-card', { radius: 16, smoothing: 0.8, border: { width: 2, color: '#3b82f6' } }); ``` #### Dashed Border Example ```javascript ck.apply('#upload-zone', { radius: 20, border: { width: 2, color: '#6b7280', style: 'dashed' } }); ``` ``` -------------------------------- ### CornerKit Project Setup and Testing Source: https://github.com/bejarcode/cornerkit/blob/main/README.md Provides commands for cloning the CornerKit repository, installing dependencies in the core package, and running various test suites including unit, integration, and performance tests. ```bash # Clone and install git clone https://github.com/bejarcode/cornerkit.git cd cornerkit/packages/core npm install # Run tests npm test # Unit tests npm run test:integration # Integration tests npm run test:performance # Performance benchmarks # Build npm run build # Production build npm run analyze-bundle # Bundle size analysis ``` -------------------------------- ### Build and Run React Example Locally Source: https://github.com/bejarcode/cornerkit/blob/main/packages/react/examples/README.md Steps to build the main @cornerkit/react package and then run a local example. ```bash # From packages/react npm run build # Then run the example cd examples/react-basic npm install npm run dev ``` -------------------------------- ### Vue Composable: useSquircle Examples Source: https://github.com/bejarcode/cornerkit/blob/main/packages/vue/README.md Illustrates different use cases for the useSquircle composable, including basic setup, reactive options, manual control with update/remove, and managing multiple instances. ```vue ``` -------------------------------- ### Install @cornerkit/svelte Source: https://github.com/bejarcode/cornerkit/blob/main/README.md Install the Svelte integration package using npm. ```bash npm install @cornerkit/svelte ``` -------------------------------- ### Install and Run CornerKit Core Source: https://github.com/bejarcode/cornerkit/blob/main/packages/core/README.md Commands to clone the repository, navigate to the core package directory, install dependencies, and run tests. ```bash git clone https://github.com/bejarcode/cornerkit.git cd cornerkit/packages/core npm install ``` ```bash npm test npm run test:integration npm run test:performance ``` ```bash npm run build npm run analyze-bundle ``` -------------------------------- ### Install @cornerkit/vue Source: https://github.com/bejarcode/cornerkit/blob/main/README.md Install the Vue 3 integration package using npm. ```bash npm install @cornerkit/vue ``` -------------------------------- ### Install CornerKit Core Package Source: https://github.com/bejarcode/cornerkit/blob/main/packages/core/README.md Install the core CornerKit package using npm, yarn, or pnpm. ```bash npm install @cornerkit/core ``` ```bash yarn add @cornerkit/core ``` ```bash pnpm add @cornerkit/core ``` -------------------------------- ### Install @cornerkit/svelte Source: https://github.com/bejarcode/cornerkit/blob/main/packages/svelte/README.md Install the Svelte package and its core dependency using npm. ```bash npm install @cornerkit/svelte @cornerkit/core ``` -------------------------------- ### Install @cornerkit/vue and @cornerkit/core Source: https://github.com/bejarcode/cornerkit/blob/main/packages/vue/README.md Install the necessary packages for @cornerkit/vue. Ensure you have Vue 3 and @cornerkit/core as peer dependencies. ```bash npm install @cornerkit/vue @cornerkit/core ``` ```bash pnpm add @cornerkit/vue @cornerkit/core ``` ```bash yarn add @cornerkit/vue @cornerkit/core ``` -------------------------------- ### Install CornerKit Core and Framework Wrappers Source: https://context7.com/bejarcode/cornerkit/llms.txt Install the core package or framework-specific wrappers using npm. CDN options are also available for direct script inclusion. ```bash # Core (framework-agnostic) npm install @cornerkit/core # React npm install @cornerkit/react @cornerkit/core # Vue 3 npm install @cornerkit/vue @cornerkit/core # Svelte npm install @cornerkit/svelte @cornerkit/core # CDN โ€” ES Module # # CDN โ€” UMD global # ``` -------------------------------- ### Development Setup Source: https://github.com/bejarcode/cornerkit/blob/main/packages/core/README.md Command to set up the development environment for CornerKit. This is typically used by contributors. ```bash ``` -------------------------------- ### Install @cornerkit/react and @cornerkit/core Source: https://github.com/bejarcode/cornerkit/blob/main/packages/react/README.md Install the necessary packages for using squircle components in your React application. ```bash npm install @cornerkit/react @cornerkit/core ``` -------------------------------- ### CornerKit Apply Method JSDoc Example Source: https://github.com/bejarcode/cornerkit/blob/main/packages/core/CONTRIBUTING.md Example of JSDoc comments for the `apply` method, including parameter descriptions, return type, and a usage example. Document all public APIs with JSDoc. ```typescript /** * Applies a squircle effect to the specified element. * * @param element - The HTML element to apply the squircle to * @param config - Configuration options for the squircle * @returns void * * @example * ```typescript * const ck = new CornerKit(); * ck.apply('.button', { radius: 20, smoothing: 0.8 }); * ``` */ apply(element: HTMLElement | string, config?: Partial): void { // implementation } ``` -------------------------------- ### React Squircle Component Examples Source: https://context7.com/bejarcode/cornerkit/llms.txt Demonstrates various ways to use the `` component in React, including basic usage, polymorphic rendering, and applying borders. Ensure the `@cornerkit/react` package is installed. ```tsx import { Squircle, useSquircle } from '@cornerkit/react'; // --- Component --- // Basic div (default) function BasicCard() { return ( Card content ); } // Polymorphic: renders as ; } ```