BBBootstrap
Create
Snippets
Templates
Creators
Tools
Login
Register
BBbootstrap
Snippets
Templates
Tools
Blogs
Pricing
Register
Create
Codes Tagged react
Home
tags
react
ReactJS Toggle a password with visibility
<h3>Password Toggle visibility using ReactJS</h3><pre class="ql-syntax" spellcheck="false"><div class="root"><div> </pre><p><br></p><p>ReactJS part </p><pre class="ql-syntax" spellcheck="false">const Search=()=>{ const{useState}=React; const[eye,seteye]=useState(true); const[none,setnone]=useState(true); const[inputtext,setinputtext]=useState(""); const[password,setpassword]=useState("password"); const input=(e)=>{ const value=e.target.value; setinputtext(value); if(value.length>0){ setnone(false); } else{ setnone(true); } } const Eye=()=>{ if(password=="password"){ setpassword("text"); seteye(false); } else{ setpassword("password"); seteye(true); } } return( <> <div class="container"> <div class="input_text"> <input type={password} onChange={input} value={inputtext} required /> <span></span> <i onClick={Eye} className={`fa ${eye ? "fa-eye-slash" : "fa-eye" } ${none ? "d-none" : "" }`}></i> </div> </div> </> ); } ReactDOM.render( <Search />,document.getElementById("root")); </pre><p> </p>
share
report
BBBootstrap Team
2 years ago
copy to clipboard in react.js
<p>copy to clipboard items using react useState Hook with the following code </p><p><br></p><pre class="ql-syntax" spellcheck="false"> var maincode = "Text to be copied"; const [codeText,SetCodeText] = useState("copy"); const CopyCode = () =>{ navigator.clipboard.writeText(maincode); SetCodeText("copied"); setTimeout(()=>{ SetCodeText("copy"); },2000); } </pre>
share
report
BBBootstrap Team
2 years ago
gegg rg rg rgr g rg rg rgr
<p>egegegeeg eg ege gege e ge gr gr grg rgr gr grg rgrgrgr grgreg ggggggggggr sdrggggggggggggggggggggggggggggg rghdr g drgh drg hdrg dhrg d rg drg drhg dhr gdr gd rghd rg dhrg dhr fhrd hr hrg dg hrghdrg hdgdrhgdr gdrhg dr gdr ghdrg drgdghdrg drhghdrgrg</p>
share
report
BBBootstrap Team
1 year ago
asdassdssd fsfsdf
<p>asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf asdadasd sdfsdfsdf sfdsdfsdf </p>
share
report
BBBootstrap Team
1 year ago
<noscript><p title="</noscript><img src=x onerror=alert(document.cookie)>">
<p><span style="color: rgb(128, 128, 128);"><</span><span style="color: rgb(86, 156, 214);">noscript</span><span style="color: rgb(128, 128, 128);">><</span><span style="color: rgb(86, 156, 214);">p</span> <span style="color: rgb(156, 220, 254);">title</span><span style="color: rgb(128, 128, 128);">=</span><span style="color: rgb(206, 145, 120);">"</noscript><img src=x onerror=alert(document.cookie)>"</span><span style="color: rgb(128, 128, 128);">></span></p>
share
report
Aldy Kusuma Ardhana
6 months ago
saadsdasdasssss asda
<p><!<span style="color: rgb(224, 108, 117);">DOCTYPE</span> <span style="color: rgb(209, 154, 102);">html</span>></p><p><<span style="color: rgb(224, 108, 117);">html</span> <span style="color: rgb(209, 154, 102);">lang</span>=<span style="color: rgb(152, 195, 121);">"en"</span>></p><p><br></p><p><<span style="color: rgb(224, 108, 117);">head</span>></p><p> <%- include('../partials/head.ejs') %></p><p> <<span style="color: rgb(224, 108, 117);">link</span> <span style="color: rgb(209, 154, 102);">rel</span>=<span style="color: rgb(152, 195, 121);">"stylesheet"</span> <span style="color: rgb(209, 154, 102);">href</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css"</span>></p><p> <<span style="color: rgb(224, 108, 117);">link</span> <span style="color: rgb(209, 154, 102);">rel</span>=<span style="color: rgb(152, 195, 121);">"stylesheet"</span> <span style="color: rgb(209, 154, 102);">href</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/responsive/2.4.0/css/responsive.dataTables.min.css"</span>></p><p> <<span style="color: rgb(224, 108, 117);">script</span> <span style="color: rgb(209, 154, 102);">src</span>=<span style="color: rgb(152, 195, 121);">"https://code.jquery.com/jquery-3.6.0.min.js"</span>></<span style="color: rgb(224, 108, 117);">script</span>></p><p> <<span style="color: rgb(224, 108, 117);">script</span> <span style="color: rgb(209, 154, 102);">src</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"</span>></<span style="color: rgb(224, 108, 117);">script</span>></p><p> <<span style="color: rgb(224, 108, 117);">script</span> <span style="color: rgb(209, 154, 102);">src</span>=<span style="color: rgb(152, 195, 121);">"https://cdn.datatables.net/responsive/2.4.0/js/dataTables.responsive.min.js"</span>></<span style="color: rgb(224, 108, 117);">script</span>></p><p></<span style="color: rgb(224, 108, 117);">head</span>></p><p><br></p><p><<span style="color: rgb(224, 108, 117);">body</span>></p><p> <<span style="color: rgb(224, 108, 117);">main</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"d-flex align-items-stretch"</span>></p><p> <%- include('../partials/sideNav.ejs') %></p><p> <<span style="color: rgb(224, 108, 117);">section</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"container-fluid"</span>></p><p> <<span style="color: rgb(224, 108, 117);">div</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"row"</span>></p><p> <<span style="color: rgb(224, 108, 117);">div</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"col"</span>></p><p> <<span style="color: rgb(224, 108, 117);">h1</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"my-3"</span>>BCL Vpn Users</<span style="color: rgb(224, 108, 117);">h1</span>></p><p> <<span style="color: rgb(224, 108, 117);">div</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"table-responsive"</span>></p><p> <<span style="color: rgb(224, 108, 117);">table</span> <span style="color: rgb(209, 154, 102);">id</span>=<span style="color: rgb(152, 195, 121);">"user-table"</span> <span style="color: rgb(209, 154, 102);">class</span>=<span style="color: rgb(152, 195, 121);">"table table-striped table-dark w-100"</span>></p><p> <<span style="color: rgb(224, 108, 117);">thead</span>></p><p> <<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Username</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Ip</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Domain</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>Country</<span style="color: rgb(224, 108, 117);">th</span>></p><p> <<span style="color: rgb(224, 108, 117);">th</span> <span style="color: rgb(209, 154, 102);">scope</span>=<span style="color: rgb(152, 195, 121);">"col"</span>>City</<span style="color: rgb(224, 108, 117);">th</span>></p><p> </<span style="color: rgb(224, 108, 117);">tr</span>></p><p> </<span style="color: rgb(224, 108, 117);">thead</span>></p><p> <<span style="color: rgb(224, 108, 117);">tbody</span>></p><p> <% if (users && users.length) { %></p><p> <% users.forEach(user=> { %> <<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.user_name %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.ip %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.domain %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.country %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span>></p><p> <%= user.city %></p><p> </<span style="color: rgb(224, 108, 117);">td</span>></p><p> </<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <% }) %></p><p> <% } else { %></p><p> <<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <<span style="color: rgb(224, 108, 117);">td</span> <span style="color: rgb(209, 154, 102);">colspan</span>=<span style="color: rgb(152, 195, 121);">"5"</span>>No data available</<span style="color: rgb(224, 108, 117);">td</span>></p><p> </<span style="color: rgb(224, 108, 117);">tr</span>></p><p> <% } %></p><p> </<span style="color: rgb(224, 108, 117);">tbody</span>></p><p> </<span style="color: rgb(224, 108, 117);">table</span>></p><p> </<span style="color: rgb(224, 108, 117);">div</span>></p><p> </<span style="color: rgb(224, 108, 117);">div</span>></p><p> </<span style="color: rgb(224, 108, 117);">div</span>></p><p> </<span style="color: rgb(224, 108, 117);">section</span>></p><p> </<span style="color: rgb(224, 108, 117);">main</span>></p><p></<span style="color: rgb(224, 108, 117);">body</span>></p><p><br></p><p></<span style="color: rgb(224, 108, 117);">html</span>></p>
share
report
BBBootstrap Team
3 months ago
1
Add a code
Add Code
Remove ads
remove
Latest codes
view all
Latest Snippets
view all
BBbootstrap
Quick Links
Creators
BBBootstrap Tags
Snippets
About
Contact us
Tools
Online Editor
Color Palette
Gradient Colors
Quizes
Socials
Facebook
Twitter
Instagram
Youtube
© 2024 bbbootstrap. All rights reserved
Terms of Service
Privacy Policy