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/layouts/icon/overview/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 Overview feature using [Icon](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/layouts/icon/overview" 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/layouts/icon/overview
```

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/layouts/icon/overview/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>IconOverview</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/layouts/icon/overview/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "react-icon-overview",
"description": "This project provides example of Icon Overview 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"
]
}
18 changes: 18 additions & 0 deletions samples/layouts/icon/overview/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* shared styles are loaded from: */
/* https://dl.infragistics.com/x/css/samples/shared.v8.css */

.sample {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 1rem;
}

.menu {
height: auto;
}

.menu igc-nav-drawer-item {
isolation: isolate;
Comment thread
IMinchev64 marked this conversation as resolved.
Resolved
}
50 changes: 50 additions & 0 deletions samples/layouts/icon/overview/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { useEffect, useState } from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import { IgrIcon, IgrNavDrawer, IgrNavDrawerItem, registerIconFromText } from 'igniteui-react';
import 'igniteui-webcomponents/themes/light/bootstrap.css';

const icons = [
{ name: 'home', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>' },
{ name: 'mail', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>' },
{ name: 'assignment', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/></svg>' },
{ name: 'settings', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></svg>' },
{ name: 'feedback', text: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 12h-2v-2h2v2zm0-4h-2V6h2v4z"/></svg>' },
];

const menuItems = [
{ label: 'Home', icon: 'home' },
{ label: 'Inbox', icon: 'mail' },
{ label: 'Reports', icon: 'assignment' },
{ label: 'Settings', icon: 'settings' },
{ label: 'Support', icon: 'feedback' },
];

export default function IconOverview() {
const [activeItem, setActiveItem] = useState<string>('Home');

useEffect(() => {
icons.forEach((icon) => registerIconFromText(icon.name, icon.text, 'material'));
}, []);

return (
<div className="sample">
<IgrNavDrawer className="menu" position="relative" open={true}>
{menuItems.map((item) => (
<IgrNavDrawerItem
key={item.label}
active={item.label === activeItem}
onClick={() => setActiveItem(item.label)}
>
<IgrIcon slot="icon" name={item.icon} collection="material" />
<span slot="content">{item.label}</span>
</IgrNavDrawerItem>
))}
</IgrNavDrawer>
</div>
);
}

// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(<IconOverview/>);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This folder contains implementation of React application with example of Sizing feature using [Icon](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started.html) component.
This folder contains implementation of React application with example of Size feature using [Icon](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">
Expand All @@ -9,7 +9,7 @@ This folder contains implementation of React application with example of Sizing
<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/layouts/icon/sizing" rel="noopener noreferrer">
<a target="_blank" href="https://www.infragistics.com/react-demos/samples/layouts/icon/size" 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>
Expand All @@ -28,7 +28,7 @@ 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/layouts/icon/sizing
cd ./samples/layouts/icon/size
```

open above folder in VS Code or type:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>IconSizing</title>
<title>IconSize</title>
<link href="https://dl.infragistics.com/x/css/samples/shared.v8.css" rel="stylesheet" />
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-icon-sizing",
"description": "This project provides example of Icon Sizing using Infragistics React components",
"name": "react-icon-size",
"description": "This project provides example of Icon Size using Infragistics React components",
"author": "Infragistics",
"homepage": ".",
"version": "1.4.0",
Expand Down
42 changes: 42 additions & 0 deletions samples/layouts/icon/size/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* shared styles are loaded from: */
/* https://dl.infragistics.com/x/css/samples/shared.v8.css */

.sample {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 1rem;
}

.icon-sizes {
display: grid;
grid-auto-flow: column;
grid-template-rows: auto auto;
place-items: center;
column-gap: 4.25rem;
row-gap: 1.0625rem;
}

.icon-sizes igc-icon {
color: var(--ig-gray-800);
}

.size-large {
--ig-size: var(--ig-size-large);
}

.size-medium {
--ig-size: var(--ig-size-medium);
}

.size-small {
--ig-size: var(--ig-size-small);
}

.size-label {
color: var(--ig-gray-600);
font-family: "Aktiv Grotesk", Arial, sans-serif;
font-size: 0.875rem;
line-height: 1.25rem;
}
30 changes: 30 additions & 0 deletions samples/layouts/icon/size/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useEffect } from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import { IgrIcon, registerIconFromText } from 'igniteui-react';
import 'igniteui-webcomponents/themes/light/bootstrap.css';

const notificationsIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg>';

export default function IconSize() {
useEffect(() => {
registerIconFromText('notifications', notificationsIcon, 'material');
}, []);

return (
<div className="sample">
<div className="icon-sizes">
<IgrIcon className="size-large" name="notifications" collection="material" />
<span className="size-label">Large</span>
<IgrIcon className="size-medium" name="notifications" collection="material" />
<span className="size-label">Medium</span>
<IgrIcon className="size-small" name="notifications" collection="material" />
<span className="size-label">Small</span>
</div>
</div>
);
}

// rendering above component to the React DOM
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(<IconSize/>);
24 changes: 24 additions & 0 deletions samples/layouts/icon/size/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"
]
}
12 changes: 12 additions & 0 deletions samples/layouts/icon/size/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
build: {
outDir: 'build'
},
server: {
open: false
},
});
18 changes: 0 additions & 18 deletions samples/layouts/icon/sizing/src/IconSizing.css

This file was deleted.

Empty file.
26 changes: 0 additions & 26 deletions samples/layouts/icon/sizing/src/index.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions samples/layouts/icon/styling/src/IconStyling.css

This file was deleted.

Loading
Loading