Answers for "react custom component style"

1

jsx style styling

style={{color: "white",
        backgroundColor: '#f1356d',
        borderRadius: '8px'
       }}
Posted by: Guest on March-23-2022
0

how to style component using style component

// The Button from the last section without the interpolations
const Button = styled.button`
  color: palevioletred;
  font-size: 1em;
  margin: 1em;
  padding: 0.25em 1em;
  border: 2px solid palevioletred;
  border-radius: 3px;
`;

// A new component based on Button, but with some override styles
const TomatoButton = styled(Button)`
  color: tomato;
  border-color: tomato;
`;

render(
  <div>
    <Button>Normal Button</Button>
    <TomatoButton>Tomato Button</TomatoButton>
  </div>
);
Normal ButtonTomato Button
Posted by: Guest on April-20-2022

Code answers related to "react custom component style"

Code answers related to "Javascript"

Browse Popular Code Answers by Language