开源软件名称(OpenSource Name):HomeServicesOfAmerica/styled-material-components开源软件地址(OpenSource Url):https://github.com/HomeServicesOfAmerica/styled-material-components开源编程语言(OpenSource Language):JavaScript 99.8%开源软件介绍(OpenSource Introduction):No Longer MaintainedOur humble recommendation is to use material-ui, which now interops with styled-components fairly well. Styled Material ComponentsStyled Components inspired library that implements Material Design for stress free React Application scaffolding. Table of Contents
Inspiration and goals
Getting Started
Contributing
How to useAll components in this library are either:
Theme ProviderSimilar to the Styled Components ThemeProvider (its a thin wrapper around it) except that it provides a default theme that matches material design's default theme. You can provide a custom theme here with any option from src/theme/defaultTheme.js overwritten. You can nest ThemeProviers just like with StyledComponents to overwrite portions of the theme for sections of your application Global Style Helpers (^0.1.1-beta)Prior to version 0.1.1-beta we injected global styles behind the scenes. In our use case this lead to us having to override these often. Styled-components v4 created a new createGlobalStyle builder that exports components. So now you can import these global styles manually and add them to your code where and if you want.
Component ExampleButtonThis component is for creating a material design button. It has props that match the documentation from Material Components Example Implementation: // Flat button with primary text color
<Button primary>I’m a Button</Button>
// Flat button with accent text color
<Button accent>I’m a Button</Button>
// Raised button with primary background color
<Button raised primary>I’m a Button</Button> Decorator ExamplewithRippleThis is a decorator (higher order component) to add a javascript ripple effect to any element that can have a className attached to it. const JSRippleButton = withRipple(Button);
<JSRippleButton raised primary>Test</JSRippleButton> |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论