Files
react-test/docs/data/joy/main-features/automatic-adjustment/InputVariables.js
how2ice 005cf56baf
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
init project
2025-12-12 14:26:25 +09:00

51 lines
1.5 KiB
JavaScript

import * as React from 'react';
import Box from '@mui/joy/Box';
import Button from '@mui/joy/Button';
import ListDivider from '@mui/joy/ListDivider';
import Input from '@mui/joy/Input';
import FormControl from '@mui/joy/FormControl';
import FormLabel from '@mui/joy/FormLabel';
export default function InputVariables() {
const [radius, setRadius] = React.useState(16);
const [childHeight, setChildHeight] = React.useState(28);
return (
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<Input
size="md"
placeholder="email@mui.com"
endDecorator={
<Button variant="soft" size="sm">
Subscribe
</Button>
}
sx={{
'--Input-radius': `${radius}px`,
'--Input-decoratorChildHeight': `${childHeight}px`,
}}
/>
<ListDivider component="hr" />
<Box sx={{ mx: 'auto', display: 'flex', gap: 2 }}>
<FormControl>
<FormLabel>--Input-radius</FormLabel>
<Input
size="sm"
type="number"
value={radius}
onChange={(event) => setRadius(event.target.valueAsNumber)}
/>
</FormControl>
<FormControl>
<FormLabel>--Input-decoratorChildHeight</FormLabel>
<Input
size="sm"
type="number"
value={childHeight}
onChange={(event) => setChildHeight(event.target.valueAsNumber)}
/>
</FormControl>
</Box>
</Box>
);
}