office-ui-fabric-react#Shimmer TypeScript Examples

The following examples show how to use office-ui-fabric-react#Shimmer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PeopleShimmerViewComponent.tsx    From spfx-msgraph-peoplesearch with MIT License 5 votes vote down vote up
private _getPersonaCardShimmers(personaSize: number): JSX.Element {

        const shimmerContent = <div
                                    style={{ 
                                        display: 'flex' ,
                                        marginBottom: 15  
                                    }}
                                >
                                    <div style={{
                                        paddingTop: 8,
                                        paddingRight: 16,
                                        paddingBottom: 8,
                                        width: '100%'
                                    }}>   
                                        
                                        <Shimmer
                                            theme={this.props.templateContext.themeVariant as ITheme}
                                            customElementsGroup={
                                            <div style={{ display: 'flex', marginTop: 10 }}>
                                                <ShimmerElementsGroup
                                                    theme={this.props.templateContext.themeVariant as ITheme}
                                                    backgroundColor={this.props.templateContext.themeVariant.semanticColors.bodyBackground}
                                                    shimmerElements={[{ type: ElemType.circle, height: personaSize}, { type: ElemType.gap, width: 10, height: personaSize }]}
                                                />
                                                <ShimmerElementsGroup
                                                theme={this.props.templateContext.themeVariant as ITheme}
                                                flexWrap={true}
                                                backgroundColor={this.props.templateContext.themeVariant.semanticColors.bodyBackground}
                                                width="100%"
                                                shimmerElements={[
                                                    { type: ElemType.line, width: '30%', height: 10, verticalAlign: 'center' },
                                                    { type: ElemType.gap, width: '70%', height: personaSize/2 },
                                                    { type: ElemType.line, width: '60%', height: 10, verticalAlign: 'top' },
                                                    { type: ElemType.gap, width: '40%', height: (personaSize/2) }
                                                ]}
                                                />
                                            </div>
                                        }/>
                                        
                                    </div>
                                </div>;

        return shimmerContent;
    }