Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions samples/inputs/chip/area/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
This folder contains implementation of React application with example of Area feature using [Chip](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html) component.


<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<body>
<a target="_blank" href="https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://dl.infragistics.com/x/img/browsers/button-docs.png"/>
</a>
<a target="_blank" href="./src/index.tsx" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://dl.infragistics.com/x/img/browsers/button-code.png"/>
</a>
<a target="_blank" href="https://www.infragistics.com/react-demos/samples/inputs/chip/area" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://dl.infragistics.com/x/img/browsers/button-run.png"/>
</a>
</body>
</html>

## Branches

> **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-react-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-react-examples/tree/vnext) branch only when you want to contribute new samples to this repository.

## Instructions

Follow these instructions to run this example:


```
git clone https://github.com/IgniteUI/igniteui-react-examples.git
cd ./igniteui-react-examples
git checkout master
cd ./samples/inputs/chip/area
```

open above folder in VS Code or type:
```
code .
```

In terminal window, run:
```
npm install
npm start
```

Then open http://localhost:4200/ in your browser


## Learn More

To learn more about **Ignite UI for React** components, check out the [React documentation](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html).
11 changes: 11 additions & 0 deletions samples/inputs/chip/area/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ChipArea</title>
<link href="https://dl.infragistics.com/x/css/samples/shared.v8.css" rel="stylesheet" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
42 changes: 42 additions & 0 deletions samples/inputs/chip/area/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "react-chip-area",
"description": "This project provides example of Chip Area using Infragistics React components",
"author": "Infragistics",
"homepage": ".",
"version": "1.4.0",
"private": true,
"scripts": {
"start": "vite --port 4200",
"build": "tsc && node --max-old-space-size=4096 node_modules/vite/bin/vite build",
"preview": "vite preview",
"test": "vitest"
},
"dependencies": {
"igniteui-dockmanager": "^2.2.1",
"igniteui-react": "19.9.0",
"igniteui-react-core": "19.6.0",
"igniteui-webcomponents": "~7.4.1",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/node": "^24.7.1",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.1",
"@vitest/browser": "^5.0.2",
"typescript": "^5.9.3",
"vite": "^8.3.1",
"vitest": "^5.0.2",
"vitest-canvas-mock": "^1.2.0",
"worker-loader": "^3.0.8"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
22 changes: 22 additions & 0 deletions samples/inputs/chip/area/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* shared styles are loaded from: */
/* https://dl.infragistics.com/x/css/samples/shared.v8.css */

.chips-area-sample {
display: flex;
align-items: center;
justify-content: center;
}

.chips-area {
--ig-size: var(--ig-size-large);

display: flex;
flex-wrap: wrap;
gap: 0.5rem;
padding: 0.25rem;
}

/* The chip host is a block box, so its line box would add height around the chip. */
.chips-area igc-chip {
display: flex;
}
22 changes: 22 additions & 0 deletions samples/inputs/chip/area/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import ReactDOM from 'react-dom/client';
import './index.css';
import { IgrChip } from 'igniteui-react';
import 'igniteui-webcomponents/themes/light/bootstrap.css';

const chips = ['Chip', 'Chip', 'Chip'];

export default function ChipArea() {
return (
<div className="sample chips-area-sample">
<div className="chips-area">
{chips.map((label, index) => (
<IgrChip key={index}>{label}</IgrChip>
))}
</div>
</div>
);
}

// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(<ChipArea/>);
24 changes: 24 additions & 0 deletions samples/inputs/chip/area/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es2020",
"lib": [
"es2020",
"dom",
"dom.iterable"
],
"module": "esnext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"types": [
"vite/client"
],
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"skipLibCheck": true,
"noEmit": true
},
"include": [
"src"
]
}
8 changes: 8 additions & 0 deletions samples/inputs/chip/area/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
build: { outDir: 'build' },
server: { open: false },
});
50 changes: 50 additions & 0 deletions samples/inputs/chip/interaction-state/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
This folder contains implementation of React application with example of Interaction State feature using [Chip](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html) component.


