score:0
material ui uses inline styles, so to override it try:
<button style={{ fontfamily: 'roboto' }} label='styled button' />
or
<button labelstyle={{ fontfamily: 'roboto' }} label='styled button' />
score:0
it seems that there is another css rule with high priority in your stylesheet file that is styling your button with times new roman. using a browser, inspect your button element to see which css rule is setting the times new roman font and fix it.
it is important to remark that button component of material-ui is set by default its font-family with roboto
score:0
in button.js file:
import './button.css';
const button = ({ children }) => (
<button>{ children }</button>
);
and then in button.css file:
button {
font-family: "roboto"
}
- { children } is the text in between the tags. so in the code above, { children } is passed in from the file that is using your custom button.
for example, if you are using ur custom button in signin.js:
import button from './button';
<div>
// "sign in" is the { children }
<button type="submit">sign in</button>
</div>
Source: stackoverflow.com
Related Query
- How do I change the font family of a reactjs button component?
- Reactjs how to change the state of a component from a different component
- how to change the font color, font size, and button color in React
- ReactJs How to change an icon of a button on the click event?
- How to change the style of a reactjs component by code
- How to change the state of a sibling component in ReactJS for a Master/Slave checkbox system?
- Need Reactjs help on how to properly pass this function from the parent to child button component
- ReactJS and DraftJS, how to change font size on the fly?
- How To Change the Color and Font Of Labels of Bar Chart Using ChartistJs Library with ReactJs
- How to change the text of a single button in Reactjs
- How do I change the value of this component everytime I pass it in? ES6, reactJS
- How to change the color of radio button with font awesome icon in react, styled components
- How to change state of a single component in ReactJS without rendering the whole component again?
- How to access the "key" property from a reactjs component
- ReactJS - How can I access the displayName of a component using javascript?
- How to disable the hover effect of material-ui button inside of a styled component
- How to toggle class in the nested component in ReactJS
- How do I trigger the change event on a react-select component with react-testing-library?
- material UI - How can I change the font size of the label in FormControlLabel
- How to change button text in ReactJS
- How do I change the shape of a button in MUI using theme?
- how to rerender a component when hash change and change the state
- ReactJS how to render a component only when scroll down and reach it on the page?
- Material UI | How to change the font colour of a disabled input text field?
- How do I get the id of a button that was clicked? ReactJS
- How to include the Match object into a ReactJs component class?
- ReactJS component rendering and how to append elements to the div the component is mounted on
- How to create a show more/less button with ReactJS to adjust the size of a div?
- How to change font family for React Recharts library X-axis / Y-axis ticks?
- React.js: How do you change the position of a Component item
More Query from same tag
- React Native: Different styles applied on orientation change
- Passing state up from child component and call a function with React
- How to properly redirect with React Router?
- How to align different react components?
- props are not working when using map method in react.js
- Cypress: is there a way to assert if the value of an input is not empty or at least with some number of chars
- How to Pass an Event Handler as a prop in React?
- React Redux onClick Call to Action Creator Not Working
- React / Flux, setting multiple states
- webpack with babel showing error Module build failed (from ./node_modules/babel-loader/lib/index.js):
- What Aud field indicates in JWT Token?
- React not rendering - Cannot read property of undefined
- How to fetch API data as this. props?
- this.setState not working for this code in React
- How to increment item on button click Reactjs?
- How to set className without {styles.red} in Next.js
- How to describe extracted values to an array in typescript
- App component should place on top of all components in reactjs
- React : How to handle Select condition
- React.useEffect hook and subscribing to a mousewheel event - the right approach
- Testing react component that is dependent on Stateful Context Providers chain in React Testing Library
- How to ignore internal ReactJS code in the call stack while debugging ReactJS
- Get type error cannot destructure property as it is undefined in React
- React Component is Not Displaying the Flash Message on First Submit
- get data attribute from “root” DOM node in react js
- How can i solve blank page? ( React beginner )
- Shoiwng menu while hovering on table row in reactjs
- Webpack bundle.js changes not showing in a Spring application without restarting the server?
- How can I fix 'warning Expected 'this' to be used by class method ' eslint error?
- how to display and map the first id of an state or const data array objects?