Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add example for using styled-components as styled-engine #22788

Merged
merged 36 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c2d31cc
add emotion peer dependencies
mnajdova Sep 25, 2020
5ae933f
fixed types & tests
mnajdova Sep 25, 2020
18b0668
prettier
mnajdova Sep 25, 2020
f0ef95c
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova Sep 28, 2020
583d557
added example project
mnajdova Sep 28, 2020
0bdbd9d
name fix
mnajdova Sep 28, 2020
c7bebb8
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova Sep 28, 2020
92b2d6e
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova Sep 28, 2020
22e0700
prettier
mnajdova Sep 28, 2020
1598adf
changed example to use create-react-app
mnajdova Sep 28, 2020
4205477
updated project name
mnajdova Sep 28, 2020
77d956d
prettier
mnajdova Sep 28, 2020
8c85d35
removed eslintConfig
mnajdova Sep 28, 2020
3fcb447
removed App test
mnajdova Sep 28, 2020
69f6f7b
updated create-react-app package
mnajdova Sep 28, 2020
9b58298
changed version in example
mnajdova Sep 28, 2020
e4467ba
Update examples/create-react-app-with-styled-components-engine/src/Ap…
mnajdova Sep 28, 2020
735d705
Update examples/create-react-app-with-styled-components-engine/src/Ap…
mnajdova Sep 28, 2020
499c0d6
removed index.css
mnajdova Sep 28, 2020
33c7424
Update examples/create-react-app/package.json
mnajdova Sep 28, 2020
d554f85
Update examples/create-react-app-with-styled-components-engine/packag…
mnajdova Sep 28, 2020
be1c594
Update examples/create-react-app-with-styled-components-engine/packag…
mnajdova Sep 28, 2020
3d4d4c4
Update examples/create-react-app-with-styled-components-engine/public…
mnajdova Sep 28, 2020
c6f4e5b
removed index.css import
mnajdova Sep 28, 2020
56876d8
removed unreferenced aria-labelledby
mnajdova Sep 29, 2020
1fa072d
Update docs/src/pages/getting-started/example-projects/example-projec…
mnajdova Sep 29, 2020
13da531
Merge branch 'next' of https://github.com/mui-org/material-ui into next
mnajdova Sep 29, 2020
398ccd2
Merge branch 'next' into feat/add-styled-components-example
mnajdova Sep 29, 2020
b79fb3e
prettier
mnajdova Sep 29, 2020
f679732
Merge branch 'feat/add-styled-components-example' of https://github.c…
mnajdova Sep 29, 2020
436f3a1
Update examples/create-react-app-with-styled-components-engine/packag…
mnajdova Sep 29, 2020
171efee
renamed example & improved description
mnajdova Sep 29, 2020
c97e82f
Merge branch 'feat/add-styled-components-example' of https://github.c…
mnajdova Sep 29, 2020
a3095e1
renamed project name
mnajdova Sep 29, 2020
a6fc69c
added styled-components link
mnajdova Sep 29, 2020
f314d6f
prettier
mnajdova Sep 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -12,6 +12,7 @@ You can find some example projects in the [GitHub repository](https://github.com
- [Preact](https://github.com/mui-org/material-ui/tree/next/examples/preact)
- [CDN](https://github.com/mui-org/material-ui/tree/next/examples/cdn)
- [Plain server-side](https://github.com/mui-org/material-ui/tree/next/examples/ssr)
- [Use styled-components as styled engine](https://github.com/mui-org/material-ui/tree/next/examples/styled-components-as-styled-engine)
- And more

Create React App is an awesome project for learning React.
Expand Down
22 changes: 22 additions & 0 deletions examples/styled-components-as-styled-engine/.gitignore
@@ -0,0 +1,22 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# production
/dist

# IDEs and editors
/.idea
/.vscode

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
11 changes: 11 additions & 0 deletions examples/styled-components-as-styled-engine/index.html
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Material UI with styled-components</title>
<meta charset="UTF-8" />
</head>
<body>
<div id="app"></div>
<script src="src/index.tsx"></script>
</body>
</html>
25 changes: 25 additions & 0 deletions examples/styled-components-as-styled-engine/package.json
@@ -0,0 +1,25 @@
{
"name": "material-ui-with-styled-components",
"version": "1.0.0",
"description": "",
"main": "index.html",
"scripts": {
"start": "parcel index.html --open",
"build": "parcel build index.html"
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
},
"dependencies": {
"@material-ui/core": "next",
"@material-ui/lab": "next",
"@material-ui/styled-engine-sc": "next",
"@types/react": "latest",
"@types/react-dom": "latest",
"parcel-bundler": "^1.6.1",
"react": "latest",
"react-dom": "latest",
"styled-components": "latest"
},
"keywords": [],
"alias": {
"@material-ui/styled-engine": "@material-ui/styled-engine-sc"
}
}
23 changes: 23 additions & 0 deletions examples/styled-components-as-styled-engine/src/demo.tsx
@@ -0,0 +1,23 @@
import React from 'react';
import Slider from '@material-ui/lab/SliderStyled';
import { Typography } from '@material-ui/core';

export default function App() {
return (
<div className="App">
<Typography>Styled slider powered by styled-components</Typography>
<Slider defaultValue={30} aria-labelledby="primary-slider" color="primary" />
<Slider defaultValue={30} aria-labelledby="secondary-slider" color="secondary" />
<Slider defaultValue={30} disabled />
<Slider
defaultValue={30}
aria-labelledby="discrete-slider"
valueLabelDisplay="auto"
step={10}
marks
min={10}
max={110}
/>
</div>
);
}
5 changes: 5 additions & 0 deletions examples/styled-components-as-styled-engine/src/index.tsx
@@ -0,0 +1,5 @@
import * as React from 'react';
import ReactDOM from 'react-dom';
import Demo from './demo';

ReactDOM.render(<Demo />, document.getElementById('app'));