<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<body>
<a target="_blank" href="https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://dl.infragistics.com/x/img/browsers/button-docs.png"/>
</a>
<a target="_blank" href="./src/index.tsx" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://dl.infragistics.com/x/img/browsers/button-code.png"/>
</a>
<a target="_blank" href="https://www.infragistics.com/react-demos/samples/inputs/chip/interaction-state" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://dl.infragistics.com/x/img/browsers/button-run.png"/>
</a>
</body>
</html>

## Branches

> **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-react-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-react-examples/tree/vnext) branch only when you want to contribute new samples to this repository.

## Instructions

Follow these instructions to run this example:


```
git clone https://github.com/IgniteUI/igniteui-react-examples.git
cd ./igniteui-react-examples
git checkout master
cd ./samples/inputs/chip/interaction-state
```

open above folder in VS Code or type:
```
code .
```

In terminal window, run:
```
npm install
npm start
```

Then open http://localhost:4200/ in your browser


## Learn More

To learn more about **Ignite UI for React** components, check out the [React documentation](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html).
11 changes: 11 additions & 0 deletions samples/inputs/chip/interaction-state/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>ChipInteractionState</title>
<link href="https://dl.infragistics.com/x/css/samples/shared.v8.css" rel="stylesheet" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
42 changes: 42 additions & 0 deletions samples/inputs/chip/interaction-state/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "react-chip-interaction-state",
"description": "This project provides example of Chip Interaction State using Infragistics React components",
"author": "Infragistics",
"homepage": ".",
"version": "1.4.0",
"private": true,
"scripts": {
"start": "vite --port 4200",
"build": "tsc && node --max-old-space-size=4096 node_modules/vite/bin/vite build",
"preview": "vite preview",
"test": "vitest"
},
"dependencies": {
"igniteui-dockmanager": "^2.2.1",
"igniteui-react": "19.9.0",
"igniteui-react-core": "19.6.0",
"igniteui-webcomponents": "~7.4.1",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/node": "^24.7.1",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.1",
"@vitest/browser": "^5.0.2",
"typescript": "^5.9.3",
"vite": "^8.3.1",
"vitest": "^5.0.2",
"vitest-canvas-mock": "^1.2.0",
"worker-loader": "^3.0.8"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
35 changes: 35 additions & 0 deletions samples/inputs/chip/interaction-state/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* shared styles are loaded from: */
/* https://dl.infragistics.com/x/css/samples/shared.v8.css */

/* Aktiv Grotesk, from the same Adobe Fonts kit the docs use. */
@import url("https://use.typekit.net/bng2zgw.css");

.chip-states {
--ig-size: var(--ig-size-medium);

display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 1.5rem 3.75rem;
}

.chip-states-item {
display: flex;
align-items: center;
gap: 1.875rem;
}

/* The chip host is a block box, so its line box would add height around the chip. */
.chip-states-item igc-chip {
display: flex;
}

.chip-states-item span {
color: var(--ig-gray-600);
font-family: aktiv-grotesk, sans-serif;
font-size: 0.8125rem;
font-weight: 400;
line-height: 1.25rem;
letter-spacing: 0.3px;
}
33 changes: 33 additions & 0 deletions samples/inputs/chip/interaction-state/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useEffect, useRef } from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import { IgrChip } from 'igniteui-react';
import 'igniteui-webcomponents/themes/light/bootstrap.css';

export default function ChipInteractionState() {
const sampleRef = useRef<HTMLDivElement>(null);

// The chips only show their look, so inert keeps them out of the tab order and ignores pointer input.
useEffect(() => {
if (sampleRef.current) {
sampleRef.current.inert = true;
}
}, []);

return (
<div className="sample chip-states" ref={sampleRef}>
<div className="chip-states-item">
<span>Enabled</span>
<IgrChip removable>Chip</IgrChip>
</div>
<div className="chip-states-item">
<span>Disabled</span>
<IgrChip removable disabled>Chip</IgrChip>
</div>
</div>
);
}

// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(<ChipInteractionState/>);
24 changes: 24 additions & 0 deletions samples/inputs/chip/interaction-state/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es2020",
"lib": [
"es2020",
"dom",
"dom.iterable"
],
"module": "esnext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"types": [
"vite/client"
],
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"skipLibCheck": true,
"noEmit": true
},
"include": [
"src"
]
}
8 changes: 8 additions & 0 deletions samples/inputs/chip/interaction-state/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
build: { outDir: 'build' },
server: { open: false },
});
Loading
Loading