An open API service indexing awesome lists of open source software.

https://github.com/spwareing/imagesliderpcf

PCF Component for Canvas App
https://github.com/spwareing/imagesliderpcf

powerplatform react typescript typescript-react

Last synced: 2 months ago
JSON representation

PCF Component for Canvas App

Awesome Lists containing this project

README

        

# My PCF Component

The ImageSliderPCF is a custom Power Apps component framework (PCF) virtual control built with TypeScript and React.

The control provides a smoother transitioning image gallery, then the OOB galleries within power apps.

----

The PCF is based around the ImageSlider tutorial from [WebDevSimplified](https://www.youtube.com/watch?v=Kx8XlKRBZx8&ab_channel=WebDevSimplified). The code for Kyle's repo is [here](https://github.com/WebDevSimplified/react-image-slider).

To keep in line with current Microsoft theming, I've replaced all the Lucide icons with FluentUI FontIcons

```
import { Icon } from '@fluentui/react/lib/Icon'
import { mergeStyles, mergeStyleSets } from '@fluentui/react/lib/Styling';
```

## Configuration

### Properties

- ImageSliderProps accepts 3 elements
1. ImageSlider[]
2. Width
3. IconColour (this defaults to rgba(25,255,255)
- The ImageSliderItem is also comprised of 3 elements
1. id; generated from the recordId
2. imageUrl (required), a url to the image
3. name (optional)

ImageUrl and ImageName will need to have a column assigned in the Canvas app.

## Installation

Clones the repo

```
git clone https://github.com/SPWareing/ImageSliderPCF.git

cd ImageSliderPCF
```
Push the PCF to your required environment

```
pac pcf push -pp samples

```
NB A Publisher Prefix of samples is suggested for testing components. The PCF can be packaged as a solution when testing has been satisified

----
### Add the component to a Canvas App

Upon adding to a canvas the control will default to the following image

Default Image

Without a default image the control errors and does not mount. Once The PCF has mounted, the image(s) can be changed to a collection/datasource and should render similar to the below.

Screenshot of PCF

----
![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB) ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)