Check out example codes for "can i do an onclick menu with css alone". It will help you in understanding the concepts better.

Code Example 1

.menu {
    visibility: hidden;
}

button + .menu:active,
button:focus + .menu {
    visibility: visible;
}

Learn ReactJs, React Native from akashmittal.com