- Published on
6 Easy Ways To Make A Hideable Notes (bottom Right Fixed Button) With Tailwind CSS

- What is Tailwind CSS?
- The description of Hideable notes (bottom right fixed button) ui component
- Why use Tailwind CSS to create a Hideable notes (bottom right fixed button) ui component?
- The preview of Hideable notes (bottom right fixed button) ui component
- The source code of Hideable notes (bottom right fixed button) ui component
- How to create a Hideable notes (bottom right fixed button) with Tailwind CSS?
- Install tailwind css of verion 1.4.6
- All the unility class needed to create a Hideable notes (bottom right fixed button) component
- 23 steps to create a Hideable notes (bottom right fixed button) component with Tailwind CSS
- Conclusion
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.
The description of Hideable notes (bottom right fixed button) ui component
Sidefixed notes created using tailwind css and vanilla javascript. if the component is helpful please do rate 5 star.
Why use Tailwind CSS to create a Hideable notes (bottom right fixed button) ui component?
- It can make the building process of Hideable notes (bottom right fixed button) ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Hideable notes (bottom right fixed button) component file.
The preview of Hideable notes (bottom right fixed button) ui component
Free download of the Hideable notes (bottom right fixed button)'s source code
The source code of Hideable notes (bottom right fixed button) ui component
<div class="h-screen">
<div class="fixed bottom-0 right-0 w-16 h-16 mr-12 mb-8 cursor-pointer" id="box_btn">
<img src="https://devrolabs.com/image/tabnote.png">
</div>
<div id="note_box"
class="hidden rounded-lg bg-white shadow-xl fixed bottom-0 right-0 w-64 h-64 mr-12 mb-32">
<div class="bg-gray-900 text-white text-xl p-2 cursor-pointer rounded-lg" onclick="close_note()">NOTES</div>
<div class="p-2">
<textarea class="bg-gray-100 w-full h-32 p-2 focus:outline-none"
placeholder="Write here !"></textarea>
</div>
<button class="bg-teal-500 text-white p-2 mx-2 absolute right-0">SAVE</button>
</div>
</div>
<script>
var note_box = document.getElementById("note_box");
var box_btn = document.getElementById("box_btn");
box_btn.addEventListener("click", () => {
console.log("clicked");
console.log(note_box.style.display);
if (note_box.classList.contains("hidden"))
{
note_box.classList.remove("hidden");
}
else
note_box.classList.add("hidden");
});
function close_note()
{
note_box.classList.add("hidden");
}
</script>
How to create a Hideable notes (bottom right fixed button) with Tailwind CSS?
Install tailwind css of verion 1.4.6
Use the link
html tag to import the stylesheet of Tailwind CSS of the version 1.4.6
<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">
All the unility class needed to create a Hideable notes (bottom right fixed button) component
h-screen
fixed
bottom-0
right-0
w-16
h-16
mr-12
mb-8
hidden
bg-white
w-64
h-64
mb-32
bg-gray-900
text-white
text-xl
p-2
bg-gray-100
w-full
h-32
bg-teal-500
mx-2
absolute
23 steps to create a Hideable notes (bottom right fixed button) component with Tailwind CSS
Use
h-screen
to make an element span the entire height of the viewport.Use
fixed
to position an element relative to the browser window.Use the
bottom-0
utilities to set the bottom position of a positioned element to 0rem.Use the
right-0
utilities to set the right position of a positioned element to 0rem.Use
w-16
to set an element to a fixed width(4rem).Use
h-16
to set an element to a fixed height(4rem).Control the margin on right side of an element to 3rem using the
mr-12
utilities.Control the margin on bottom side of an element to 2rem using the
mb-8
utilities.Use
hidden
to set an element to display: none and remove it from the page layout.Control the background color of an element to white using the
bg-white
utilities.Use
w-64
to set an element to a fixed width(16rem).Use
h-64
to set an element to a fixed height(16rem).Control the margin on bottom side of an element to 8rem using the
mb-32
utilities.Control the background color of an element to gray-900 using the
bg-gray-900
utilities.Control the text color of an element to white using the
text-white
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Control the background color of an element to gray-100 using the
bg-gray-100
utilities.Use
w-full
to set an element to a 100% based width.Use
h-32
to set an element to a fixed height(8rem).Control the background color of an element to teal-500 using the
bg-teal-500
utilities.Control the horizontal margin of an element to 0.5rem using the
mx-2
utilities.Use
absolute
to position an element outside of the normal flow of the document, causing neighboring elements to act as if the element doesn’t exist.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Hideable notes (bottom right fixed button) components, learn and follow along to implement your own components.