Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add text after Spinner ? #65

Open
gowthamdev opened this issue Jan 22, 2018 · 3 comments
Open

How to add text after Spinner ? #65

gowthamdev opened this issue Jan 22, 2018 · 3 comments

Comments

@gowthamdev
Copy link

I'm trying to add text to the Spinner component please let me know if any one of you know ?

@gowthamdev
Copy link
Author

gowthamdev commented Jan 22, 2018

const LoadingSpinner = () => (

Processing...!!!
)

I tried Text inside the spinner component and its not working

@codeaid
Copy link

codeaid commented Feb 23, 2018

Just wrap it in a custom component that displays the spinner and text below it.

This component is a spinner, it's not a loading progress component with optional text below it. Text styling is individual to every project so it would be rather difficult and pointless to add support for it.

An example:

import * as React from 'react';
import * as Spinner from 'react-spinkit';
import './styles.css';

interface ILoaderProps {
    text?: string;
}

export class PageLoader extends React.Component<ILoaderProps, {}> {
    // default component properties
    public static defaultProps: Partial<ILoaderProps> = {
        text: '',
    };

    /**
     * Render the element
     *
     * @return {JSX.Element}
     */
    public render(): JSX.Element {
        let {text} = this.props;

        return (
            <div className="loader">
                <div className="loader-content">
                    <Spinner name="wandering-cubes" />
                    <div className="loader-message">{text}</div>
                </div>
            </div>
        );
    }
}

styles.css

.loader {
    background-color: #ffffff;
    bottom: 0;
    left: 0;
    opacity: 0.8;
    position: absolute;
    right: 0;
    top: 0;
}

.loader,
.loader-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-message {
    font-size: 0.9em;
    margin-top: 1em;
} 

Something along these lines...

@preeti-brovitech
Copy link

helpful!! thankyou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants