generated from lucien/actix-react-template
New button component
This commit is contained in:
parent
583b14ce0d
commit
ebf4620640
2 changed files with 41 additions and 0 deletions
12
front/src/components/Button.tsx
Normal file
12
front/src/components/Button.tsx
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { ReactNode, MouseEventHandler } from 'react';
|
||||||
|
|
||||||
|
interface ButtonProps {
|
||||||
|
onClick: MouseEventHandler<HTMLButtonElement>;
|
||||||
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Button({ onClick, children }: ButtonProps) {
|
||||||
|
return (
|
||||||
|
<button onClick={onClick} className="ni-button" role="button">{children}</button>
|
||||||
|
)
|
||||||
|
}
|
|
@ -66,3 +66,32 @@ button:focus-visible {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Button Component */
|
||||||
|
.ni-button {
|
||||||
|
background-color: rgba(51, 51, 51, 0.05);
|
||||||
|
border-radius: 8px;
|
||||||
|
border-width: 0;
|
||||||
|
color: #333333;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
font-family: "Haas Grot Text R Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 20px;
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 12px;
|
||||||
|
text-align: center;
|
||||||
|
transition: all 200ms;
|
||||||
|
vertical-align: baseline;
|
||||||
|
white-space: nowrap;
|
||||||
|
user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ni-button:hover {
|
||||||
|
background-color: rgba(51, 51, 51, 0.1);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue