Skip to content

How to use the ComponentCover #220

Answered by varl
jenniferarnesen asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jenniferarnesen,

The usage is to render the ComponentCover inside the component you want to block off:

    <div>
        <ComponentCover />

        <p>Other things in the component that will be covered by the ComponentCover component</p>
    </div>

The way it works is that the ComponentCover attempts to cover its parent, and not cover its children.

The ComponentCover accepts children to provide a way to render things on top of the cover, for example, a spinner. So things that are inside the component cover will get a higher z-index than the ComponentCover itself.

Does that explain how and why it works the way it does?

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@amcgee
Comment options

@jenniferarnesen
Comment options

Answer selected by varl
Comment options

You must be logged in to vote
2 replies
@amcgee
Comment options

@amcgee
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants