react Material ui表单代码
代码语言:html
所属分类:表单美化
代码描述:react Material ui表单代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="initial-scale=1, width=device-width" /> <!-- Fonts to support Material Design --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" /> <!-- Icons to support Material Design --> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" /> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/babel.7.18.13.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react.production.18.2.0.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react-dom.production.18.2.0.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/material-ui.production.min.js"></script> </head> <body> <div id="root"></div> <script type="text/babel"> const { colors, CssBaseline, ThemeProvider, Typography, Container, TextField, createTheme, Box, SvgIcon, Stack, Button, Link, } = MaterialUI; // Create a theme instance. const theme = createTheme({ palette: { primary: { main: '#556cd6', }, secondary: { main: '#19857b', }, error: { main: colors.red.A400, }, }, }); function App() { return ( <Box component="form" sx={{ '& .MuiTextField-root': { m: 1, width: '25ch' }, }} noValidate autoComplete="off" > <div> <TextField required id="outlined-required" label="Required" defaultValue="Hello World" /> <TextField disabled id="outlined-disabled" label="Disabled" defaultValue="Hello World" /> <TextField id="outlined-password-input" label="Password" type="password" autoComplete="current-password" /> <TextField id="outlined-read-only-input" label="Read Only" defaultValue="Hello World" InputProps={{ readOnly: true, }} /> <TextField id="outlined-number" label="Number" type="number" InputLabelProps={{ shrink: true, }} /> <TextField id="outlined-search" label="Search field" type="search" /> <TextField id="outlined-helperText" label="Helper text" defaultValue="Default Value" helperText="Some important text" /> </div> <div> <TextField required id="filled-required" label="Required" defaultValue="Hello Wo.........完整代码请登录后点击上方下载按钮下载查看
网友评论0