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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { CFooter, CLink } from '@coreui/react'

export const FooterExample = () => (
<CFooter>
<div>
<CLink href="https://coreui.io">CoreUI</CLink>
<span>&copy; 2026 creativeLabs.</span>
</div>
<div>
<span>Powered by</span>
<CLink href="https://coreui.io">CoreUI</CLink>
</div>
</CFooter>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { CSSProperties } from 'react'
import { CIcon } from '@coreui/icons-react/src/index'
import { cilList } from '@coreui/icons'

export const IconCssVariablesExample = () => (
<>
<CIcon icon={cilList} size="xl" style={{ '--ci-primary-color': 'red' } as CSSProperties} />
<CIcon icon={cilList} size="xl" style={{ '--ci-primary-color': 'green' } as CSSProperties} />
</>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { CIcon } from '@coreui/icons-react/src/index'
import { cilList } from '@coreui/icons'

export const IconSizingExample = () => (
<>
<CIcon icon={cilList} size="sm" />
<CIcon icon={cilList} />
<CIcon icon={cilList} size="lg" />
<CIcon icon={cilList} size="xl" />
<CIcon icon={cilList} size="xxl" />
<CIcon icon={cilList} size="3xl" />
</>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { CIcon } from '@coreui/icons-react/src/index'
import { cilList } from '@coreui/icons'

export const IconUtilityClassesExample = () => (
<>
<CIcon icon={cilList} size="xl" />
<CIcon icon={cilList} className="text-primary" size="xl" />
<CIcon icon={cilList} className="text-secondary" size="xl" />
<CIcon icon={cilList} className="text-success" size="xl" />
<CIcon icon={cilList} className="text-danger" size="xl" />
<CIcon icon={cilList} className="text-warning" size="xl" />
<CIcon icon={cilList} className="text-info" size="xl" />
</>
)
18 changes: 6 additions & 12 deletions packages/docs/src/content/docs/components/footer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ otherFrameworks:

import CFooterData from '@api/CFooter.api.json'

import { FooterExample } from './examples/FooterExample'
import FooterExampleRaw from './examples/FooterExample.tsx?raw'

## Example

```jsx preview demo
<CFooter>
<div>
<CLink href="https://coreui.io">CoreUI</CLink>
<span>&copy; 2026 creativeLabs.</span>
</div>
<div>
<span>Powered by</span>
<CLink href="https://coreui.io">CoreUI</CLink>
</div>
</CFooter>
```
<Example code={FooterExampleRaw} name="FooterExample" componentName="React Footer">
<FooterExample client:only="react" />
</Example>

## Customizing

Expand Down
40 changes: 15 additions & 25 deletions packages/docs/src/content/docs/components/icon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import { IconDemo0 } from './examples/IconDemo0'
import IconDemo0Raw from './examples/IconDemo0.tsx?raw'
import { IconDemo1 } from './examples/IconDemo1'
import IconDemo1Raw from './examples/IconDemo1.tsx?raw'

import {CIcon, CIconSvg} from '@coreui/icons-react/src/index'
import { cilList, cilShieldAlt } from '@coreui/icons'
import * as icon from '@coreui/icons';
import { IconUtilityClassesExample } from './examples/IconUtilityClassesExample'
import IconUtilityClassesExampleRaw from './examples/IconUtilityClassesExample.tsx?raw'
import { IconCssVariablesExample } from './examples/IconCssVariablesExample'
import IconCssVariablesExampleRaw from './examples/IconCssVariablesExample.tsx?raw'
import { IconSizingExample } from './examples/IconSizingExample'
import IconSizingExampleRaw from './examples/IconSizingExample.tsx?raw'

## Installation

Expand Down Expand Up @@ -87,37 +89,25 @@ The CoreUI React Icon component offers versatile color customization options, em

With some [color utility classes](https://coreui.io/bootstrap/docs/utilities/colors/), you may use color to convey message.

```jsx preview
<CIcon icon={cilList} size="xl" />
<CIcon icon={cilList} className="text-primary" size="xl" />
<CIcon icon={cilList} className="text-secondary" size="xl" />
<CIcon icon={cilList} className="text-success" size="xl" />
<CIcon icon={cilList} className="text-danger" size="xl" />
<CIcon icon={cilList} className="text-warning" size="xl" />
<CIcon icon={cilList} className="text-info" size="xl" />
```
<Example code={IconUtilityClassesExampleRaw} name="IconUtilityClassesExample" componentName="React Icon">
<IconUtilityClassesExample client:only="react" />
</Example>

#### CSS Variables

CoreUI React Icons leverage local CSS variables, such as `--ci-primary-color` and `--ci-secondary-color` (for Duotone icons), to facilitate real-time customization. This allows developers to easily customize the icons by providing their own custom CSS variables.

```jsx preview
<CIcon icon={cilList} size="xl" style={{'--ci-primary-color': 'red'}} />
<CIcon icon={cilList} size="xl" style={{'--ci-primary-color': 'green'}} />
```
<Example code={IconCssVariablesExampleRaw} name="IconCssVariablesExample" componentName="React Icon">
<IconCssVariablesExample client:only="react" />
</Example>

### Sizing

Set heights of React icons using size property like size="lg" and size="sm".

```jsx preview
<CIcon icon={cilList} size="sm" />
<CIcon icon={cilList} />
<CIcon icon={cilList} size="lg" />
<CIcon icon={cilList} size="xl" />
<CIcon icon={cilList} size="xxl" />
<CIcon icon={cilList} size="3xl" />
```
<Example code={IconSizingExampleRaw} name="IconSizingExample" componentName="React Icon">
<IconSizingExample client:only="react" />
</Example>

### Custom SVG Icons

Expand Down
Loading
Loading