Skip to content

Removing hover effect in ant-checkbox #36678

Answered by valcosmos
Saicharan0662 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, I tried this, it does work.

Hope it can help u.

In App.tsx

import { useState } from 'react'
import { Checkbox } from 'antd'
import 'antd/dist/antd.css'
import './App.css'
import type { CheckboxChangeEvent } from 'antd/es/checkbox';

function App() {
  const onChange = (e: CheckboxChangeEvent) => {
    console.log(`checked = ${e.target.checked}`)
  }
  return (
    <div className="App">
      <Checkbox onChange={onChange}>Checkbox</Checkbox>
    </div>
  )
}

export default App

In App.css

.ant-checkbox-wrapper:hover .ant-checkbox-inner,
.ant-checkbox:hover .ant-checkbox-inner,
.ant-checkbox-input:focus + .ant-checkbox-inner {
  /* border-color: #1890ff; */
  border-color: #d9d9d9 !i…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Saicharan0662
Comment options

Answer selected by Saicharan0662
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants